by Kavi M.

FoalTS is a full-featured Node.js framework written in TypeScript for building scalable HTTP APIs and web applications, with built-in CLI, authentication, ORM, GraphQL, Swagger, file storage, and real-time support.
This block contains the full FoalTS monorepo package sources: a Node.js/TypeScript web framework providing authentication, ORM integration, CLI tooling, file storage, GraphQL, Swagger, JWT, and more as discrete npm packages. It targets backend TypeScript developers building production web applications who want an integrated, opinionated stack without assembling disparate npm dependencies by hand.
aws-s3/ - AWS S3-backed disk storage service (S3Disk) for file upload/downloadcli/ - Command-line tooling: code generators, app scaffolding, script runner, upgrade utilitiescore/ - Framework core: HTTP context, controllers, hooks, dependency injection, servicesgraphiql/ - GraphiQL IDE integration for FoalTS routesgraphql/ - GraphQL request handling middleware and schema wiringjwks-rsa/ - JWKS-RSA key retrieval for JWT verificationjwt/ - JWT authentication hooks and utilitiesmongodb/ - MongoDB session/storage adapterspassword/ - Password hashing and verification utilitiesredis/ - Redis-backed session store and cache adapterssocial/ - OAuth2 social login providers (Google, GitHub, Facebook, etc.)socket.io/ - Socket.IO integration for real-time WebSocket supportstorage/ - Abstract disk storage service with local filesystem backendswagger/ - Swagger/OpenAPI spec generation and UI servingtypeorm/ - TypeORM entity helpers, authenticators, and session storestypestack/ - class-validator / class-transformer integration hooks# Core framework runtime
npm install @foal/core reflect-metadata
# AWS S3 storage
npm install @foal/aws-s3 @aws-sdk/client-s3
# CLI (typically installed globally)
npm install -g @foal/cli
# JWT authentication
npm install @foal/jwt jsonwebtoken
# JWKS-RSA key fetching
npm install @foal/jwks-rsa jwks-rsa
# TypeORM integration
npm install @foal/typeorm typeorm
# Password utilities
npm install @foal/password
# Social OAuth2
npm install @foal/social
# Redis session store
npm install @foal/redis ioredis
# MongoDB session store
npm install @foal/mongodb mongodb
# GraphQL
npm install @foal/graphql graphql
# Swagger UI
npm install @foal/swagger
# Socket.IO
npm install @foal/socket.io socket.io
# class-validator integration
npm install @foal/typestack class-validator class-transformer
# TypeScript build requirements
npm install --save-dev typescript ts-node @types/node
Spin up an isolated sandbox and run it server-side — no local setup.
Tetrees AI Review of this version
This TypeScript cli / script completed archive review with strong static results. Structure, dependency manifests, documentation, functional source, and common risk patterns were checked by the Tetrees verification pipeline; runtime phases are stated separately.
Deterministic AVCP artifact review
Pipeline avcp-2026-08-04.1 · SHA-256 baaf807fdee662f6…
This version-scoped review deterministically inspects the submitted archive for structure, dependencies, documentation, functional source, and common malicious or high-risk signals. Build and test phases are reported as passed only after an isolated sandbox audition. It is not a guarantee of perfect security.
Reviewed Aug 4, 2026
Push this product straight into your AI IDE, web builder or cloud IDE.
Connect Tetrees to a compatible AI IDE, list products you own, and request the verified ZIP without exposing seller upload controls.
No reviews yet.
Sign in to join the discussion
Loading discussion…
No native modules, pod installs, or Android linking steps are required. All packages are pure Node.js/TypeScript.
Clone or copy the contents of source/ into a directory such as vendor/foal-packages/ within your project root, preserving subdirectory structure.
Configure tsconfig.json path aliases so local imports resolve correctly:
{
"compilerOptions": {
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"moduleResolution": "node",
"target": "ES2020",
"module": "commonjs",
"paths": {
"@foal/aws-s3": ["./vendor/foal-packages/aws-s3/src/index.ts"],
"@foal/cli": ["./vendor/foal-packages/cli/src/index.ts"],
"@foal/core": ["./vendor/foal-packages/core/src/index.ts"]
}
}
}
emitDecoratorMetadata and experimentalDecorators are mandatory for FoalTS dependency injection and hooks to function.
Add the required environment variables for AWS S3 storage (if using aws-s3):
# .env
AWS_ACCESS_KEY_ID=your_key
AWS_SECRET_ACCESS_KEY=your_secret
AWS_DEFAULT_REGION=us-east-1
SETTINGS_DISK_S3_BUCKET=your-bucket-name
Add import 'reflect-metadata'; as the very first line of your application entry point before any FoalTS imports.
Build each package from source if needed:
cd vendor/foal-packages/aws-s3 && npm install && npm run build
import { S3Disk } from './aws-s3/src/index';
// Also exported as:
import { S3Disk as ConcreteDisk } from './aws-s3/src/index';
S3Disk is a FoalTS Disk service implementation backed by AWS S3. Inject it wherever the abstract Disk token is expected to provide cloud file storage. The alias ConcreteDisk is used internally by the framework's dependency injection to bind the concrete implementation to the abstract Disk interface. Use S3Disk directly in tests or when you need an explicit S3 reference.
import { ConnectAngularCommandService } from './cli/src/commands/connectors';
A CLI command service that configures a FoalTS backend project to serve an Angular frontend by adjusting build output paths and static file serving. Instantiate and call its run method from a CLI entry point or custom script when integrating Angular into an existing FoalTS project.
import { CreateAppCommandService } from './cli/src/commands/generators';
Scaffolds a complete new FoalTS application directory with standard folder structure, default configuration files, and boilerplate source. Use this programmatically or via the CLI when bootstrapping a new project rather than manually copying templates.
import { RunScriptCommandService } from './cli/src/commands';
Resolves and executes a named FoalTS script from the project's src/scripts/ directory with full dependency injection context. Use it when you need to run database seeders, migration helpers, or maintenance tasks within the application container.
You want to create a new application directory from code rather than the CLI binary.
import 'reflect-metadata';
import { CreateAppCommandService } from './vendor/foal-packages/cli/src/commands/generators';
async function bootstrap() {
const service = new CreateAppCommandService();
await service.run({ name: 'my-api' });
console.log('App scaffolded in ./my-api');
}
bootstrap().catch(console.error);
Wire S3Disk into a FoalTS controller to store uploaded files directly to S3.
import 'reflect-metadata';
import { S3Disk } from './vendor/foal-packages/aws-s3/src/index';
// Assuming @foal/core is installed from npm or built from source/core
import { dependency, HttpResponseOK, Post, Context } from '@foal/core';
import { ParseAndValidateFiles } from '@foal/storage';
export class UploadController {
@dependency
disk: S3Disk;
@Post('/upload')
@ParseAndValidateFiles({ file: { required: true, saveTo: 'avatars' } })
async upload(ctx: Context) {
const { path } = ctx.files.get('file')[0];
return new HttpResponseOK({ path });
}
}
// Register S3Disk as the concrete Disk in your app module:
// ConcreteClass bindings are resolved automatically when S3Disk
// is exported as ConcreteDisk from the aws-s3 package.
Use ConnectReactCommandService to configure the project so the React build output is served by the FoalTS static file middleware.
import 'reflect-metadata';
import {
ConnectReactCommandService,
ConnectAngularCommandService,
ConnectVueCommandService,
} from './vendor/foal-packages/cli/src/commands/connectors';
async function connectFrontend(framework: 'react' | 'angular' | 'vue') {
const services = {
react: new ConnectReactCommandService(),
angular: new ConnectAngularCommandService(),
vue: new ConnectVueCommandService(),
};
await services[framework].run({});
console.log(`${framework} frontend connected to FoalTS.`);
}
connectFrontend('react').catch(console.error);
Execute a seeder script that has access to injected services and the database connection.
import 'reflect-metadata';
import { RunScriptCommandService } from './vendor/foal-packages/cli/src/commands';
async function seed() {
const runner = new RunScriptCommandService();
// Runs src/scripts/seed.ts with full DI context
await runner.run({ name: 'seed' });
}
seed().catch(console.error);
aws-s3/ - Self-contained package exporting S3Disk; depends on @aws-sdk/client-s3 and the abstract Disk interface from @foal/storage.cli/ - CLI entry point (cli.ts) and all command services; templates/ holds file generation templates used by generator commands.core/ - Central package: HTTP pipeline, decorators, DI container, hooks API, session handling.graphiql/ - Mounts the GraphiQL browser IDE at a configurable route for development introspection.graphql/ - Resolves GraphQL operations within FoalTS request lifecycle using a schema and resolvers you provide.jwks-rsa/ - Fetches public keys from a JWKS endpoint; used as a key provider plugin for @foal/jwt.jwt/ - JWTRequired and JWTOptional hooks for route-level JWT authentication and payload extraction.mongodb/ - MongoDB-backed concrete implementations of FoalTS session and token stores.password/ - hashPassword and verifyPassword utilities wrapping bcrypt for safe credential storage.redis/ - Redis-backed session store and cache concrete implementations using ioredis.social/ - Abstract AbstractProvider and concrete Google/GitHub/Facebook/LinkedIn OAuth2 providers.socket.io/ - Wraps Socket.IO server into the FoalTS service container with hook and event-handler support.storage/ - Abstract Disk interface, LocalDisk implementation, and file-parsing middleware.swagger/ - Reads @ApiInfo, @ApiOperation, and related decorators to generate and serve an OpenAPI 3 spec.typeorm/ - TypeORMStore session backend, fetchUserWithPermissions authenticator, and entity utilities.typestack/ - @ValidateBody, @ValidateQuery hooks backed by class-validator and class-transformer.emitDecoratorMetadata: FoalTS DI and hooks silently fail without it. Set "emitDecoratorMetadata": true and "experimentalDecorators": true in tsconfig.json.reflect-metadata imported too late: Must be the absolute first import in your entry file before any FoalTS module; ordering matters because side-effects register metadata globally.S3Disk reads credentials from environment or ~/.aws/credentials; ensure AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, and SETTINGS_DISK_S3_BUCKET are set before the process starts.tsconfig paths apply only to ts-node / IDE; add tsconfig-paths to production builds: node -r tsconfig-paths/register dist/index.js.cli/templates/ directory must be present relative to the compiled cli/src/ output; copy it alongside the build or set FOAL_CLI_TEMPLATES_PATH if the framework supports it.jsonwebtoken or ioredis: These packages are CJS; ensure "module": "commonjs" in tsconfig.json or use a bundler interop shim to avoid ERR_REQUIRE_ESM.I have the FoalTS framework monorepo source in `source/` and the integration
guide in `USAGE.md`. The upstream package name is `foal-srcs`.
Please help me integrate FoalTS into my existing Node.js/TypeScript project
step by step:
1. Read USAGE.md fully before writing any code.
2. Copy the relevant packages from `source/` (e.g., `source/core/`,
`source/jwt/`, `source/typeorm/`) into `vendor/foal-packages/`.
3. Update my `tsconfig.json` with the path aliases shown in USAGE.md,
ensuring `emitDecoratorMetadata` and `experimentalDecorators` are enabled.
4. Add `import 'reflect-metadata'` as the first line of my entry file.
5. Wire the packages I need (list them here: e.g., JWT auth, S3 storage,
TypeORM session) using only the real exports documented in USAGE.md.
6. Show me a working controller example using `S3Disk` for file upload and
`JWTRequired` for route protection, importing from the local `vendor/`
paths.
7. Highlight any environment variables I must set before running.
Do not invent API names. Only use symbols visible in USAGE.md.
FoalTS is released under the MIT License (see source/aws-s3/LICENSE and per-package LICENSE files). Copyright 2017-2025 Loïc Poullain.
Upstream repository and documentation: https://github.com/FoalTS/foal and https://foalts.org.
This product’s unique contribution is clean room implementation of valuable code block into AVCP compatible standard.
The full install guide and integration prompts unlock after purchase.
Automation, Utilities & Developer Tools
Free