Skip to main content

Fleet Management & Fuel Tracking API

Comprehensive REST API for managing vehicle fleets, tracking fuel consumption, maintenance scheduling, and budget planning. Built with Express, TypeScript, and Supabase.

Quick Start

Get up and running with the Tanqueo Backend API in minutes.

1

Set up your environment

Clone the repository and install dependencies:
git clone https://github.com/marcosaguilar05/backend.git
cd backend
npm install
2

Configure environment variables

Create a .env file with your Supabase credentials:
PORT=5000
FRONTEND_URL=http://localhost:3000
SUPABASE_URL=your_supabase_url
SUPABASE_ANON_KEY=your_supabase_anon_key
3

Start the server

Run the development server:
npm run dev
The API will be available at http://localhost:5000
4

Make your first request

Authenticate to get an access token:
curl -X POST http://localhost:5000/api/auth/login \
  -H "Content-Type: application/json" \
  -d '{"email": "[email protected]", "password": "your_password"}'
{
  "user": {
    "id": "uuid",
    "email": "[email protected]",
    "nombre": "John Doe",
    "rol": "admin"
  },
  "access_token": "eyJhbGc...",
  "refresh_token": "eyJhbGc...",
  "expires_at": 1234567890,
  "expires_in": 3600
}

Explore by Module

Comprehensive API endpoints for complete fleet management operations.

Fuel Tracking

Track fuel consumption, costs, and generate detailed analytics reports.

Fleet Management

Manage your vehicle fleet with detailed characteristics and history.

Maintenance

Schedule and track preventive and corrective maintenance events.

Vehicle Documents

Manage SOAT, RTM, insurance policies with expiration alerts.

Lubrication Services

Track lubrication, washing, and other vehicle service costs.

Budget Planning

Create and manage budgets by department, vehicle, and category.

Fuel Station Balances

Monitor fuel station balances and track available funds across areas.

Catalogs & Upload

Access catalog data and manage document uploads for vehicles.

Key Features

Everything you need for comprehensive fleet operations management.

Dashboard Analytics

Real-time KPIs, consumption trends, alerts, and detailed reports for data-driven decisions.

Role-Based Authentication

Secure authentication with Supabase, JWT tokens, and role-based access control.

Bulk Import

Import large datasets efficiently with batch operations for fuel records and maintenance logs.

Expiration Alerts

Automatic alerts for expiring documents like SOAT, RTM, and insurance policies.

Ready to Get Started?

Explore our comprehensive API documentation and start building your fleet management solution today.