This is the backend for a React-based food ordering app. It is built with Node.js and Express, serving as the API that handles meal data and order processing. The backend integrates with Stripe for secure payment processing and uses file-based storage for managing meals and orders.
link to the frontend repository --> FoodOrderApp-Frontend Repository
- Meal Management: Provides a GET endpoint to fetch available meals from a JSON file..
- Order Creation: Allows users to place orders via a POST endpoint, validating order data and storing it in a JSON file.
- Payment Integration: Supports payment processing using Stripe, creating payment intents for seamless transactions.
- Order Retrieval: Offers a GET endpoint to fetch all orders placed by users.
- CORS Support: Configured to allow cross-origin requests, enabling the frontend to communicate with the backend.
- Error Handling: Includes robust error handling for API calls, ensuring user-friendly feedback for issues.
- Node.js and npm install.
- Familiarity with Express, Stripe, and JSON file handling in Node.js.
-
Clone the repository:
git clone https://github.com/MichaelDAbadJr/FoodOrderApp-Backend
-
Navigate to the project directory:
cd FoodOrderApp-Backend
-
Install the dependencies:
npm install
or
yarn install
-
To start the development server, use:
npm start
or
yarn start
-
Usage: Once the development server is running, open your browser and navigate to http://localhost:5173 or the appropriate localhost on your machine to demo the app. You will need your own STRIPE_SECRET_KEY set up in the environment variables in the .env file.
-
License: This project is licensed under the MIT License. See the LICENSE file for details.