eshopappltd is a modern ecommerce platform built with a clean separation between frontend and backend.
- Frontend: React with Material UI, Redux Toolkit, Formik/Yup validation, and MUI DataGrid.
- Backend: Node.js with TypeScript, Express, MongoDB, following repository/controller design patterns, cookie-based authentication, and Stripe integration.
- Material UI component library and responsive design
- Redux Toolkit for global state management
- Formik + Yup for robust form handling and validation
- MUI DataGrid for admin tables and lists
- User dashboard and admin dashboard
- Product browsing, search, cart, checkout flow
- Login/Register and protected routes for users and admins
- Notifications with toast messages
- Node.js + TypeScript API server
- Express framework with middleware-based architecture
- MongoDB as the database
- Authentication with JWT and cookies
- Role-based access control for admin and user routes
- Error handling middleware and validation middleware
- Stripe payment integration for checkout
- Cloudinary support for image handling
- Organized controllers, repositories, models, routes, and utilities
/README.md
/backend
/src
/controllers
/erros
/middleware
/models
/repo
/baseRepository
/routes
/types
/utils
/frontend
/public
/src
/admin
/components
/front
/hooks
/redux
/constants
/slices
/user
/utils
- Node.js 22.x
- MongoDB
- Open a terminal in the project root.
- Install root dependencies for backend tooling and TypeScript:
npm install- Install frontend dependencies separately:
cd frontend
npm installCreate a .env file in the root or backend/ folder with values similar to:
PORT=8000
MONGO_URI=<your-mongodb-connection-string>
JWT_SECRET=<your-jwt-secret>
COOKIE_NAME=<cookie-name>
CLOUDINARY_CLOUD_NAME=<cloud-name>
CLOUDINARY_API_KEY=<cloudinary-api-key>
CLOUDINARY_API_SECRET=<cloudinary-api-secret>
STRIPE_SECRET_KEY=<stripe-secret-key>From the project root:
npm run startThis launches the backend with ts-node-dev and watches TypeScript changes.
npm run build
npm run deploy- Node.js 22.x
From the root:
cd frontend
npm installFrom frontend/:
npm startThe frontend proxies API requests to http://localhost:8000 by default.
npm run build- The frontend uses
axiosto call backend APIs. - Protected routes rely on cookies and JWT tokens stored by the backend.
- Checkout uses Stripe via the backend Stripe controller.
- Admin features are gated by user role checks on both client and server.
productController.tscategoryController.tsorderController.tsstripeController.tsuserController.ts
Controllers handle request logic and delegate database operations to repositories.
productRepo.tscategoryRepo.tsorderRepo.tsuserRepo.ts
Repositories encapsulate MongoDB model operations and centralize data access.
auth.ts— protects routes and checks user roleserrorHandler.ts— central error handling middlewarevalidateRequest.ts— request validation and schema enforcement
- Product, Category, Order, User
- Built with Mongoose and TypeScript interfaces for strong typing
Home.js— product listing and search experienceViewProduct.js— product detail viewCheckout.js— payment and order confirmation flowLogin.js/Register.js— auth forms- Admin pages for product, category, and order management
- User dashboard pages for purchase history and profile
redux/store.jsconfigures the Redux storeredux/slices/contains feature slices controlling app state- Frontend uses
react-reduxhooks to connect UI with state
Formikhandles form state and submissionYupdefines validation schemas for login, registration, product management, and checkout forms
- Material UI components for app layout, navigation, buttons, forms, and cards
@mui/x-data-gridfor admin tables and product/order listings- Custom reusable components like
Header,Footer,Loader, andModal
- Build the frontend with
npm run buildinsidefrontend/. - Build backend TypeScript and deploy
backend/dist. - Ensure environment variables are configured in production.
- If hosting with a single deployment, serve the built frontend from a static host and connect it to the backend API.
- The
old/folder contains legacy code and is not part of the current active application. - Use the current
backend/andfrontend/directories for development and deployment.
Author: Emmanuel F.
This documentation reflects the current app setup and technology stack for eshopappltd new version.