Live Deployment: https://apollo-level2-web-dev-b6-a2.vercel.app/api/v1/
A backend API for a vehicle rental management system that handles:
- Vehicles - Manage vehicle inventory with availability tracking
- Customers - Manage customer accounts and profiles
- Bookings - Handle vehicle rentals, returns and cost calculation
- Authentication - Secure role-based access control (Admin and Customer roles)
- Node.js + TypeScript
- Express.js (web framework)
- PostgreSQL (database)
- bcrypt (password hashing)
- jsonwebtoken (JWT authentication)
- JWT-based signin
- Password hashing with bcrypt
- Role based autorization
Admin-> Full accessCustomer-> Can register, browse vehicles and can manage their own bookings
Add,Update,Deletevehicles (Admin only)- Public endpoints for browsing single or all vehicles
Browse,Update,Deleteusers (Admin only)- Customers can manage their own profile
- Safe deletaion (Users cannot be deleted if they have active bookings)
- Create bookings with vehicle availability validation
- Auto Update vehicle status (booked/available)
- Browse all bookings (Admin only)
- Customers can brose their own bookings
- Cancel or Return bookings based on role and rules
npm install
2. Configure environment (see .env.example for reference)
npm run dev
To use the development version of the API, you can use Postman or Thunder VS Code Extension
When finished developing the API, you can run
npm run build
And run it in production by running
npm start
There are some free serverless cloud platforms where you can deploy your API, like Vercel, Netlify and even Cloudflare!