Skip to content

Architecture

hafizsheetab edited this page May 12, 2025 · 5 revisions

1. Overview

A single Express/Node.js service exposing grouped routes for three modules—Authentication, Offer, and User—backed by Redis, and S3 (via LocalStack).

2. Modules & Routing

  • /api/authentication → User login, registration, resetPassward
  • /api/offer → Create, list, update, delete offers ; add, accept, reject, complete, review requests
  • /api/user → User profile retrieval & management

Each module is organized under api/, controllers/, swagger/, validation/, and uses shared middlewares/ for logging, error handling, and auth checks.

Backend Architecture

  • Request enters the system.
  • Middleware authenticates the request and attaches the user ID (req.userId).
  • Route identifies the appropriate controller based on the request.
  • Controller processes the logic, making calls to:
  • Redis for caching,
  • DynamoDB for persistent data storage,
  • S3 for object/file storage.
  • The controller sends the data back through the Route.
  • Format Response structures the output.
  • Response is returned to the client.

This architecture leverages caching (Redis), NoSQL data storage (DynamoDB), and object storage (S3) for efficient request handling.

Frontend Architecture

  • Entrypoint initializes the application.
  • Route Declarations define the navigation structure.
  • Pages map to specific routes and serve as containers for content.
  • Components are reusable UI building blocks used within Pages.
  • Services handle logic such as data fetching and communication with the Backend.
  • Components may also interact directly with Services for dynamic behavior.

This structure promotes a clear separation of concerns and modularity in frontend development.

Clone this wiki locally