A E-commerce site to buy your favorite things.
- User Registration: Users can sign up for an account by providing basic information such as username, email, and password.
- User Login: Registered users can log in securely using their credentials.
- JWT Authentication: JSON Web Tokens (JWT) are used for secure authentication and authorization of users.
- Category: Category-based filter for a better user experience has been implemented.
- Price: Price-based filter for a better user experience has been implemented.
- Direct Search: Users can directly search for products using the search box.
- Items per Page: Users can select the number of items displayed per page to customize their viewing experience. They can load more product if they require.
- Create Product: Authenticated Admins can create new products by providing a title, price, and other relevant information.
- Update Product: Admins can edit and update their products to keep them current and accurate.
- Delete Product: Admins have the ability to delete their products if needed.
- Password Hashing: User passwords are securely hashed before storing them in the database to ensure confidentiality.
- HTTPS: Communication between the client and server is encrypted using HTTPS to prevent eavesdropping and man-in-the-middle attacks.
- CORS Configuration: Cross-Origin Resource Sharing (CORS) is properly configured to allow restricted resources on a web page to be requested from another domain outside the domain from which the resource originated.
- Braintree Integration: Braintree is used to handle the payment system.
- Payment Options: Paypal and different card payment options are available during checkout and order processing.
- Add to Cart: Users can add products to their cart for future purchase.
- View Cart: Users can view the contents of their cart at any time.
- Update Cart: Users can update the quantity of items in their cart or remove items if needed.
- Save for Later: Users can save items for later purchase.
- Node.js
- Express.js
- Mongo DB
This project follows Conventional Commits message and Model–view–controller design pattern
Contributions are welcome! If you'd like to contribute to this project, please fork the repository and submit a pull request with your changes.
-
Clone the repository.
-
Install dependencies for both api and client:
npm install
//frontend VITE_API=http://localhost:8080/ //backend PORT=8080 DB_URI="your mongo database string" DEV_DB=mongodb://127.0.0.1:27017/e-commerce ACCESS_TOKEN="Your secret token " BRAINTREE_MERCHANT_ID = "Brain tree merchant id" BRAINTREE_PUBLIC_KEY = "Brain tree public key" BRAINTREE_PRIVATE_KEY = "Brain tree private key"
-
Set up environment variables such as database connection string, JWT secret key, etc.
-
Start the server:
npm start
-
Start the frontend development server:
npm start