No description
  • TypeScript 94.5%
  • Shell 5.1%
  • JavaScript 0.3%
Find a file
2025-06-02 23:22:53 +01:00
.vscode Add TailwindCSS and DaisyUI combo; Allow ESLint to format config files using Prettier rules. 2025-05-25 04:55:20 +01:00
assets/images/logo Move assets folder outside of source folder for cleanliness (separation of concern). 2025-05-27 15:00:20 +01:00
infra Add MongoDB to docker-compose file; reconfigure Prisma to support multiple DBs if required in future; model service key for 'ProjectUser' to authenticate with other/third-party storage. 2025-05-27 14:45:56 +01:00
prisma/postgres Add MongoDB to docker-compose file; reconfigure Prisma to support multiple DBs if required in future; model service key for 'ProjectUser' to authenticate with other/third-party storage. 2025-05-27 14:45:56 +01:00
public Initial commit from Create Next App 2025-04-24 23:11:29 +01:00
src Move assets folder outside of source folder for cleanliness (separation of concern). 2025-05-27 15:00:20 +01:00
tests Fix typo in tests/README.md. 2025-06-02 23:22:53 +01:00
.env.example Add MongoDB to docker-compose file; reconfigure Prisma to support multiple DBs if required in future; model service key for 'ProjectUser' to authenticate with other/third-party storage. 2025-05-27 14:45:56 +01:00
.gitignore Integrate Playwright for end-to-end testing. 2025-05-27 15:16:12 +01:00
.gitmodules Add API Declr library as Git submodule to declare self-validating API endpoints. 2025-05-24 10:24:09 +01:00
.prettierignore Add project config (ts, npm, next.js); adjust gitignore; configure linting (eslint) and formatting (prettier); add tailwindcss. 2025-05-24 22:55:00 +01:00
.prettierrc Add project config (ts, npm, next.js); adjust gitignore; configure linting (eslint) and formatting (prettier); add tailwindcss. 2025-05-24 22:55:00 +01:00
eslint.config.mts Add test infrastructure for unit tests (frontend, backend), integration tests (frontend+api, api+db), and e2e. 2025-05-28 07:41:44 +01:00
FUNDING.yml Update README file; add funding info. 2025-05-28 13:52:05 +01:00
LICENSE.md Update README file. Add LICENSE file (MIT License). 2025-05-28 09:01:02 +01:00
load-env.sh Add example .env file, and script to load env vars. 2025-05-24 11:12:51 +01:00
next.config.ts Add project config (ts, npm, next.js); adjust gitignore; configure linting (eslint) and formatting (prettier); add tailwindcss. 2025-05-24 22:55:00 +01:00
package-lock.json Update README files. 2025-05-28 08:23:12 +01:00
package.json Update README files. 2025-05-28 08:23:12 +01:00
playwright.config.ts Integrate Playwright for end-to-end testing. 2025-05-27 15:16:12 +01:00
postcss.config.mjs Add TailwindCSS and DaisyUI combo; Allow ESLint to format config files using Prettier rules. 2025-05-25 04:55:20 +01:00
README.md Update README file. 2025-06-02 18:14:59 +01:00
tsconfig.json Move assets folder outside of source folder for cleanliness (separation of concern). 2025-05-27 15:00:20 +01:00
vitest.config.mts Add test infrastructure for unit tests (frontend, backend), integration tests (frontend+api, api+db), and e2e. 2025-05-28 07:41:44 +01:00
vitest.integration.api+db.config.mts Add test infrastructure for unit tests (frontend, backend), integration tests (frontend+api, api+db), and e2e. 2025-05-28 07:41:44 +01:00
vitest.integration.frontend+api.config.mts Add test infrastructure for unit tests (frontend, backend), integration tests (frontend+api, api+db), and e2e. 2025-05-28 07:41:44 +01:00
vitest.unit.backend.config.mts Add test infrastructure for unit tests (frontend, backend), integration tests (frontend+api, api+db), and e2e. 2025-05-28 07:41:44 +01:00
vitest.unit.frontend.config.mts Add test infrastructure for unit tests (frontend, backend), integration tests (frontend+api, api+db), and e2e. 2025-05-28 07:41:44 +01:00

MetaSSR: Production-Grade AI-Powered SSR Web Applications

GitHub Stars License Last Commit GitHub Issues AI-Ready AI-Ready Testing TypeScript Next.js Prisma

MetaSSR is an opinionated template for building AI-ready, multi-tenant, server-side rendered web applications with Next.js.

