A comprehensive quotation system for agricultural machinery with web interface, API, and Telegram bot integration.
- Web Interface: Modern React frontend with Tailwind CSS
- Dynamic Catalog: Organized machinery catalog with 10+ categories and 50+ products
- REST API: FastAPI backend for quotation management
- Telegram Bot: Generate quotations, search products, and manage prices via Telegram
- PDF Generation: Professional quotation PDFs with company branding
- Admin Dashboard: Web-based admin panel for managing quotations
- Database: SQLite/PostgreSQL support for data persistence
- Search Functionality: Advanced search across products and categories
Frontend (React/Vite) → API (FastAPI) → Database (SQLite)
↘
Telegram Bot
- Node.js 18+
- Python 3.11+
- Git
- Install dependencies:
npm install- Start development server:
npm run devThe frontend will be available at http://localhost:5173
- Navigate to backend directory:
cd backend- Create virtual environment:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate- Install dependencies:
pip install -r requirements.txt- Copy environment variables:
cp .env.example .env- Configure environment variables in
.env:
TELEGRAM_TOKEN=your_telegram_bot_token
ADMIN_USER_IDS=123456789,987654321
API_BASE_URL=http://localhost:8000
ADMIN_USER=admin
ADMIN_PASS=your_secure_password- Start the API server:
uvicorn app:app --reloadAPI will be available at http://localhost:8000
- Create a bot with @BotFather
- Get your bot token and add it to
.env - Get your Telegram user ID and add it to
ADMIN_USER_IDS - Run the bot:
python telegram_bot.py- Install Vercel CLI:
npm install -g vercel- Deploy:
vercel --prod- Fork this repository
- Create a new Web Service on Render
- Connect your repository
- Set environment variables:
ADMIN_USER: Admin usernameADMIN_PASS: Admin passwordTELEGRAM_TOKEN: Your Telegram bot tokenADMIN_USER_IDS: Comma-separated list of admin Telegram user IDs
The render.yaml file will handle the deployment automatically.
Create the following environment variables in your deployment platform:
Backend (Render):
ADMIN_USER: Admin username for web dashboardADMIN_PASS: Admin password for web dashboardTELEGRAM_TOKEN: Telegram bot tokenADMIN_USER_IDS: Comma-separated admin Telegram user IDs
Frontend (Vercel):
VITE_API_URL: URL of your deployed backend API
/start- Welcome message and command list/help- Show available commands/list_machines- List all available machines with prices/search <term>- Search machinery by name or category/quote <code> <name> <contact>- Generate quotation
/set_price <code> <price>- Update machine price
/search tolva
/quote ACO001 Juan Pérez +54911234567
/set_price ACO001 40000
/list_machines
cd backend
pytest tests/ -vnpm testUpdate the brand colors in tailwind.config.js:
colors: {
'agromaq-green': {
600: '#16a34a', // Primary green
// ... other shades
},
'agromaq-yellow': {
500: '#eab308', // Primary yellow
// ... other shades
}
}Replace the Tractor icon in the header with your actual logo:
// In src/App.tsx
<div className="w-10 h-10 bg-green-600 rounded-lg flex items-center justify-center">
<img src="/logo.png" alt="Agromaq" className="w-6 h-6" />
</div>Once the backend is running, visit:
- API Docs:
http://localhost:8000/docs - Alternative Docs:
http://localhost:8000/redoc
GET /machines- List all machinesPOST /quotation- Create new quotationGET /quotation/{id}/download- Download quotation PDFGET /admin/quotations- List all quotations (admin only)PUT /admin/machine/{code}/price- Update machine price (admin only)
The system includes the following product categories:
- Acoplados rurales: 7 products
- Acoplados tanque: 7 products
- Tolvas: 8 products
- Cargadores y elevadores: 3 products
- Carretón: 1 product
- Otros implementos rurales: 2 products
- Palas de arrastre: 5 products
- Rastras: 5 products
- Sin fines (transportadores): 4 products
- Tráilers: 1 product
- Admin authentication using HTTP Basic Auth
- Telegram bot admin verification via user ID whitelist
- Environment variables for sensitive data
- CORS configuration for production
- Application logs via standard Python logging
- Database queries monitored
- API endpoint performance tracking
- Telegram bot error handling
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
This project is licensed under the MIT License.
Built with ❤️



