core
Nexus Base
Section titled βNexus BaseβNexus Base is a modern, modular, single-user application shell built for scalability and maintainability. It serves as the foundational βOperating Systemβ for downstream applications (like TeamSeed and ArcNexus), providing a robust core with authentication, a dynamic registry-based UI shell, and a clean separation of concerns.
π Key Features
Section titled βπ Key Featuresβ- Registry/Shell Architecture: A dynamic βOperating Systemβ UI pattern where features are loaded into zones (
nav-main,header-end,details-panel) via a Registry, keeping the core shell immutable. - Authentication: Secure, full-featured auth system using Auth.js (v5) with Prism Adapter. Includes registration, login, email verification, password reset, and role-based access control.
- Tech Stack:
- Framework: Astro (Server-side rendering, API routes).
- UI Library: React with Tailwind CSS.
- Database: PostgreSQL with Prisma ORM.
- State Management: Zustand (for Shell state).
- Testing: Playwright (E2E).
- Production-Ready: Dockerized development and production environments.
π οΈ Prerequisites
Section titled βπ οΈ PrerequisitesβEnsure you have the following installed:
- Node.js (v20+ recommended)
- Docker & Docker Compose
- npm
π Getting Started
Section titled βπ Getting Startedβ1. Clone & Install
Section titled β1. Clone & Installβgit clone <repository-url>cd app-corenpm install2. Environment Setup
Section titled β2. Environment SetupβCopy the example environment file and configure it:
cp .env.example .envUpdate .env with your secure secrets (Generate secrets with openssl rand -hex 32).
3. Start Development
Section titled β3. Start DevelopmentβTo start the development server and the database automatically:
npm run dev- URL: http://localhost:4321
- Database: PostgreSQL running on port
5432(managed viacompose.db.yml).
π¦ Scripts & Commands
Section titled βπ¦ Scripts & Commandsβ| Command | Description |
|---|---|
npm run dev | Starts Postgres (Docker) + Astro Dev Server. |
npm run build | Builds the project for production. |
npm run preview | Previews the production build locally. |
npm run db:up | Starts only the PostgreSQL database container. |
npm run db:down | Stops the PostgreSQL database container. |
npm run docker:up | Starts the entire app (App + DB) in Docker mode. |
npm run test:e2e | Runs End-to-End tests using Playwright in Docker. |
npm run test:e2e:ui | Runs Playwright UI for interactive testing. |
π§ͺ Testing
Section titled βπ§ͺ TestingβNexus Base uses Playwright for rigorous End-to-End (E2E) testing.
To run tests in a headless CI-like environment (Dockerized):
npm run test:e2eTo run tests interactively with the Playwright UI:
npm run test:e2e:uiποΈ Architecture
Section titled βποΈ ArchitectureβDirectory Structure
Section titled βDirectory Structureβ/βββ compose.db.yaml # Postgres Service Definitionβββ compose.yml # Development Docker Compose (Extends db)βββ compose.test.yml # Testing Docker Compose (Extends db)βββ Dockerfile # Production Dockerfileβββ src/β βββ actions/ # Server Actions (Backend Logic)β β βββ core/ # Core User/Auth Actionsβ βββ components/ # Reusable UI Componentsβ β βββ shell/ # Master Shell & Layoutsβ βββ lib/ # Utilities (DB, Email, Registry Loader)β βββ registry/ # UI Zones (The "Registry")β β βββ nav-main/β β βββ header-end/β β βββ ...β βββ layouts/ # Astro Layoutsβ βββ pages/ # Astro RoutesThe Shell Pattern
Section titled βThe Shell PatternβEverything is a βpluginβ. The MasterShell loads components dynamically from src/registry/ into specific zones.
To add a sidebar link, simply create a component in src/registry/nav-main/ with an exported order constant.
π License
Section titled βπ LicenseβProprietary / Closed Source (Update as needed)