Skip to content

core

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.

  • 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.

Ensure you have the following installed:

  • Node.js (v20+ recommended)
  • Docker & Docker Compose
  • npm
Terminal window
git clone <repository-url>
cd app-core
npm install

Copy the example environment file and configure it:

Terminal window
cp .env.example .env

Update .env with your secure secrets (Generate secrets with openssl rand -hex 32).

To start the development server and the database automatically:

Terminal window
npm run dev
CommandDescription
npm run devStarts Postgres (Docker) + Astro Dev Server.
npm run buildBuilds the project for production.
npm run previewPreviews the production build locally.
npm run db:upStarts only the PostgreSQL database container.
npm run db:downStops the PostgreSQL database container.
npm run docker:upStarts the entire app (App + DB) in Docker mode.
npm run test:e2eRuns End-to-End tests using Playwright in Docker.
npm run test:e2e:uiRuns Playwright UI for interactive testing.

Nexus Base uses Playwright for rigorous End-to-End (E2E) testing.

To run tests in a headless CI-like environment (Dockerized):

Terminal window
npm run test:e2e

To run tests interactively with the Playwright UI:

Terminal window
npm run test:e2e:ui
/
β”œβ”€β”€ 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 Routes

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.

Proprietary / Closed Source (Update as needed)