🚀 FaasJS
FaasJS provides a chef-selected default path across React, Ant Design, typed APIs, PostgreSQL, validation, testing, plugins, and project conventions so teams can build predictable products without repeatedly assembling their own framework.
The official frontend path is React. The curated business-app stack uses @faasjs/ant-design for UI, @faasjs/pg for PostgreSQL workflows, and agent-readable conventions for complete UI → API → DB → test slices.
Features
Curated default stack
✅ React, Ant Design, PostgreSQL, Vitest, and Vite Plus working together.
✅ Strong defaults for database-driven admin panels, internal tools, SaaS dashboards, and BFF/API layers.
✅ Replaceable choices without turning alternatives into parallel first-class tracks.
Typed full-stack workflow
✅ defineApi endpoints with explicit schemas and typed contracts.
✅ Shared API types across backend handlers and React clients.
✅ PostgreSQL query, migration, and testing workflows through @faasjs/pg and @faasjs/pg-dev.
Agent-readable conventions
✅ Stable file conventions and routing rules.
✅ Complete application slices that are easy for humans and AI coding agents to inspect, review, and refactor.
✅ Plugin patterns for business-specific concerns such as auth context and permissions.
Quick start
Start with Codespaces and Templates
Start with Command Line
npx create-faas-app --name faasjs
npx create-faas-app --name faasjs-admin --template admin
npx create-faas-app --name faasjs-minimal --template minimal
admin is the default starter. It follows the curated FaasJS path with React, Ant Design, PostgreSQL, and @faasjs/pg-dev-powered tests. Use --template minimal when you want a lighter React starter without the database stack.
Examples
API file
// index.api.ts
// all API entry files should end with .api.ts
import { defineApi } from '@faasjs/core'
export default defineApi({
async handler() {
return 'Hello, world' // response content
},
})
Unit test's file
// __tests__/index.test.ts
// unit test files should end with .test.ts
// TSX-based UI tests should use .test.tsx
// UI tests without TSX should use .ui.test.ts
import { testApi } from '@faasjs/dev'
import api from '../index.api'
describe('index', function () {
it('should work', async function () {
// create a test handler
const handler = testApi(api)
// mock the request
const { statusCode, data } = await handler()
// expect the response with 200 status
expect(statusCode).toEqual(200)
// expect the response content is 'Hello, world'
expect(data).toEqual('Hello, world')
})
})
Thanks
Code contributors (in alphabetical order):
Open source projects (in alphabetical order):