This repository contains the backend code for a Node.js Express API. It provides various routes and functionality for authentication, user management, product management, cart management, order management, and Stripe integration for checkout.
To get started with this project, follow the instructions below.
- Node.js
- MongoDB
-
Clone the repository:
https://github.com/Nomekuma/Backend.git
-
Install the dependencies:
cd Backend npm install
-
Set up the environment variables:
Create a
.env
file in the root directory and provide the following environment variables:JWT_SEC=<your_JWT_secret_key> PASS_SEC=<your_CryptoJS_password> STRIPE_KEY=<your_Stripe_API_key> PORT=<server_port> MONGO_URL=<your_MongoDB_connection_URL>
Make sure to replace
<your_JWT_secret_key>
,<your_CryptoJS_password>
,<your_Stripe_API_key>
,<server_port>
, and<your_MongoDB_connection_URL>
with your actual values.
-
Start the server:
npm start npm start dev to run with nodemon
The server will start running on the specified port (
PORT
) or at default 5000. -
Access the API routes:
- Authentication:
/api/auth
- User management:
/api/users
- Product management:
/api/products
- Cart management:
/api/carts
- Order management:
/api/orders
- Checkout with Stripe:
/api/checkout
Use an API testing tool like Postman to interact with the API endpoints.
- Authentication:
Contributions are welcome! If you find any issues or want to add new features, please open an issue or submit a pull request.
This project is licensed under the MIT License.
If you have any questions or need further assistance, feel free to contact me at [email protected].