Skip to content

Ripper-No-Chart/centrix-case-study

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Centrix — Multi-tenant Business Management Platform

Case Study TypeScript Angular Node.js Fastify MongoDB JWT

Centrix is a commerce management system designed to help small businesses organize sales, stock, products, services, users and operational metrics from a single platform.

This repository documents the product vision, functional scope, architecture decisions and implementation approach of Centrix as a public case study for portfolio purposes.

Source code is private because Centrix is a real product. This public repository focuses on architecture, product scope, engineering decisions and technical communication.


Why this project matters

Many small businesses still manage sales, stock and daily operations through notebooks, spreadsheets, memory or scattered WhatsApp messages. That creates operational friction: missing stock visibility, manual errors, slow sales registration and unclear business metrics.

Centrix addresses that problem with a focused SaaS platform that centralizes core commerce operations without adding unnecessary complexity.

Main goal: more order, more control and fewer manual errors for small businesses.


My role

I worked across product definition, backend architecture, frontend implementation, API integration and deployment workflow.

Main responsibilities included:

  • Designing and implementing a modular REST API.
  • Building a multi-tenant Angular frontend.
  • Defining typed contracts between frontend and backend.
  • Implementing authentication and protected routes.
  • Modeling stock, products, services, categories, users and billing workflows.
  • Applying validation, error handling and secure configuration practices.
  • Preparing the application for cloud deployment using separate frontend/backend services.

Tech stack

Area Technologies
Frontend Angular 20, TypeScript strict mode, Angular Material/CDK, RxJS, Signals, SCSS
Backend Node.js, TypeScript strict mode, Fastify, Zod, JWT
Database MongoDB, MongoDB Atlas
Architecture REST API, layered modules, tenant-aware routing, tenant-aware backend context
Deployment Cloudflare Pages, Railway, environment-based configuration
Tooling Git, GitHub, Linux, Postman, VS Code

Functional scope

Centrix focuses on the operational core of a small business.

Confirmed functional areas:

  • Multi-tenant login.
  • Dashboard with operational metrics.
  • User and role management.
  • Categories and subcategories.
  • Stock management.
  • Product and service management.
  • Billing / sales registration.
  • Sale detail and PDF export.
  • Business profile area.

User roles:

Role Scope
Administrator Full access to the system.
Seller Limited access focused on creating sales.

Product model:

Item type Stock behavior Billing behavior
Product Uses real stock, validates availability and supports stock adjustment. Can be sold and decreases stock.
Service Stock is normalized to zero and does not require stock validation. Can be sold without decreasing stock.

Architecture overview

Centrix is built as a separated frontend/backend application with tenant-aware flows.

flowchart LR
    User[User] --> Frontend[Angular SPA]
    Frontend -->|REST API + JWT + tenant context| Backend[Fastify API]
    Backend --> CoreDB[(Core DB / Tenants)]
    Backend --> TenantDB[(Tenant DB / Business Data)]
Loading

High-level request flow:

sequenceDiagram
    participant U as User
    participant F as Angular Frontend
    participant A as REST API
    participant C as Core Tenant DB
    participant T as Tenant Database

    U->>F: Access /t/:tenantSlug/...
    F->>A: Request with JWT and tenant context
    A->>C: Resolve and validate tenant
    A->>A: Validate authentication and role
    A->>T: Execute business operation
    T-->>A: Return tenant-scoped data
    A-->>F: JSON response
    F-->>U: Render updated UI
Loading

Technical highlights

Backend

  • REST API built with Node.js, Fastify and TypeScript strict mode.
  • Modular domain structure for auth, tenants, users, categories, stock, billing and business profile.
  • Zod schemas for request validation.
  • JWT-based authentication.
  • Tenant context validation across request headers, internal context and authenticated session.
  • Stable JSON contracts designed to avoid frontend/backend drift.
  • Product/service stock rules handled at business-logic level.

Frontend

  • Angular 20 SPA using standalone components and strict TypeScript.
  • Layered structure based on core, shared, layout and features.
  • Tenant-aware routing with /t/:tenantSlug/... pattern.
  • Protected private layout for authenticated sections.
  • Domain-based services for API integration.
  • Controlled loading, error and success states with Signals and RxJS.
  • Responsive UI built with Angular Material/CDK and modular SCSS.

Deployment

  • Frontend deployed as a static Angular production build.
  • Backend deployed as an independent Node.js service.
  • MongoDB hosted externally.
  • Sensitive configuration managed through environment variables.
  • Frontend, backend and database responsibilities separated by design.

Documentation

Document Description
Product Overview Product problem, users, functional scope and boundaries.
Architecture System design, request flow and module responsibilities.
Frontend Angular architecture, routing, UI structure and API integration.
Backend API architecture, modules, validation, auth and business rules.
Multi-tenant Model Tenant-aware routing, backend resolution and isolation strategy.
Security Authentication, validation, tenant safety and disclosure boundaries.
Deployment Production deployment approach and environment separation.
Interview Talking Points Concise explanation for technical interviews.

Screenshots

Screenshots should be added to assets/screenshots/ using sanitized data only.

Recommended screenshots:

  • dashboard.png
  • stock-list.png
  • stock-detail.png
  • billing-new-sale.png
  • sale-detail.png
  • categories.png
  • users.png

See screenshots guide before adding images.


Public disclosure boundaries

This case study does not include:

  • Private source code.
  • Environment variables.
  • Tokens, secrets or connection strings.
  • Real tenants, users or customer data.
  • Production database exports.
  • Internal infrastructure details that could expose the system.
  • Future features presented as current functionality.

About the author

Andrés Ezequiel Herrera
Software Engineer | Full Stack Developer | Backend Developer

Focused on TypeScript, Node.js, NestJS, Angular, REST APIs, MongoDB, SQL and production-oriented full stack systems.

LinkedIn

centrix-case-study

Releases

No releases published

Packages

 
 
 

Contributors