Skip to content

The official monorepo for Agape Toolkit — a cohesive TypeScript ecosystem for model-driven web development.

Notifications You must be signed in to change notification settings

AgapeToolkit/AgapeToolkit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AgapeToolkit

AgapeToolkit is a collection of TypeScript libraries for building modern APIs and UIs with clarity, consistency, and confidence.

It provides a single source of truth for your data models and powers validation, serialization, ORM, API layers, and user interfaces — all from the same definitions.

Status: Active development. Expect rapid iteration and breaking changes until v1.0.


📦 Packages

This monorepo contains multiple packages published under the @agape/* scope. Each can be used independently or together.

Package Description npm Docs
@agape/model Annotate and validate models for APIs and UIs. npm Docs
@agape/api Build REST APIs directly from your models. npm Docs
@agape/orm Simple ORM for mapping models to relational databases. npm Docs
@agape/ui Render forms, tables, and other UI components using models. npm Docs
@agape/alchemy Serialization and deserialization utilities for models. npm Docs
@agape/object Compose classes with mixin-style traits and behavioral decorators. npm Docs

Supporting Packages

These packages are used internally by the main libraries but can also be useful on their own.

Package Description npm Docs
@agape/datetime Format and parse dates using Unicode patterns and Intl.DateTimeFormat. npm Docs
@agape/locale Serialization and deserialization utilities for models. npm Docs
@agape/metadata Annotate and validate models for APIs and UIs. npm Docs
@agape/string Build REST APIs directly from your models. npm Docs
@agape/temporal Temporal API polyfill with graceful fallback for unsupported environments. npm Docs
@agape/types Simple ORM for mapping models to relational databases. npm Docs
@agape/util Utility functions for object manipulation and validation. npm Docs

See agape.dev for the full list of packages and documentation.


🚀 Quick Example

Let's build a complete application for editing employee records.

Create the model

import { Model, Field } from '@agape/model'; @Model class Employee { @Field @PrimaryKey id!: number; @Field @Alphanumeric number!: string; @Field @MaxLength(64) name!: string; @Field @Email email!: string; }

Register the model with the ORM

import { orm } from '@agape/orm'; orm.register(Employee);

Create the API controller

import { Controller } from '@agape/api'; import { Traits } from '@agape/object'; interface EmployeeController extends HasCrudOperations<Employee> { } @Controller('employees') @Traits(CanPerformCrud(Employee)) class EmployeeController { }

Bootstrap the API

import express from 'express'; import { bootstrapExpress } from '@agape/api'; const app = express(); boostrapExpress(app, EmployeeController); app.listen(3000);

Create the API Client

ag g client --name EmployeeApi \ --server http://localhost:3000 \ --root /api --controller EmployeeController --models @myapp/models --output apps/frontend/src/app/shared/services/employee-api.ts

Create the UI

import { Route } from '@angular/router'; import { crudRoutes } from '@agape/ui'; import { EmployeeApi } from './shared/services/employee-api'; export const appRoutes: Route[] = [ ...crudRoutes( { path: '/employees', model: Employee, api: EmployeeApi } ) ];

🤝 Contributing

Contributions are welcome! Please see CONTRIBUTING.md for details.

📄 License

MIT © 2025 Maverik Minett