Skip to content

ZinTrust/zintrust

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1,112 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ZinTrust Framework

Website CI/CD Pipeline SonarQube Analysis SonarCloud Quality Gate Coverage Duplicated Lines (%) Security Rating Security Scan Known Vulnerabilities License: MIT npm version

Production-grade TypeScript backend framework with a “minimal core” (no Express/Fastify) and a batteries-included CLI + developer experience. Visit zintrust.com for more information.

Open in GitHub Codespaces

⚡ Instant Development Environment

Click the "Open in GitHub Codespaces" button above to launch a pre-configured sandbox.

Sandbox Details:

  • Repository: ZinTrust/zintrust
  • Automatic Setup: Uses docker.io/zintrust/zintrust:latest
  • Active Port: 7772 (The API will open automatically in your browser)
  • Start Command: node --experimental-specifier-resolution=node dist/src/boot/bootstrap.js

Status

Check Status
Build CI/CD Pipeline
Quality SonarQube Analysis
Security Security Scan Known Vulnerabilities
Docker Publish Docker Image Docker Image
Tests Tests Passing

SonarCloud

If you want PR-specific “New Code” numbers in GitHub, rely on the SonarCloud PR Check (that’s where pullRequest=... links come from); the README badges above intentionally track the project overview so they stay stable.

Features

Type-Safe ORM & Query Builder – No raw SQL, chainable queries ✅ Multi-Database Support – SQLite, PostgreSQL, MySQL, SQL Server via adapters ✅ Declarative Routing – Groups, resources, nested routes ✅ Service Container – Dependency injection out of the box ✅ Migrations & Seeding – Schema versioning, factory-based test data ✅ N+1 Detection – Built-in query optimization monitoring ✅ Memory Profiling – Heap/GC tracking per request ✅ SQL Injection Prevention – Parameterized queries by default ✅ Multi-Cloud Ready – Docker, AWS, Cloudflare Wrangler, Deno ✅ Edge Compatible – Run API on Cloudflare Workers, process jobs on Node.js ✅ Production Quality – SonarQube integration, 90%+ test coverage

Quick Start

# Install @zintrust/core (ZinTrust CLI) globally
npm install -g @zintrust/core

# Create a new project
zin new my-app
cd my-app

# Install adapters as needed (example: SQLite)
zin add db:sqlite

# Start development server
zin start

New projects include an .env with safe defaults (and the generator will backfill them if missing):

  • HOST=localhost
  • PORT=7777
  • LOG_LEVEL=debug

If you need a project-local Node/Docker bootstrap file, reuse the stock core bootstrap instead of copying the full framework bootstrap into your app:

// src/boot/bootstrap.ts
import '@zintrust/core/boot';

export {};

Adapters (on-demand installs)

ZinTrust ships a minimal core. Database/cache/etc. integrations are installed explicitly via adapter packages.

# Database adapters
zin add db:sqlite    # installs @zintrust/db-sqlite
zin add db:postgres  # installs @zintrust/db-postgres
zin add db:mysql     # installs @zintrust/db-mysql
zin add db:mssql     # installs @zintrust/db-sqlserver

The canonical CLI is zin. z is a documented shorthand alias.

Core Package Dependencies (CLI + DX)

The npm package @zintrust/core includes a small set of runtime dependencies primarily to power the CLI and developer experience.

  • commander - command parsing and --help UX for the zin CLI
  • inquirer - interactive prompts (project scaffolding, generators)
  • chalk - terminal colors for readable CLI output
  • tsx - runs TypeScript-based CLI entrypoints without requiring a separate build step during development

Some dependencies are used by built-in features/adapters:

  • bcrypt - password hashing helpers
  • jsonwebtoken - JWT token signing/verification utilities

Database drivers are provided by adapter packages (for example, @zintrust/db-sqlite depends on better-sqlite3). Note: native modules like better-sqlite3 may require build tools on certain platforms.

Development

If you want to contribute to the framework:

# Clone the repository
git clone https://github.com/ZinTrust/ZinTrust.git
cd ZinTrust

# Install dependencies
npm install

# Start development server
zin start

# Run tests
npm test

# Build for production
npm run build

Docker Images

