FixItNow is a production-ready, highly secure, and scalable on-demand service marketplace backend. It enables customers to find and book professional technicians for various services, allows technicians to manage their availability and bookings, and provides an admin dashboard for full platform oversight.
| Item | Value |
|---|---|
| Backend Repo | https://github.com/Sumayea104/fixitnow-backend |
| Live API | https://fixitnow-backend-m1ur.onrender.com |
| API Docs | https://fixitnow-backend-m1ur.onrender.com/api-docs |
| Postman Collection | https://github.com/Sumayea104/fixitnow-backend/blob/main/postman/FixItNow.postman_collection.json |
| Admin Email | admin@fixitnow.com |
| Admin Password | admin123 |
| Demo Video | π¬ |
β οΈ These credentials are for testing and demonstration only.
| Technology | Purpose |
|---|---|
| Runtime: | Node.js (v18+ or v20+) |
| Framework: | Express.js with TypeScript |
| Database: | PostgreSQL (Neon) |
| ORM: | Prisma ORM |
| Security: | Helmet, CORS, bcrypt, JSON Web Token (JWT) |
| Validation: | Zod |
| Logger: | Morgan |
| Payment: | Stripe & SSLCommerz |
The project follows a Modular Architecture for scalability and clean separation of concerns:
fixitnow-backend/
βββ src/
β βββ config/
β β βββ env.ts
β β βββ prisma.ts
β βββ constants/
β β βββ index.ts
β βββ errors/
β β βββ AppError.ts
β βββ interfaces/
β β βββ index.ts
β βββ middleware/
β β βββ auth.ts
β β βββ errorHandler.ts
β β βββ role.ts
β β βββ validate.ts
β βββ modules/
β β βββ admin/
β β β βββ admin.controller.ts
β β β βββ admin.route.ts
β β β βββ admin.service.ts
β β β βββ admin.validation.ts
β β βββ auth/
β β β βββ auth.controller.ts
β β β βββ auth.route.ts
β β β βββ auth.service.ts
β β β βββ auth.validation.ts
β β βββ booking/
β β β βββ booking.constant.ts
β β β βββ booking.controller.ts
β β β βββ booking.interface.ts
β β β βββ booking.route.ts
β β β βββ booking.service.ts
β β β βββ booking.validation.ts
β β βββ category/
β β β βββ category.controller.ts
β β β βββ category.route.ts
β β β βββ category.service.ts
β β β βββ category.validation.ts
β β βββ payment/
β β β βββ payment.controller.ts
β β β βββ payment.route.ts
β β β βββ payment.service.ts
β β β βββ payment.validation.ts
β β βββ review/
β β β βββ review.controller.ts
β β β βββ review.route.ts
β β β βββ review.service.ts
β β β βββ review.validation.ts
β β βββ service/
β β β βββ service.controller.ts
β β β βββ service.route.ts
β β β βββ service.service.ts
β β β βββ service.validation.ts
β β βββ technician/
β β β βββ technician.controller.ts
β β β βββ technician.route.ts
β β β βββ technician.service.ts
β β β βββ technician.validation.ts
β β βββ user/
β β βββ user.controller.ts
β β βββ user.route.ts
β β βββ user.service.ts
β β βββ user.validation.ts
β βββ utils/
β βββ app.ts
β βββ server.ts
βββ prisma/
β βββ schema.prisma
β βββ prisma.config.ts
βββ .env
βββ .gitignore
βββ package-lock.json
βββ package.json
βββ README.md
βββ tsconfig.json
- Helmet: Secure HTTP headers to prevent common vulnerabilities
- CORS: Configured cross-origin resource sharing
- Data Validation: Runtime request schema validation enforced via Zod
- Password Hashing: Secure cryptography with bcrypt
- Role-Based Access Control (RBAC): Strict endpoint protection based on authorization roles (Admin, Customer, Technician)
- JWT Authentication: Stateless authentication with JSON Web Tokens
- Environment Variables: Secure configuration management
Base URL: https://fixitnow-backend-m1ur.onrender.com
| Method | Endpoint | Description |
|---|---|---|
POST |
/api/auth/register |
Register a new user |
POST |
/api/auth/login |
User login |
GET |
/api/auth/me |
Get current logged-in user details |
| Method | Endpoint | Description | Access |
|---|---|---|---|
GET |
/api/users/profile |
Get current user profile | Private |
PUT |
/api/users/profile |
Update user profile | Private |
PATCH |
/api/users/change-password |
Change user password | Private |
GET |
/api/users |
Get all users | Admin |
GET |
/api/users/:id |
Get user by ID | Admin |
PATCH |
/api/users/:id/status |
Update user status | Admin |
| Method | Endpoint | Description |
|---|---|---|
GET |
/api/admin/dashboard/stats |
Get platform dashboard statistics |
GET |
/api/admin/users |
Get all users with filters |
GET |
/api/admin/users/:id |
Get user details by ID |
PATCH |
/api/admin/users/:id/status |
Update user status |
POST |
/api/admin/categories |
Create a new service category |
GET |
/api/admin/categories |
Get all categories |
PATCH |
/api/admin/categories/:id |
Update a category |
DELETE |
/api/admin/categories/:id |
Delete a category |
| Method | Endpoint | Description |
|---|---|---|
GET |
/api/technicians |
Get all technicians with filters |
GET |
/api/technicians/:id |
Get technician profile by ID |
PUT |
/api/technicians/profile |
Update technician profile |
PUT |
/api/technicians/availability |
Update technician availability slots |
GET |
/api/technicians/bookings |
Get technician's bookings |
PATCH |
/api/technicians/bookings/:id |
Update booking status |
GET |
/api/technicians/stats |
Get technician statistics |
| Method | Endpoint | Description |
|---|---|---|
POST |
/api/bookings |
Create a new booking |
GET |
/api/bookings |
Get current user's bookings |
GET |
/api/bookings/:id |
Get booking details by ID |
PATCH |
/api/bookings/:id/cancel |
Cancel a booking |
PATCH |
/api/bookings/:id/status |
Update booking status (Technician only) |
| Method | Endpoint | Description |
|---|---|---|
POST |
/api/payments/create |
Create a payment |
GET |
/api/payments |
Get payment history |
GET |
/api/payments/:id |
Get payment details |
PATCH |
/api/payments/confirm/:id |
Confirm payment |
| Method | Endpoint | Description |
|---|---|---|
GET |
/api/reviews |
Get all reviews with filters |
POST |
/api/reviews |
Create a review |
GET |
/api/reviews/:id |
Get review details by ID |
PATCH |
/api/reviews/:id |
Update a review |
DELETE |
/api/reviews/:id |
Delete a review |
GET |
/api/reviews/technician/:technicianId |
Get all reviews for a technician |
POST |
/api/reviews/:id/helpful |
Mark a review as helpful |
POST |
/api/reviews/:id/reply |
Reply to a review |
-
Dual Payment Gateway Integration (Stripe & SSLCommerz):
- Challenge: Integrating both Stripe and SSLCommerz required managing distinct transaction flows, payload structures, and webhook handlers for international and local currency payments seamlessly.
- Solution: Designed a unified payment service module with isolated routing logic and dedicated webhook listeners to process real-time status updates from both gateways securely.
-
Role-Based Routing & Security (RBAC):
- Challenge: Restricting route access cleanly across three distinct user roles (
Customer,Technician, andAdmin) without repetitive permission logic. - Solution: Implemented a strict, middleware-driven Role-Based Access Control (RBAC) layer (
verifyToken,verifyAdmin,verifyTechnician) that validates JWTs and authorizes requests based on user roles before reaching controller logic.
- Challenge: Restricting route access cleanly across three distinct user roles (
-
Prisma Client & Vercel Deployment Issues:
- Challenge: Initially deploying the backend on Vercel caused database connection failures as the Prisma Client wasn't generated during the automated build phase.
- Solution: Resolved the deployment issue by configuring a custom pre-build script (
"vercel-build": "prisma generate && tsc -b") inpackage.json, ensuring schema generation occurs prior to TypeScript compilation.
-
Automating Authentication with Cookie-Parser Migration:
- Challenge: Replaced tedious manual
Authorization: Bearer <token>token copy-pasting during Postman testing and frontend integration by migrating to secure HTTP-Only Cookies. - Solution: Integrated
cookie-parseron the backend so that JWTs are automatically injected and stored in client storage upon login, securing the authentication flow and protecting against XSS attacks.
- Challenge: Replaced tedious manual
-
Multi-Gateway Architecture: Learned how to architect modular payment handlers that cleanly separate localized payment logic (SSLCommerz) from global standards (Stripe).
-
CI/CD & Deployment Configurations: Gained hands-on experience troubleshooting build-time environment dependencies, database ORM client generation, and cloud deployment pipelines.
-
Modern Web Security Practices: Practical knowledge in hardening authentication with HTTP-Only cookies, CORS policies, and strict role-based authorization layers.
- Swagger UI: fixitnow-backend-m1ur.onrender.com/api-docs
- Postman Collection: FixItNow.postman_collection.json
| Credential | Value |
|---|---|
admin@fixitnow.com |
|
| Password | admin123 |
β οΈ These credentials are for testing and demonstration only.
# Health Check
curl https://fixitnow-backend-m1ur.onrender.com/health
# Register User
curl -X POST https://fixitnow-backend-m1ur.onrender.com/api/auth/register \
-H "Content-Type: application/json" \
-d '{"email":"test@example.com","password":"password123","name":"Test User","role":"CUSTOMER"}'
# Login
curl -X POST https://fixitnow-backend-m1ur.onrender.com/api/auth/login \
-H "Content-Type: application/json" \
-d '{"email":"test@example.com","password":"password123"}'
Import the Postman collection from [postman/FixItNow.postman_collection.json](https://documenter.getpostman.com/view/55163778/2sBY4SNK1v)
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Sumayea Rahman
- GitHub: Sumayea104
- Email: sumayearahman7@gmail.com
For any questions or issues, please open an issue or contact the developer.
If you found this project helpful, please give it a β on GitHub!