DotCart is a full-stack e-commerce web application featuring a dual-interface system for both regular customers and sellers. Customers can browse products, manage their carts, and place orders with secure Stripe integration. Sellers have access to a dedicated dashboard to add, list, and manage their products and view customer orders.
For Customers:
- Browse all products and filter by category.
- View detailed product information.
- Add products to cart and checkout.
- Add and manage shipping addresses.
- View order history.
For Sellers:
- Secure seller login.
- Seller dashboard layout.
- Add new products with image uploads (Cloudinary integration).
- View a list of all seller products.
- View and manage incoming orders.
Core Tech Features:
- Secure Authentication with JWT (JSON Web Tokens) and bcrypt.
- Payment processing via Stripe including webhook integration.
- Image storage and optimization using Cloudinary.
- Responsive modern UI built with Tailwind CSS.
- Framework: React 19 (built with Vite)
- Styling: Tailwind CSS (v4)
- Routing: React Router v7
- State Management: React Context API
- HTTP Client: Axios
- Notifications: React Hot Toast
- Runtime: Node.js
- Framework: Express.js
- Database: MongoDB with Mongoose
- Authentication: jsonwebtoken, bcryptjs
- File Uploads: multer, cloudinary
- Payment Gateway: Stripe
- Other utilities: cors, cookie-parser, dotenv
DotCart App/
βββ client/ # Frontend React Application
β βββ public/
β βββ src/
β β βββ components/ # Reusable UI components
β β βββ context/ # React Context providers (AppContext)
β β βββ pages/ # Application routes/pages (Home, Cart, Seller pages, etc.)
β β βββ App.jsx # Main Application component & Route definitions
β β βββ ...
β βββ package.json
β βββ vite.config.js
β βββ tailwind config...
β
βββ server/ # Backend Node.js/Express Application
βββ configs/ # Database and Cloudinary configuration
βββ controllers/ # Route logic and handlers
βββ middlewares/ # Custom middlewares (auth, etc.)
βββ models/ # Mongoose Database Models (User, Seller, Product, Order, Address)
βββ routes/ # Express Route definitions
βββ server.js # Main Express server entry point
βββ package.json
- Node.js (v18+ recommended)
- MongoDB account/local instance
- Cloudinary account
- Stripe account
You will need to create .env files in both the client and server directories based on the provided .env.example files.
Server .env:
PORT=4000
MONGODB_URI=your_mongodb_connection_string
JWT_SECRET=your_jwt_secret
CLOUDINARY_CLOUD_NAME=your_cloudinary_name
CLOUDINARY_API_KEY=your_cloudinary_api_key
CLOUDINARY_API_SECRET=your_cloudinary_api_secret
STRIPE_SECRET_KEY=your_stripe_secret_key
STRIPE_WEBHOOK_SECRET=your_stripe_webhook_secretClient .env:
VITE_API_URL=http://localhost:4000
# Add any other required client-side environment variables-
Clone the repository:
git clone https://github.com/mufeed-dev/DotCart-App.git cd "DotCart App"
-
Install Server Dependencies:
cd server npm install -
Install Client Dependencies:
cd ../client npm install
-
Start the Backend Server:
cd server npm run server # Runs with nodemon for development
The server will start on
http://localhost:4000(or your defined PORT). -
Start the Frontend Client:
cd client npm run devThe client will be accessible at
http://localhost:5173.