The robust backend service powering Foodie app, a modern food ordering platform. Built with Node.js, Express, and MongoDB to handle restaurant management, orders, and user interactions.
-
- Auth0 integration for secure authentication
- User profile management
-
- CRUD operations for restaurants
- Menu item management
- Image upload with Cloudinary integration
- Restaurant search and filtering
-
- Secure payment processing with Stripe
- Order status management
- Real-time order updates
-
- JWT token validation
- Input validation and sanitization
- Secure environment configuration
-
Runtime & Framework
- Node.js
- Express.js
- TypeScript
-
Database
- MongoDB
- Mongoose ODM
-
Authentication
- Auth0
- JWT
-
Cloud Services
- Cloudinary (Image Management)
- Stripe (Payments)
-
Development Tools
- nodemon
- ESLint
- Prettier
-
Clone the repository
git clone https://github.com/neerajsingh869/foody-backend.git cd foodie-backend
-
Install dependencies
npm install
-
Environment Setup
Go here for Envrironment setup
-
Start development server
npm run dev
-
GET /api/my/user # Get current user POST /api/my/user # Create new user PUT /api/my/user # Update current user profile
-
- For current user
GET /api/my/restaurant # Get current user's restaurant POST /api/my/restaurant # Create current user's restaurant PUT /api/my/restaurant # Update current user's restaurant
- General
GET /api/restaurant/:restaurantId # Get specific restaurant GET /api/restaurant/search/:city # Get restaurants of specific city
- For current user
-
For current user
GET /api/order # Get current user's orders GET /api/my/restaurant/orders # Get all orders of current user's restaurant PATCH /api/my/restaurant/order/:orderId/status # Update order status of current user's restaurant
-
General
POST /api/order/checkout/webhook # Webhook for order payment status POST /api/order/checkout/create-checkout-session # Create checkout session for order payment
MONGODB_CONNECTION_URL=your_mongodb_connection_url
AUTH0_AUDIENCE=your_auth0_audience
AUTH0_ISSUER_BASE_URL=your_auth0_issuer_base_url
AUTH0_TOKEN_SIGNING_ALGORITHM=your_auth0_token_signing_algorithm
CLOUDINARY_CLOUD_NAME=your_cloudinary_cloud_name
CLOUDINARY_API_KEY=your_cloudinary_api_key
CLOUDINARY_API_SECRET=your_cloudinary_api_secret
STRIPE_API_KEY=your_stripe_api_key
FRONTEND_URL=http://localhost:5173
STRIPE_WEBHOOK_SECRET=your_stripe_webhook_secret
This backend is deployed on Render. For deployment:
- Push your changes to GitHub
- Connect your Render account to GitHub
- Configure environment variables
- Deploy!
We welcome contributions! Please follow these steps:
- Fork the repo, develop, and make code changes.
- Make sure that your commit messages clearly describe the changes.
- Send a pull request.
This project is licensed under the MIT License - see the LICENSE file for details.