A robust, scalable backend API for the Quick-Bite food delivery platform. Built with Node.js, Express, and Prisma, this server handles user authentication, order management, payment processing, and database operations with high performance and security.
- RESTful API: Comprehensive endpoints for all platform operations.
- Database Management: Prisma-powered ORM with PostgreSQL for reliable data handling.
- Authentication & Authorization: Secure user management with Better Auth.
- Payment Processing: Integrated Stripe for seamless transactions.
- Order Management: Real-time order tracking and status updates.
- Menu & Restaurant Services: Flexible APIs for provider menu management.
- Review System: Customer feedback collection and analysis.
- Email Notifications: Nodemailer integration for user communications.
- Webhook Support: Stripe webhook handling for payment confirmations.
- Scalable Architecture: Modular design supporting microservices expansion.
Quick-Bite Server drives operational excellence with:
- High Availability: 99.9% uptime with optimized database queries.
- Security First: Enterprise-grade authentication and data protection.
- Cost Efficiency: Scalable infrastructure reducing operational costs.
- Analytics Ready: Structured data for business intelligence and growth insights.
- Runtime: Node.js
- Framework: Express.js
- Database: PostgreSQL with Prisma ORM
- Authentication: Better Auth
- Payments: Stripe API
- Email: Nodemailer
- Build Tool: tsup (TypeScript bundler)
- Development: tsx for hot reloading
- Deployment: Vercel-ready configuration
- Node.js 18+
- PostgreSQL database
- Stripe account for payments
- pnpm (recommended) or npm/yarn
-
Clone the repository:
git clone https://github.com/your-org/quick-bite-server.git cd quick-bite-server -
Install dependencies:
pnpm install
-
Set up environment variables: Create a
.envfile in the root directory:DATABASE_URL="postgresql://username:password@localhost:5432/quickbite" BETTER_AUTH_SECRET="your-secret-key" BETTER_AUTH_URL="http://localhost:5000" STRIPE_SECRET_KEY="sk_test_..." STRIPE_WEBHOOK_SECRET="whsec_..." EMAIL_USER="your-email@gmail.com" EMAIL_PASS="your-app-password"
-
Set up the database:
npx prisma migrate dev npx prisma generate
-
Seed admin user (optional):
pnpm run seed:admin
-
Run the development server:
pnpm dev
The server will start on http://localhost:5000.
pnpm dev- Start development server with hot reloadpnpm build- Build for productionpnpm seed:admin- Seed admin userpnpm stripe:webhook- Start Stripe webhook listener
POST /auth/login- User loginPOST /auth/register- User registrationPOST /auth/logout- User logout
GET /users- Get all users (Admin)GET /users/:id- Get user by IDPUT /users/:id- Update user
GET /restaurants- Get all restaurantsPOST /restaurants- Create restaurant (Provider)PUT /restaurants/:id- Update restaurant
GET /menu- Get menu itemsPOST /menu- Add menu item (Provider)PUT /menu/:id- Update menu item
POST /orders- Place new orderGET /orders- Get user ordersPUT /orders/:id/status- Update order status
POST /payment/create-session- Create Stripe checkout sessionPOST /webhook- Stripe webhook endpoint
For detailed API specs, see the API Documentation.
FROM node:18-alpine
WORKDIR /app
COPY package*.json ./
RUN npm ci --only=production
COPY . .
RUN npm run build
EXPOSE 5000
CMD ["npm", "start"]We welcome contributions! Please follow these steps:
- Fork the repository.
- Create a feature branch:
git checkout -b feature/your-feature. - Commit changes:
git commit -m 'Add your feature'. - Push to the branch:
git push origin feature/your-feature. - Open a Pull Request.
For support, email saqibahamd0404@gmail.com
Powered by cutting-edge technology for the food delivery revolution.