TSDIAPI Documentation
TypeScript API Framework
Type-Safe by Design
Built with TypeScript from the ground up, TSDIAPI provides full type safety for your API endpoints, dependency injection, and data validation.
Modern & Fast
Powered by Fastify and modern TypeScript features, TSDIAPI delivers exceptional performance while maintaining clean, maintainable code.
Developer Experience
Enjoy automatic Swagger documentation, built-in validation via TypeBox, and a powerful CLI for rapid development and code generation.
Quick Start
Create a new TSDIAPI project in seconds:
npx @tsdiapi/cli create myapi
cd myapi
npm start
Type-Safe Routes
Write fully type-safe API endpoints:
export default function userController({ useRoute }: AppContext) {
useRoute()
.get("/users/:id")
.params(Type.Object({ id: Type.String() }))
.code(200, Type.Object({
id: Type.String(),
name: Type.String()
}))
.handler(async (req) => {
return {
status: 200,
data: {
id: req.params.id,
name: "John Doe"
}
};
})
.build();
}