Digesto is an experimental Node.js/TypeScript library designed to help frontend developers quickly spin up a dynamic backend with minimal configuration. By defining your database entities, validations, and schema in a simple YAML file, Digesto will automatically generate and serve RESTful endpoints under the hood.
Note: This project is in progress. Features may change or break without warning until it reaches a stable release.
-
Instant backend Supply a YAML file describing your data model, then run a single CLI command. No need to manually code a server or manage database connections.
-
Auto-generated CRUD Out of the box, Digesto creates routes for listing, creating, reading, updating, and deleting records for each entity you define—so you can focus on your UI.
-
Simple validation Specify validation rules (like
min
,max
, orrequired
) directly in the YAML. Digesto applies them at runtime, preventing invalid data from being stored. -
Single command to launch Run
npx digesto
(or a custom script) in your React/Vue/Angular project, and a Node.js server automatically starts—no separate server code needed. -
Config-driven No complicated server config files. Keep everything in a human-readable
.yml
format, which is easy to update or share with your team. -
Future ready The core architecture is designed to accommodate future features like relationships, authentication, and policy-based permissions—so as your app grows, Digesto can grow with it.
- Node.js 16+
- A PostgreSQL database (currently the default in this project, but potentially extensible)
- npm, yarn or pnpm to install and run the CLI
Digesto is still a work in progress. If you'd like to experiment with it in your project, follow the steps below:
- Install the library
This library is framework agnostic, so you can use it anywhere (React, Vue, Angular, Go, Rust, or just as a RESTful API).
npm install digesto
# or
npx digesto
- Configure environment variables
Set the variables for the database connections and other settings. Create a .env
file in the root of your project (the same folder as package.json
). For example:
DIGESTO_DATABASE_HOST="localhost"
DIGESTO_DATABASE_PORT="5432"
DIGESTO_DATABASE_USERNAME="username"
DIGESTO_DATABASE_PASSWORD="password"
DIGESTO_DATABASE_NAME="test"
DIGESTO_SERVER_PORT=3000
- Create your YAML configuration
By default, Digesto looks for a file at backend/api.yml
. Create a backend folder in your project’s root (next to package.json
) and add an api.yml
file. For example:
name: My pet app
tables:
Cat:
tableName: cats
properties:
id:
type: int
primary: true
generated: true
name:
type: varchar
# more config...
Here you have a real-life use case example.
- Run the CLI
Use the Digesto CLI to start the backend server:
npx digesto
This will spin up the server using the YAML configuration at backend/api.yml
.
With these steps, Digesto should be up and running in your project. Since it’s still in development, breaking changes or unexpected behavior may occur.
Here’s an example backend/api.yml
file:
name: My pet app
tables:
Cat:
tableName: cats
properties:
id:
type: int
primary: true
generated: true
name:
type: varchar
age:
type: number
validation:
min: 3
User:
properties:
name:
type: varchar
When you run npx digesto
:
- A connection to your database is established via TypeORM.
- The
Cat
andUser
entities are created dynamically. - A CRUD API is exposed at
/api/collections/:tableName
,/api/collections/:tableName/:id
, etc. For example:/api/collections/cats
/api/collections/cats/23
- Validations (planned)
- Relationships between models (planned)
- CLI enhancements (planned)
- Database migrations (planned)
- Policy-based permissions (planned)
- Authentication module (planned)
- Admin UI (planned)
Contributions are welcome! To propose changes or add features:
- Clone this repository.
- Install dependencies:
npm install
# or
yarn
- Develop your changes, then open a pull request with an explanation of your improvements or bug fixes.
Disclaimer: This library is still an early-stage project. Breaking changes are likely until a stable version is released. Use at your own discretion, and feel free to share your feedback for future improvements!