ShopSphere is a full-stack e-commerce web application built with a Node.js and Express backend, MongoDB database, and a React + TypeScript frontend styled with Tailwind CSS. It provides user authentication, product management, and a responsive shopping interface.
- Backend: Node.js, Express, MongoDB, Mongoose, Nodemailer
- Frontend: React, TypeScript, Vite, Tailwind CSS, React Router, Framer Motion
- Other: dotenv for environment variables, body-parser, cors
- Node.js and npm installed
- MongoDB database (local or cloud like MongoDB Atlas)
- Create a
.envfile in theBackenddirectory with the following variable:MONGODB_URI=your_mongodb_connection_string
- Navigate to the
Backenddirectory:cd Backend - Install dependencies:
npm install
Start the backend server with Nodemon:
npm startThe server will run at http://localhost:5000
- Node.js and npm installed
- Navigate to the
clientdirectory:cd client - Install dependencies:
npm install
Start the development server:
npm run devThe frontend will be accessible at http://localhost:5173 (or the port Vite assigns)
GET /api/products- Get all productsGET /api/products/:id- Get product by IDPOST /api/products- Create a new productPUT /api/products/:id- Update a product by IDDELETE /api/products/:id- Delete a product by ID
POST /api/login- User login with email and password
GET /api/users- Get all users (for testing purposes)
POST /api/contact- Send a contact message (currently a stub)
The frontend is built with React and TypeScript, using Tailwind CSS for styling and Vite as the build tool. Key components/pages include:
Shop.tsx- Main shopping page displaying productsLogin.tsx- User login pageSignup.tsx- User registration pageAdminDashboard.tsx- Admin control panelCategories.tsx- Product categories listingAbout.tsx- About us pageContact.tsx- Contact form pageDeals.tsx- Deals and promotions pageShopFooter.tsx- Footer component
Contributions are welcome! Feel free to fork the repository and create pull requests.
This project is licensed under the ISC License.
For any questions or support, please contact the project maintainer.