ZinTrust now publishes two framework runtime targets from the main Dockerfile:

  • zintrust/zintrust: base runtime image with official built-in plugin registrations preloaded by default
  • zintrust/zintrust-worker: dedicated worker runtime image that starts the worker CLI entrypoint by default

Built-in base plugin packages:

  • @zintrust/db-postgres
  • @zintrust/db-mysql
  • @zintrust/db-sqlserver
  • @zintrust/db-sqlite
  • @zintrust/queue-redis
  • @zintrust/queue-rabbitmq
  • @zintrust/queue-sqs
  • @zintrust/cache-redis
  • @zintrust/cache-mongodb
  • @zintrust/mail-nodemailer
  • @zintrust/mail-smtp
  • @zintrust/mail-sendgrid
  • @zintrust/mail-mailgun
  • @zintrust/storage-s3
  • @zintrust/storage-r2
  • @zintrust/storage-gcs

Worker image additions:

  • @zintrust/workers
  • @zintrust/queue-monitor

Local smoke commands:

npm run docker:build
npm run docker:build:worker
npm run docker:smoke

Project Structure

zintrust/
├── app/                    # Application code (Controllers, Models, Middleware)
├── bin/                    # CLI tools and commands
├── packages/                # Optional adapter packages (cache/db/mail/queue/storage)
├── routes/                 # Route definitions
├── services/                # Example microservices (ecommerce)
├── src/                    # Framework & services
│   ├── config/             # Centralized configuration (env, app, database, security, etc.)
│   ├── database/           # Migrations, seeders, factories
│   ├── functions/          # Serverless handlers (Lambda, Deno, Cloudflare)
│   ├── orm/                # Object-Relational Mapping
│   ├── routing/            # Routing engine
│   ├── middleware/         # Middleware system
│   ├── container/          # Service container (DI)
│   ├── http/               # Request/Response handlers
│   ├── microservices/      # Microservices framework
│   ├── security/           # Security utilities
│   ├── validation/         # Input validation
│   ├── profiling/          # Performance profiling
│   └── deployment/         # Cloud adapters (AWS, Cloudflare, Deno)
├── tests/                  # Test files
│   ├── unit/               # Unit tests
│   └── integration/        # Integration tests
├── docs/                   # Public documentation
├── docs-website/            # Docs site build output/tools
└── md/                     # Internal documentation

Documentation

See docs/ for comprehensive guides on:

Practical walkthroughs:

Import Patterns

Use path aliases for clean, maintainable imports:

// Configuration
import { appConfig } from '@config/app';
import { databaseConfig } from '@config/database';
import { securityConfig } from '@config/security';

// ORM & Database
import { Model } from '@orm/Model';
import { Database } from '@orm/Database';

// Routing
import { Router } from '@routing/Router';

// HTTP
import { Request } from '@http/Request';
import { Response } from '@http/Response';

// Services & Microservices
import { MicroserviceBootstrap } from '@microservices/MicroserviceBootstrap';

// Application code (app folder)
import { User } from '@app/Models/User';
import { UserController } from '@app/Controllers/UserController';

// Serverless
import { handler } from '@functions/lambda';

// Microservices
import { usersService } from '@services/ecommerce/users';

Architecture

ZinTrust is built on proven architectural patterns for modern backend development:

  • Models first: Define your data schema with explicit models
  • Type safety: Full TypeScript with strict mode enabled
  • Testing focus: Vitest integration with fast, isolated tests
  • Performance by default: N+1 detection, memory profiling built-in
  • Minimal core: Core HTTP/routing logic avoids external web frameworks; the published package still includes CLI/DX dependencies listed above

Contributing

We welcome contributions! Please see our Contributor & QA Guide for details on our code of conduct, and the process for submitting pull requests.

Quality Assurance

ZinTrust enforces strict quality standards. Before submitting a PR, ensure you run:

zin qa

This will run linting, type-checking, and tests to ensure your changes meet our standards.

Security

If you discover a security vulnerability within ZinTrust, please see our Security Policy.

Community & Support

Join our community and stay updated:

License

MIT


Copyright © 2025 ZinTrust Framework. All rights reserved.

About

TypeScript backend framework

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors