A small e-commerce web application. Browse products, manage a cart, and place orders.
| Layer | Technology |
|---|---|
| Frontend | React 18, TypeScript, Vite, React Router |
| Backend | ASP.NET Core 8 Web API, Entity Framework Core, JWT Auth |
| Database | PostgreSQL 15 |
| URL | |
|---|---|
| Frontend | http://localhost:3000 |
| API | http://localhost:5100 |
| Swagger | http://localhost:5100/swagger |
The default docker-compose.yml runs the API with dotnet watch and the
frontend with the Vite dev server. Source is bind-mounted, so edits on the
host reload inside the containers.
docker compose up --builddocker-compose.prod.yml builds release artefacts: the API runs from a
published Release build and the frontend is served as a static bundle from
nginx. No source mounts, no watchers.
docker compose -f docker-compose.prod.yml up --buildStart the database:
docker compose up db -dRun the API:
cd backend/ShopWise.Api
dotnet runRun the frontend:
cd frontend/shopwise-ui
npm install
npm run dev # proxies /api → http://localhost:5100Schema and seed data live in db/init.sql. Postgres only runs that file
the first time the data volume is created, so to apply changes you either
edit the file and reset the volume, or apply the delta manually.
Reset (drops all data, re-runs init.sql):
docker compose down -v
docker compose up -dApply an incremental change without wiping data:
docker compose exec -T db psql -U shopwise -d shopwise < change.sqlAlso update init.sql so a fresh boot reflects the same schema.
| Password | Role | |
|---|---|---|
| admin@shopwise.com | Admin123! | admin |
| jane@example.com | Jane456! | customer |
| john@example.com | John789! | customer |
- Product catalogue with category and search
- Shopping cart (add, remove, clear)
- Checkout and order placement
- Order history
- JWT-based authentication (register / login)
- Admin: create and delete products
shopwise/
├── backend/ShopWise.Api/
│ ├── Controllers/ # AuthController, ProductsController, CartController, OrdersController
│ ├── Services/ # Business logic
│ ├── Models/ # EF Core entities
│ ├── DTOs/ # Request / response types
│ └── Data/ # AppDbContext
├── frontend/shopwise-ui/
│ ├── src/pages/ # Home, ProductDetail, Cart, Checkout, Orders, Login, Register
│ ├── src/components/ # ProductCard, ProductList, Navbar
│ ├── src/hooks/ # useCart
│ └── src/store/ # AuthContext
└── db/
└── init.sql # Schema and seed data