A full-stack eCommerce platform demonstrating secure authentication, role-based authorization, scalable state management, and clean REST API architecture.
Example endpoints:
- GET /api/products
- POST /api/auth/login
- POST /api/products (Admin only)
- GET /api/orders (Protected)
- 🔐 JWT Authentication (Login / Register)
- 👥 Role-based authorization (Admin / User)
- 🛍 Product CRUD (Admin only)
- 🛒 Shopping cart system
- 📦 Order management
- 🧠 Global state management using Redux Toolkit
- 🌐 RESTful API
- 🔒 Protected routes (Frontend & Backend)
- 🗄 MongoDB database integration
Client → React SPA
Server → REST API (Express)
Database → MongoDB
Authentication → JWT
State Management → Redux Toolkit + RTK Query
- React
- Redux Toolkit
- RTK Query
- React Router
- Node.js
- Express
- MongoDB
- Mongoose
- JWT
- bcrypt
- dotenv
git clone https://github.com/yt314/git-node-react.git
cd git-node-reactcd server
npm installCreate .env:
MONGO_URI=
JWT_SECRET=
PORT=5000
Run:
npm run devcd ../client
npm install
npm startFrontend: http://localhost:3000\ Backend: http://localhost:5000
- User registers / logs in\
- Server returns JWT\
- Token stored client-side\
- Protected routes verified using middleware\
- Admin routes restricted by role
git-node-react/
│
├── client/
│ ├── src/
│ │ ├── app/
│ │ ├── features/
│ │ ├── components/
│ │ └── pages/
│
├── server/
│ ├── controllers/
│ ├── models/
│ ├── routes/
│ ├── middleware/
│ ├── config/
│ └── public/
│
└── README.md
- JWT-based authentication with role-based access control
- Clean separation of concerns (controllers, routes, middleware)
- Centralized API state management using RTK Query
- Secure password hashing with bcrypt
- Scalable project structure for full-stack applications