MetaSSR empowers developers to create augmented intelligence systems and agentic workflows by seamlessly integrating single or multimodal ML models into production-ready SSR apps — all with strict type safety, declarative patterns, comprehensive testing, and multi-tenant authorisation baked in.

🎯 Why MetaSSR?

Multi-Tenant Data Model and Auth

Streamlined three-tier roles (OWNER/EDITOR/VIEWER) enable zero-friction onboarding (auto-OWNER status for creators), instant team collaboration with role-based permissions, and predictable access control — covering 90% of SaaS use cases without complexity.

Rapid Integration

Deploy ML models (LLMs, vision, speech, etc.) as API endpoints with type-safe, declarative schemas — no boilerplate!

Hybrid Architecture

Combine deterministic SSR logic with dynamic streaming AI agents in a unified Next.js framework.

Multimodal Ready

Process text, images, and structured data in cohesive workflows (e.g., RAG pipelines with real-time UI updates).

Testable by Design

Built-in support for mocking services and containerised testing.

🧩 Use Cases

  • Agentic Workflows: Chatbots with memory, autonomous research agents

  • Augmented Interfaces: Real-time document analysis + SSR rendering

  • Multimodal Pipelines: Vision + text models with unified API contracts

Key Features

  • Modular Monolith Architecture - Well-organised codebase with clear separation of concerns

  • Type-Safe Development - Full TypeScript support end-to-end

  • Multi-Tenant Data Model and Auth - Role-based permissions, automatic tenant data isolation (zero-trust defaults), JWT-powered context, and 🚧 full audit logs

  • Declarative Patterns - Structured declarations over imperative code

  • Self-Documenting Code - Emphasis on semantic, declarative patterns

  • Testing Pyramid - Robust test coverage (Unit → Integration → E2E)

  • BDD-Oriented - Behaviour-Driven Development with *.spec.ts focus

  • Zero-Config Instrumentation - Built-in tracing to capture response latency; AI prompts and token usage, etc.

🦾 AI Superpowers

  • 🚧 Agentic Workflow Engine - Build scalable, autonomous AI processes using built-in state management, asynchronous queue processing, and real-time event signaling for seamless multi-step orchestration.

    • Cost Controls - Automatic rate limiting and spend tracking per model

    • Fallback Strategies - Configurable failover for unreliable model APIs

  • 🚧 SSR + Streaming AI - Serve static shells while streaming model responses

  • 🚧 Deterministic Caching - Versioned outputs for reproducible AI results

  • 🚧 Benchmarking Suite - Compare model performance across deployments

🛠️ Technical Stack

Core Infrastructure

  • Frontend: Next.js 13+ (App Router)
  • Relational DB: PostgreSQL (Prisma ORM)
  • NoSQL DB: MongoDB (Model abstraction)
  • API: Declarative schema-validated endpoints

Testing Suite

Test Type Location
Unit tests/unit/frontend, tests/unit/backend
Integration tests/integration/frontend+api, tests/integration/api+db
E2E tests/e2e

🛡️ Testing Strategy

We follow the Testing Pyramid approach with Behaviour-Driven Development (BDD) principles:

 E2E (critical paths; few tests)
       /         \
 Integration      \
     /             \
Unit Tests (foundation; many tests)

Full Testing Documentation

🚀 Getting Started

Prerequisites

  • Node.js 18+
  • Docker
  • PostgreSQL & MongoDB (or use provided Docker setup)

Setup

  1. Environment Configuration

    cp .env.example .env
    # Edit .env with your configuration
    
  2. Launch Infrastructure

    cd infra
    docker-compose up -d
    
  3. Database Initialisation

    # One-time setup
    cd infra/scripts
    ./execute.sh 00-initialise-db.sql
    
    # Apply Prisma migrations (always run after schema changes)
    npm run resync-db
    
    # Create server user (always run after Prisma migrations)
    ./execute.sh 01-create-user-for-server.sql
    
  4. Development Server

    npm run dev
    

    Open http://localhost:3000 in your browser.

🧪 Testing Commands

Command Description
test:unit:frontend Run unit tests for frontend components
test:unit:backend Run unit tests for backend modules
npm test:integration:frontend+api Run integration tests to test interaction of frontend components with API server
npm test:integration:api+db Run integration tests to test interaction of API server with other backend services such as databases
npm test:e2e Run end-to-end tests

📚 Learning Resources

Core Technologies

🤝 Contributing

Contributions are welcome!

Please open an issue or PR for any improvements.

💖 Sponsor This Project

Help us build the future of AI-powered SSR:

📄 License

MIT