FoalTS Documentation

website·Indexed 33 days ago

https://foalts.org/

Documentation for FoalTS, a TypeScript framework for building scalable applications. Includes guides on security (CSRF and HTTP headers), authentication using JWT, database integration with Prisma, unit testing, and OpenAPI/Swagger UI. Provides tutorials for building a simple to-do list and real-world examples with React, as well as frontend integration with Angular, React, and Vue across versions v1, v2, v3, and v4.

Tokens
217K
Snippets
1.4K
Records
1.5K
Agent score
65%

What's inside FoalTS

  1. Overview of Permissions and Groups access control

    FoalTS manages access control through Permissions and Groups. A permission grants the right to perform a specific action. A group aggregates users; permissions attached to a group are automatically granted to all users within that group. Permissions can be assigned directly to users or to groups.
  2. Overview of FoalTS Authentication and Authorization

    FoalTS v5 provides a flexible authentication system supporting various architectures including REST APIs, traditional web apps, SPAs, and mobile applications.

    • Authentication: Verifies user identity (Who is the user?).
    • Authorization (Access Control): Determines user permissions (Does the user have the right to do this?).

    The general authentication flow consists of two steps:

    1. Login: Verify credentials, generate a token (stateful or stateless), and return it to the client (via cookie, response body, or header).
    2. Verification: On subsequent requests, the server receives and checks the token to retrieve the associated user.
  3. Overview of FoalTS Authentication and Authorization

    FoalTS distinguishes between Authentication (verifying who a user is) and Authorization (determining what an authenticated user is allowed to do). The framework supports a wide range of architectures including REST APIs, traditional web apps, SPAs, and Mobile apps. It supports both stateful (Session Tokens) and stateless (JWT) state management, with credentials ranging from passwords to social logins, and token storage options including cookies and localStorage.
  4. Overview of FoalTS Hooks

    Hooks are decorators used to execute additional logic before and/or after a controller method. They are primarily used for authentication, access control, request validation, sanitization, and logging. Hooks can be applied to a specific controller method or to the entire controller class (which applies the hook to all methods and sub-controllers). To apply a hook globally, decorate the root AppController.
  5. Overview of the FoalTS framework

    Foal (or FoalTS) is a Node.js framework written in TypeScript for building web applications. It provides an integrated environment that includes a CLI, testing tools, frontend utilities, advanced authentication, ORM, deployment environments, GraphQL and Swagger API, and AWS utilities, reducing the need to manage multiple disparate npm packages.
  6. Overview of TypeORM integration in FoalTS

    FoalTS uses TypeORM as its default Object-Relational Mapper (ORM), supporting both Active Record and Data Mapper patterns. It is integrated by default in new FoalTS projects to facilitate model creation, migrations, and the authentication system.
  7. Overview of FoalTS framework

    Foal (or FoalTS) is a Node.js framework written in TypeScript for creating web applications. It provides an integrated environment to avoid manual package assembly, including a CLI, testing tools, frontend utilities, advanced authentication, ORM, deployment environments, GraphQL, Swagger API, and AWS utilities. The framework emphasizes intuitive syntax, concise code, and static type-checking via TypeScript.
  8. Overview of FoalTS Hooks

    Hooks are decorators in FoalTS that execute additional logic before and/or after a controller method is executed. They are primarily used for authentication, access control, request validation, sanitization, and logging. Hooks can be applied to a specific controller method, an entire controller (applying to all its methods and sub-controllers), or globally by decorating the root AppController.
  9. Overview of the FoalTS framework

    Foal (or FoalTS) is a Node.js framework written in TypeScript for creating web applications. It provides an integrated environment to avoid manual package assembly, including a CLI, testing tools, frontend utilities, advanced authentication, ORM, deployment environments, GraphQL and Swagger API, and AWS utilities. The framework emphasizes intuitive syntax, concise code, and static type-checking via TypeScript.
  10. Overview of FoalTS Hooks

    Hooks are decorators in FoalTS v4 that execute additional logic before and/or after a controller method is executed. They are primarily used for authentication, access control, request validation, sanitization, and logging. Hooks can be applied to a specific controller method, an entire controller (applying to all its methods and sub-controllers), or globally by decorating the root AppController.
  11. Overview of FoalTS Framework

    FoalTS is a lightweight, TypeScript-based web framework built on top of Express. It is designed to provide the essential building blocks for enterprise-grade applications—such as authorization systems, database migrations, and security tools—while remaining open enough to allow the integration of any other Node.js ecosystem libraries. The framework focuses on three core pillars: simplicity in architecture to ensure maintainability, built-in support for unit and acceptance testing to ensure reliability, and a progressive design that allows a project to evolve from a quick proof-of-concept to a scalable production system.
  12. Overview of TypeORM in FoalTS

    FoalTS uses TypeORM as its default Object-Relational Mapping (ORM) system, allowing developers to interact with database tables using TypeScript classes. It supports both Active Record and Data Mapper patterns and includes features such as automatic migration generation, transactions, and various relation types (uni-directional, bi-directional, and self-referenced).