RideHub is a full-stack Vehicle Booking Management System developed using FastAPI, React (Vite + TypeScript), PostgreSQL, and Tailwind CSS.
The system allows service centers or vehicle maintenance companies to efficiently manage vehicle service bookings with secure authentication, dashboard statistics, search functionality, and archive/restore capabilities.
- User Registration
- User Login
- JWT Authentication
- Protected Routes
- Secure Password Hashing (bcrypt)
- Logout
Displays real-time booking statistics:
- Total Bookings
- Pending Bookings
- Completed Bookings
- Archived Bookings
Users can:
- Create a new booking
- View all active bookings
- Edit booking details
- Search bookings
- Archive bookings
Users can:
- View archived bookings
- Restore archived bookings
- React
- Vite
- TypeScript
- React Router DOM
- React Hook Form
- Zustand
- Axios
- Tailwind CSS
- FastAPI
- SQLAlchemy
- PostgreSQL
- Pydantic
- JWT Authentication
- Passlib (bcrypt)
- Uvicorn
RideHub/
│
├── backend/
│
│ ├── app/
│ │
│ ├── api/
│ ├── core/
│ ├── models/
│ ├── repository/
│ ├── schemas/
│ ├── services/
│ ├── main.py
│
│
├── frontend/
│
│ ├── src/
│ │
│ ├── api/
│ ├── components/
│ ├── layouts/
│ ├── pages/
│ ├── routes/
│ ├── store/
│ ├── types/
│ ├── App.tsx
│ └── main.tsx
│
└── README.md
git clone https://github.com/yourusername/ridehub.gitcd RideHub/backend
Windows
python -m venv venvActivate
venv\Scripts\activatepip install -r requirements.txtCreate a .env file.
DATABASE_URL=postgresql://postgres:password@localhost:5432/ridehub
SECRET_KEY=your_secret_key
ALGORITHM=HS256
ACCESS_TOKEN_EXPIRE_MINUTES=60
uvicorn app.main:app --reloadBackend URL
http://127.0.0.1:8000
Swagger Documentation
http://127.0.0.1:8000/docs
Navigate to frontend
cd frontendInstall dependencies
npm installRun development server
npm run devFrontend URL
http://localhost:5173
RideHub uses JWT authentication.
After successful login:
- JWT token is generated
- Token is stored in Local Storage
- Axios automatically attaches Authorization headers
- Protected routes require a valid token
Example:
Authorization: Bearer <JWT_TOKEN>
| Method | Endpoint |
|---|---|
| POST | /auth/register |
| POST | /auth/login |
| Method | Endpoint |
|---|---|
| GET | /api/v1/bookings |
| POST | /api/v1/bookings |
| GET | /api/v1/bookings/{id} |
| PUT | /api/v1/bookings/{id} |
| PATCH | /api/v1/bookings/{id}/archive |
| PATCH | /api/v1/bookings/{id}/restore |
| GET | /api/v1/bookings/search |
| GET | /api/v1/bookings/archived |
| GET | /api/v1/bookings/stats |
Main Tables
- id
- name
- password
- created_at
- id
- booking_reference
- customer_name
- customer_email
- customer_phone
- vehicle_registration_number
- chassis_number
- vehicle_make
- vehicle_model
- manufacturing_year
- mileage
- booking_status
- booking_date
- remarks
- is_deleted
✔ JWT Authentication
✔ REST API Architecture
✔ Repository Pattern
✔ Service Layer Pattern
✔ Responsive Dashboard
✔ Real-time Statistics
✔ Vehicle Search
✔ Archive & Restore
✔ PostgreSQL Integration
✔ FastAPI Documentation
✔ TypeScript Frontend
✔ State Management with Zustand
- User Registration
- User Login
- Dashboard
- Booking List
- Create Booking
- Edit Booking
- Search Booking
- Archive Booking
- Restore Booking