Audiophile E-commerce API is the backend part of the Audiophile E-commerce application. This API handles user authentication, user authorization and cart management. This repository contains the server-side (backend) part of the application, built with Node.js and Express, interacting with a MongoDB database. The project aims to simulate a real-world e-commerce application, demonstrating full-stack development skills to potential recruiters.
You can find the client-side (frontend) repository here.
Frontend:
- React
- React Router
- Context API
- Fetch API
- TailwindCSS
- Vite
Backend:
- Node.js
- Express
- MongoDB
- Mongoose
- JSON Web Tokens (JWT) for authentication
- User authentication (registration, login, auto-login using refresh tokens)
- Product management (create, read, update, delete products)
- Cart management
- Using HTTP-only cookies for authentication to protect against CSRF attacks
- Node.js
- npm
- Git
- Clone the repository
git clone git@github.com:karimAoulallay/audiophile-ecommerce-api.git
- Navigate to the cloned repository
cd audiophile-ecommerce-api
- Install dependencies
npm install
- Create a .env file in the root directory and add the following environment variables:
MONGO_URI=<your_mongo_db_connection_string>
JWT_REFRESH_SECRET=<your_jwt_refresh_secret>
JWT_ACCESS_SECRET=<your_jwt_access_secret>
CLIENT_ORIGIN=<your_client_server_url>
- Run products seeder
node ./seeders/productsSeeder.js
- Start the server
npm run dev
This project is licensed under the MIT License - see the LICENSE file for details.