JavaScript / Full StackCompleted

DAW Project

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.

JavaScriptReact 19ViteNode.jsExpress 5PostgreSQLREST APISessionsCSRFZodJest
DADAW Project
JavaScriptMain technology
93Tracked files*
11Stack items
—Additional metric

*Verified tracked source and project files (build directories excluded)

01 · What it does

What the application does

Capabilities documented in the repository; the supporting sources and project configuration determine how they run.

01

Public menu, categories, shopping cart and customer order history

Public menu, categories, shopping cart and customer order history.

02

Employee area for products, images and order status management

Employee area for products, images and order status management.

03

Registration, login, logout and role-scoped access

Registration, login, logout and role-scoped access.

04

Server-side sessions persisted in PostgreSQL

Server-side sessions persisted in PostgreSQL.

05

CSRF protection, request validation, sanitisation and rate limiting

CSRF protection, request validation, sanitisation and rate limiting.

06

Jest tests for business services and shared error handling

Jest tests for business services and shared error handling.

02 · Technical structure

How the system works

01

React/Vite client uses an API module to communicate with the Express backend.

02

Backend follows Route → Controller → Service → Repository → PostgreSQL.

03

Express-session and connect-pg-simple support session persistence; security middleware applies CSRF, Helmet and rate limiting.

Restaurant ordering and backend protection

The README describes a complete React/Express/PostgreSQL restaurant application with a layered API, server sessions and a controlled order workflow.

01

Order lifecycle

Customer-facing catalogue, cart and orders are distinct from employee product management and status changes (new, preparing, ready, delivered, canceled).

02

Layered API architecture

Routes dispatch to controllers, services enforce domain rules, repositories isolate database queries, and PostgreSQL stores users, products, categories and orders.

03

Security and tests

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.

04 · Source and design

Implementation examples and code walkthrough

Selected fragments from project source files with an explanation of the responsibility they implement.

Product validation in the service layer

JavaScript

The service enforces business validations before handing persistence to its repository.

DAW-PROIECT/restaurant-server/server/services/product.service.jsSelected source excerpt
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);
}

Category service uses repository abstraction

JavaScript

The restaurant backend separates service operations from SQL queries implemented in repositories, making service contracts easier to unit-test.

DAW-PROIECT/restaurant-server/server/services/category.service.jsSelected source excerpt
class CategoryService {
    constructor(categoryRepo) {
        this.categoryRepo = categoryRepo;
    }
    async list() {
        return this.categoryRepo.findAll();
    }
}
TECHNICAL EVIDENCE

Source and implementation

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.
STATUS & SOURCE NOTES

Status & source limitations

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.