# TrendyPlaza: Physical course packs and a digital LMS in one store, built for architecture students across Algeria

> Production-grade hybrid e-commerce and digital Learning Management System (LMS) for architecture students in Algeria. Features physical pack fulfillment, access code redemption, PostgreSQL data integrity with advisory locks, trilingual RTL support, and self-hosted Docker/Coolify infrastructure.

Canonical: https://salaheddinemedkour.me/projects/trendyplaza-lms/
Language: en
Last updated: 2026-11-14
Author: Salah Eddine Medkour

Built by Salah Eddine Medkour. Role: Full stack, database, infrastructure. Year: 2026.

Live site: https://trendyplaza.tech/en

## Overview

TrendyPlaza is a production-grade web application built to serve architecture students across Algeria. The platform seamlessly merges a physical e-commerce storefront with a digital Learning Management System (LMS). Students purchase physical course packs shipped nationwide; these packs include secure access codes that students redeem online to unlock specific digital academic modules.

## In numbers

- 37: relational tables
- 42: restrict constraints against cascading deletes
- 148: automated tests in CI
- 7: quality gates before every deploy

## What it does

- Hybrid Physical-to-Digital Entitlement: Seamlessly bridges nationwide physical pack shipping with instant digital module access via secure access code redemption across university, academic year, semester, and module levels.
- Bespoke Administrative Dashboard: Comprehensive staff portal to manage physical inventory, review payment receipt uploads, build complex academic curriculum trees, configure granular team permissions, and monitor student progress.
- Trilingual Localization & RTL Enforcement: Native support for English, French, and Arabic with strict logical CSS properties, custom language fallback chains, and [dir="rtl"] keyframe animations to guarantee layout parity.
- Relational Data Integrity: Built on 37 relational tables with 42 restrict constraints to eliminate cascading deletes, paired with soft deletes for audit trails and integer centimes (DZD) for financial calculations.
- Concurrency-Guarded Checkout: Employs pg_advisory_xact_lock at the PostgreSQL database level during order placement and code redemption to prevent duplicate references and race conditions.
- Server-Side Access Guarding: Expiry dates and live entitlements are computed dynamically server-side at read time, ensuring protected PDF documents and video embeds remain strictly confidential.

## Under the hood

- Modern Full-Stack Architecture: Built with Next.js 16 (App Router), React 19, TypeScript, Tailwind CSS, and Shadcn UI for high performance and sleek responsiveness.
- Robust Backend & Database: Powered by Node.js, PostgreSQL 16, and Drizzle ORM enforcing strict schema-level constraints and atomic transactions.
- Authentication & RBAC: Implemented with Better Auth providing secure Role-Based Access Control separating students, instructors, and admin staff.
- 7-Gate Automated CI/CD Pipeline: GitHub Actions pipeline enforcing typecheck, security linting, CSS directional validation, i18n key parity, schema invariants, migration checks, and 148 Vitest tests across 10 files.
- Self-Hosted Infrastructure: Fully containerized using a 4-stage non-root Next.js Dockerfile, deployed on a bare-metal Ubuntu KVM VPS orchestrated with Coolify and Traefik/Caddy SSL automation.
- Security & Hardening: Protected public endpoints with in-process memory rate-limiting and accessible sr-only honeypot fields to silently block spam bots.

## Stack

Next.js 16, React 19, TypeScript, Tailwind CSS, Shadcn UI, PostgreSQL 16, Drizzle ORM, Better Auth, Docker, Coolify, Vitest

More work: [https://salaheddinemedkour.me/projects.md](https://salaheddinemedkour.me/projects.md)
