Public menu, categories, shopping cart and customer order history
Public menu, categories, shopping cart and customer order history.
A full-stack restaurant web application built with React, Express and PostgreSQL. Customers browse products, build carts and place orders; employees manage products and progress orders through their lifecycle. Server-side validation, persistent sessions and layered services separate business rules from controllers and database access.
*Verified tracked source and project files (build directories excluded)
Capabilities documented in the repository; the supporting sources and project configuration determine how they run.
Public menu, categories, shopping cart and customer order history.
Employee area for products, images and order status management.
Registration, login, logout and role-scoped access.
Server-side sessions persisted in PostgreSQL.
CSRF protection, request validation, sanitisation and rate limiting.
Jest tests for business services and shared error handling.
React/Vite client uses an API module to communicate with the Express backend.
Backend follows Route → Controller → Service → Repository → PostgreSQL.
Express-session and connect-pg-simple support session persistence; security middleware applies CSRF, Helmet and rate limiting.
The README describes a complete React/Express/PostgreSQL restaurant application with a layered API, server sessions and a controlled order workflow.
Customer-facing catalogue, cart and orders are distinct from employee product management and status changes (new, preparing, ready, delivered, canceled).
Routes dispatch to controllers, services enforce domain rules, repositories isolate database queries, and PostgreSQL stores users, products, categories and orders.
The documented stack includes PostgreSQL-backed sessions, CSRF, Helmet, rate limiting, Zod validation, sanitization and Jest service tests.
Documentation: GitHub repository / project specification. The content describes documented behaviour or plans; deployment readiness is not inferred.
Selected fragments from project source files with an explanation of the responsibility they implement.
The service enforces business validations before handing persistence to its repository.
async create(dto) {
if (!dto || !dto.name || dto.price == null) {
throw new ValidationError('Nume și preț sunt obligatorii');
}
const payload = {
name: String(dto.name).trim(),
price: Number(dto.price) || 0,
category_id: dto.category_id ? Number(dto.category_id) : null,
};
if (payload.price < 0) throw new ValidationError('Preț invalid');
return this.productRepo.create(payload);
}
The restaurant backend separates service operations from SQL queries implemented in repositories, making service contracts easier to unit-test.
class CategoryService {
constructor(categoryRepo) {
this.categoryRepo = categoryRepo;
}
async list() {
return this.categoryRepo.findAll();
}
}
README.md (architecture description) · Architectural pseudocode based on README
// Documented server design
// HTTP route → controller → service → repository → PostgreSQL
// Services apply rules; repositories execute SQL.
// Session and CSRF checks protect mutations.
Place approved visuals in
assets/img/projects/daw-project/screenshot-01.webp.
Current README and source files were checked; runtime operation was not independently tested.
Descriptions and examples are based on the repository documentation and selected source files. Build settings, external services, assets and project-specific configuration may be required to run the application.