A small full-stack e-commerce demo: browse a product catalog and create an account. The frontend is a React + TypeScript single-page app built with Vite; the backend is an Express + TypeScript JSON API with an in-memory data store.
| Layer | Stack |
|---|---|
| Frontend | React 19, TypeScript, Vite, React Router 7, CSS Modules |
| Backend | Node.js, Express 5, TypeScript, CORS |
| Tooling | ESLint, ts-node-dev |
my-shop-project/
├── my-shop-frontend/ # React SPA (Vite)
│ └── src/
│ ├── components/Navbar/
│ ├── pages/ # Home, Products, Signup
│ ├── types.ts # Shared TS interfaces
│ └── App.tsx # Routes
└── my-shop-backend/ # Express API
└── src/index.ts # Routes + in-memory database
- Node.js 18+ and npm
cd my-shop-backend
npm install
npm run devThe API runs at http://localhost:3001.
In a second terminal:
cd my-shop-frontend
npm install
npm run devThe app runs at http://localhost:5173. Vite proxies any /api request to
the backend, so both servers need to be running.
Base URL: http://localhost:3001
| Method | Endpoint | Description |
|---|---|---|
GET |
/api/products |
List all products |
GET |
/api/products/:id |
Get a single product by id |
POST |
/api/signup |
Create a user account |
Request body:
{
"name": "Jane Smith",
"email": "jane@example.com",
"password": "secret123"
}Validation rules: all fields are required, the email must be well-formed, and
the password must be at least 6 characters. Returns 201 on success, or 400 /
409 on validation or duplicate-email errors.
| Script | Description |
|---|---|
npm run dev |
Start the Vite dev server with HMR |
npm run build |
Type-check and build for production |
npm run preview |
Preview the production build |
npm run lint |
Run ESLint |
| Script | Description |
|---|---|
npm run dev |
Start the API with live reload |
npm run build |
Compile TypeScript to dist/ |
npm run start |
Run the compiled server |
- Data is stored in memory on the backend — products are seeded on startup and registered users are lost whenever the server restarts.
- Passwords are validated but not persisted or hashed; this project is a demo and is not production-ready.