Welcome to the my E-commerce API, a complete backend service for an e-commerce system. This API provides a robust platform for handling users, products, categories, orders, tokens and payment. Whether you're a restaurant owner or a developer looking to integrate food delivery functionality into your application, this API is a great starting point.
- User Authentication: Secure user registration and login with JWT (JSON Web Tokens) for authentication.
- Email Verification: Verify user email with nodemailer and mailtrap.
- Category Management: Add, update, fetch and delete category information.
- Product Management: Add, update, fetch and delete product information.
- Order Management: Add, update, fetch and delete order information.
- Payment Integration: Make payments via using the stripe API.
Follow these steps to set up the Food Delivery API on your local development environment:
-
Clone the repository:
git clone https://github.com/Aaryash-Shakya/ecommerce-api.git cd ecommerce-api
-
Install dependencies:
npm install
-
Set up environment variables:
Create .env folder with following data
PORT = "localhost port for api" FRONTEND_URL = "localhost port for frontend" SMTP_HOST = "your mailtrap SMTP server host" SMTP_PORT = "your mailtrap SMTP server port" SMTP_USER = "your mailtrap SMTP server username" SMTP_PASS = "your mailtrap SMTP server password" JWT_SECRET = "any secret string to encode with JWT" STRIPE_API_KEY = "your stripe account api key" STRIPE_SECRET_KEY = "your stripe account secret key"
-
Start the API server:
npm start
The API should now be running locally on http://localhost:(your PORT).
We welcome contributions from the open-source community to enhance my api's features, functionality, and documentation. Feel free to fork this repository, create your own branch, and submit pull requests.
-
Fork this repository.
Click on the fork button on the repository
-
Clone the repository:
Go to your forked repository, Click on the code button and copy your repository's
(.git)
link.Then, clone the repository in ur machine using the command below
git clone https://github.com/<your-username>/ecommerce-api.git cd ecommerce-api
-
Make a branch and add your changes:
In your local machine create a new branch
git checkout -b <branch_name>
Add your changes to the branch
-
Check the changed files
git status
-
If everything's good, then Commit Your Changes
git add . git commit -m "<EXPLAIN-YOUR_CHANGES>"
-
Push to Your Forked Repository
git push -u origin <branch_name>
-
Create a Pull Request
Go to your forked repository on GitHub, and you should see a "Compare & pull request" button. Click on it to create a pull request (PR).
Create a pull request with a clear description of your changes.
Your contribution will be reviewed, and upon approval, it will be merged into the main repository.