A modern full-stack e-commerce application built with React.js and Node.js, featuring a comprehensive shopping experience for customers, retailers, and administrators.
- π Browse and search products
- ποΈ Shopping cart management
- π³ Secure checkout process
- π¦ Order tracking
- β Product reviews and ratings
- π€ User profile management
- π Dashboard with sales analytics
- π¦ Product management (CRUD operations)
- π« Voucher/discount management
- π Order management
- π Sales reporting
- π₯ User management
- πͺ Retailer management
- π System analytics
- π οΈ Platform administration
- βοΈ React 18 - Modern React with hooks
- π¨ Tailwind CSS - Utility-first CSS framework
- π Material-UI - React component library
- π Ant Design - Enterprise UI components
- π Chart.js - Data visualization
- π¦ React Router - Client-side routing
- π‘ Axios - HTTP client
- β‘ Vite - Fast build tool
- π’ Node.js - JavaScript runtime
- π Express.js - Web framework
- π MongoDB - NoSQL database
- π¦ Mongoose - MongoDB object modeling
- π JWT - Authentication
- π bcrypt - Password hashing
- π CORS - Cross-origin resource sharing
Trendy-Shop/
βββ backend/ # Node.js Express API
β βββ config/ # Database configuration
β βββ controllers/ # Route controllers
β βββ models/ # Database models
β βββ routes/ # API routes
β βββ middleware.js # Custom middleware
β βββ server.js # Entry point
βββ frontend/ # React application
β βββ public/ # Static assets
β βββ src/
β β βββ auth/ # Authentication components
β β βββ components/ # Reusable components
β β βββ context/ # React context providers
β β βββ pages/ # Page components
β β βββ routes/ # Route configuration
β β βββ services/ # API service layer
β βββ package.json
βββ README.md
- Node.js (v16 or higher)
- MongoDB (local or cloud instance)
- npm or yarn package manager
-
Navigate to the backend directory:
cd backend -
Install dependencies:
npm install
-
Create a
.envfile in the backend directory:DB_URL=mongodb://localhost:27017/trendy-shop JWT_SECRET=your_jwt_secret_key PORT=5000
-
Start the backend server:
npm start
The backend will run on http://localhost:5000
-
Navigate to the frontend directory:
cd frontend -
Install dependencies:
npm install
-
Create a
.envfile in the frontend directory:VITE_API_URL=http://localhost:5000/api
-
Start the development server:
npm run dev
The frontend will run on http://localhost:5173
POST /api/auth/register- User registrationPOST /api/auth/login- User loginPOST /api/auth/logout- User logout
GET /api/products- Get all productsGET /api/products/:id- Get product by IDPOST /api/products- Create new product (Retailer)PUT /api/products/:id- Update product (Retailer)DELETE /api/products/:id- Delete product (Retailer)
GET /api/orders- Get user ordersPOST /api/orders- Create new orderPUT /api/orders/:id- Update order status
GET /api/categories- Get all categoriesPOST /api/categories- Create category (Admin)
GET /api/users/profile- Get user profilePUT /api/users/profile- Update user profile
- Browse products and categories
- Manage shopping cart
- Place and track orders
- Leave product reviews
- Manage product inventory
- View sales analytics
- Process orders
- Create discount vouchers
- Manage all users and retailers
- System-wide analytics
- Platform configuration
The application uses JWT (JSON Web Tokens) for authentication. Tokens are stored in localStorage and included in API requests via Authorization headers.
The application is fully responsive and works seamlessly across:
- π» Desktop computers
- π± Mobile devices
- π Tablets
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the ISC License.
NhanPhamThanh-IT
- React.js community for excellent documentation
- Tailwind CSS for the utility-first approach
- MongoDB for the flexible database solution
- All contributors and users of this project
β Star this repository if you find it helpful!