Skip to content

nagathan26/E-Commerce

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

E-Commerce

A full-stack e-commerce project with a customer storefront, an admin dashboard, and a Node.js/Express backend.

Project Structure

  • frontend/ - Customer-facing React app built with Vite
  • Admin/ - Admin dashboard for managing products and orders
  • backend/ - Express API, database connection, authentication, uploads, and payments

Tech Stack

  • Frontend: React, Vite, Tailwind CSS, Axios
  • Admin: React, Vite, Tailwind CSS, Axios
  • Backend: Node.js, Express, MongoDB, Mongoose, Cloudinary, Stripe, Razorpay

Setup

Install dependencies separately in each app folder:

cd frontend && npm install
cd ../Admin && npm install
cd ../backend && npm install

Environment Variables

Create a .env file in backend/ with the values used by the server:

PORT=5000
MONGODB_URI=
ACCESS_TOKEN_SECRET=
ACCESS_TOKEN_EXPIRY=15m
REFRESH_TOKEN_SECRET=
REFRESH_TOKEN_EXPIRY=7d
JWT_SECRET=
ADMIN_EMAIL=
ADMIN_PASSWORD=
CLOUDINARY_CLOUD_NAME=
CLOUDINARY_API_KEY=
CLOUDINARY_API_SECRET=
STRIPE_SECRET_KEY=

Set the frontend API URL in both Vite apps:

VITE_BACKEND_URL=

Running the Apps

Start each project from its own folder:

# Customer frontend
cd frontend
npm run dev

# Admin dashboard
cd ../Admin
npm run dev

# Backend API
cd ../backend
npm start

Scripts

Frontend and admin apps support:

  • npm run dev
  • npm run build
  • npm run lint
  • npm run preview

Backend supports:

  • npm start

Notes

  • The customer app and admin app both call the backend through VITE_BACKEND_URL.
  • The backend connects to MongoDB and uses authentication tokens for user and admin flows.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages