/audiophile-ecommerce-api

Audiophile E-commerce API serves as the backend for the Audiophile E-commerce app. It manages user authentication, product operations, cart functionality, and the checkout process, demonstrating full-stack development skills.

Primary LanguageJavaScriptMIT LicenseMIT

Audiophile E-commerce API

Project Overview

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.

Tech Stack

Frontend:

  • React
  • React Router
  • Context API
  • Fetch API
  • TailwindCSS
  • Vite

Backend:

  • Node.js
  • Express
  • MongoDB
  • Mongoose
  • JSON Web Tokens (JWT) for authentication

Features

  • 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

Getting Started

Prerequisites

  • Node.js
  • npm
  • Git

Installation

  1. Clone the repository
git clone git@github.com:karimAoulallay/audiophile-ecommerce-api.git
  1. Navigate to the cloned repository
cd audiophile-ecommerce-api
  1. Install dependencies
npm install
  1. 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>
  1. Run products seeder
node ./seeders/productsSeeder.js
  1. Start the server
npm run dev

License

This project is licensed under the MIT License - see the LICENSE file for details.