Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

CodeAlpha_EcommerceStore

Simple full-stack e-commerce store built for the CodeAlpha Full Stack Development internship (Task 1). MERN stack: React (Vite) frontend, Express.js + MongoDB (Mongoose) backend.

Features

  • User registration/login with JWT auth
  • Product listing with search
  • Product detail page
  • Shopping cart (add/update/remove items)
  • Checkout with shipping address → order creation
  • Order history and order detail page
  • Admin-only product management endpoints (create/update/delete)

Stack

  • Frontend: React 19, Vite, React Router, Axios
  • Backend: Node.js, Express 5, Mongoose, JWT, bcryptjs
  • Database: MongoDB (Atlas or local)

Project structure

CodeAlpha_EcommerceStore/
├── client/   React frontend
└── server/   Express API

Local setup

1. Backend

cd server
npm install
cp .env.example .env   # fill in MONGODB_URI and JWT_SECRET
npm run seed            # optional: seeds sample products + an admin user
npm run dev

Server runs on http://localhost:5000.

2. Frontend

cd client
npm install
cp .env.example .env    # points to the local API by default
npm run dev

Client runs on http://localhost:5173.

Seeded admin account (after npm run seed)

  • Email: admin@codealpha.dev
  • Password: admin123

API overview

Method Route Description Auth
POST /api/auth/register Create an account -
POST /api/auth/login Log in -
GET /api/auth/me Current user User
GET /api/products List/search products -
GET /api/products/:id Product detail -
POST /api/products Create product Admin
PUT /api/products/:id Update product Admin
DELETE /api/products/:id Delete product Admin
GET /api/cart Get current user's cart User
POST /api/cart Add item to cart User
PUT /api/cart/:productId Update item quantity User
DELETE /api/cart/:productId Remove item from cart User
POST /api/orders Place order from cart User
GET /api/orders List my orders User
GET /api/orders/:id Order detail User/Admin
PUT /api/orders/:id/status Update order status Admin

Deployment

  • Frontend → Vercel
  • Backend → Render
  • Database → MongoDB Atlas

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages