This is the backend API for the Anthil Networks Bus Booking System, built using Node.js, Express, and SQLite3.
It supports features like admin route & bus management, user bookings, and role-based authentication using JWT.
β
Render Deployment URL
π https://anthil-networks-bus-booking-backend.onrender.com
β
AWS EC2 Deployment URL
π http://ec2-51-20-37-192.eu-north-1.compute.amazonaws.com:5000
anthil-networks-backend/
βββ controllers/ # Business logic for admin, auth, user
βββ middlewares/ # Auth, validation
βββ models/ # SQLite DB models
βββ routes/ # Route definitions
βββ utils/ # JWT helpers
βββ API_Documentation/ # π API_Documentation.md (detailed)
βββ postman/ # π¦ BusBookingCollection.json
βββ Dockerfile # Docker configuration
βββ .env # Environment variables
βββ .env.example # Env template (no secrets)
βββ package.json
βββ server.js # Entry point
βββ README.md # Project readme
git clone https://github.com/Puneetharajkr/anthil-networks-bus-booking-backend.git
cd anthil-networks-backend
npm install
cp .env.example .env Then fill in required values inside .env.
npm start or node server.js or nodemon server.js Server runs on: http://localhost:5000
πΉ API_Documentation/API_Documentation.md β Full list of all API endpoints with request body, success & error responses. πΉ postman/BusBookingCollection.json β Import this collection into Postman to test all endpoints directly.
Make sure you have Docker Desktop installed.
docker build -t bus-booking-api .
docker run -d -p 5000:5000 --name bus-booking bus-booking-api
Access the app at: π http://localhost:5000
Launched an Ubuntu 24.04 EC2 instance Installed Docker & configured it Uploaded project files to EC2 (via scp) Built & ran Docker container on EC2
π Final deployed EC2 URL: http://ec2-51-20-37-192.eu-north-1.compute.amazonaws.com:5000
Can add/view/delete buses and routes
Can register/login, view buses, and book/cancel tickets
JWT tokens are generated on login
Use the token in Authorization: Bearer header for protected routes
email: admin@example.com password: admin123
email: user@example.com password: user123
Node.js + Express SQLite3 (local database) JWT for auth Docker (containerized deployment) AWS EC2 (cloud hosting) Postman (API testing)
π Car Buying App β Second-hand Car Marketplace This is a web-based application that enables users to browse, request, and book second-hand cars. Admins can manage listings and requests through an admin dashboard.
β
Netlify Deployment URL
π https://anthill-networks-cars-app.netlify.app/
π Features π€ User Login with Google
Browse available cars with search & filter
View car details
Submit purchase requests
View "My Requests" and booking status
Book the car once the request is approved
π Admin Login with Google (admin role detected via Firestore)
Access admin dashboard
View all purchase requests
Change request status (Pending β Approved/Rejected/Contacted)
View & manage all bookings (change status to Completed/Cancelled)
π Tech Stack Frontend: React.js (Hooks, Routing)
Auth: Firebase Authentication (Google Sign-In)
Database: Firebase Firestore
Storage: Firebase Storage (for car images)
Hosting (optional): Firebase Hosting / Vercel
π Working Flow πΉ 1. Authentication User logs in using Google.
Firebase Auth tracks current user session.
Admin role is fetched from Firestore (roles collection β role: "admin").
πΉ 2. Car Listings Cars are listed from Firestore cars collection.
Users can search by make, model, year, or price.
πΉ 3. Purchase Requests When a user is interested in a car, they click "Request to Purchase".
A record is saved in the purchaseRequests collection with user & car info.
πΉ 4. Admin Panel Admin views all user requests.
Admin can update the status:
Pending β Approved, Rejected, or Contacted
Once request is approved, the user sees "Book Now" button.
πΉ 5. Booking Flow User clicks "Book Now" β creates a record in bookings collection.
Admin can view all bookings and update status:
Booked β Completed or Cancelled
π Firebase Collections markdown Copy Edit
-
cars
- {id, make, model, year, price, imageUrls[] }
-
purchaseRequests
- {id, userId, carId, status, message }
-
bookings
- {id, userId, carId, status, createdAt }
-
roles
- {uid: string, role: "admin"} βοΈ Setup Instructions bash Copy Edit
git clone cd car-buying-app
npm install
npm start π§ͺ Sample Admin Setup To make someone admin:
Go to Firestore
Create document in roles collection:
Document ID = user UID
Field = role: "admin"
πΈ Screenshots (Add screenshots of Home, Car Detail, Admin Dashboard, My Requests, etc.)
π Final Note This project demonstrates full-stack implementation using Firebase and React, covering authentication, CRUD operations, conditional role-based access, and real-time updates.
Built by Puneetharaj K R puneetharajkr123@gmail.com