Welcome to the backend of the Bistro Boss Restaurant web application. This server handles all the logic and data management for the restaurant, including user authentication, order management, reservations, and more.
-
Authentication
- Email/password registration
- Google sign-in for easier user authentication
- CAPTCHA for enhanced login security
- Firebase Authentication for secure sign-ups and sign-ins
-
Order Management: Handle and manage user orders, including order statuses.
-
Reservation System: Handle table reservations and bookings.
-
Payment Integration: Integration with Stripe for processing payments securely.
-
User Messaging: Users can send messages to admins for feedback or queries.
-
Order History: Retrieve past orders and booking information.
-
Admin Dashboard:
- View and manage total revenue
- Manage user roles and permissions
- Control menu items (add, update, or delete items)
- Manage orders with status updates (Accepted, Cooking, Packaging, etc.)
- Manage table reservations (Confirm, Cancel, or Delete)
-
Messaging System: Handle messages sent by users.
- Backend: Node.js, Express.js
- Database: MongoDB
- Authentication: Firebase Authentication, JWT (JSON Web Tokens)
- Payment: Stripe API
- Security: CAPTCHA Integration
- Deployment: Railway
- Node.js: Ensure that you have Node.js installed on your machine. You can download it from here.
- MongoDB: Set up a MongoDB database, either locally or using a service like MongoDB Atlas.
-
Clone the repository:
git clone https://github.com/mohasin-hossain/bistro-boss-server.git cd bistro-boss-server
-
Install dependencies:
npm install
-
Create a
.env
file in the root directory and add the following environment variables:MONGO_URI=your_mongodb_connection_string STRIPE_SECRET_KEY=your_stripe_secret_key FIREBASE_API_KEY=your_firebase_api_key JWT_SECRET=your_jwt_secret_key
-
Run the server:
npm start
-
The server should now be running at
http://localhost:5000
.
Here is an overview of the available API endpoints:
- POST /api/auth/register: Register a new user
- POST /api/auth/login: User login (supports email/password and Google sign-in)
- POST /api/orders: Place a new order
- GET /api/orders: Get all orders (Admin)
- POST /api/payments: Make a payment using Stripe
- GET /api/reservations: Get table reservations (Admin)
- POST /api/reservations: Create a table reservation
For detailed API documentation, refer to the Postman collection or API documentation within the project.
- The backend is deployed on Railway and can be accessed at:
https://bistro-boss-server-production-5043.up.railway.app/
If you want to contribute to this project, follow these steps:
- Fork the repository.
- Create a new branch (
git checkout -b feature-branch
). - Commit your changes (
git commit -am 'Add new feature'
). - Push to your branch (
git push origin feature-branch
). - Create a new pull request.
- Firebase for user authentication
- Stripe for payment processing
- MongoDB for data storage
- Express.js for server-side logic
- React.js for frontend (integrated with this backend)