This project is using TypeORM along with PostgreSQL.
Interactions with the database are implemented based on Hexagonal Architecture. Benefits of this architecture are described in detail in the Conceptual Benefits and Practical Benefits sections.
Before starting, ensure you have:
- Docker & Docker Compose installed and running
- Node.js (v20 or higher) installed
- Git installed
- PostgreSQL Database created and configured
📖 Docker Setup Guide - Install Docker and start containers
📖 Database Creation Guide - Create PostgreSQL database and configure environment
⚠️ Important: If you plan to usesetup.shfor project setup, make sure to update the database credentials inenv-example-relationalfile before running the script, assetup.shcopies this file to.envduring execution.
📖 Setup Script Documentation - Complete guide for automated project setup
The setup script handles everything automatically:
- Environment configuration
- Dependency installation
- Database setup
- Project customization
- Entity generation (for custom projects)
- Application startup
Get the base boilerplate application running with default modules (User, User-Device, Role, Status, File, Session, Biometric-Challenge, Social).
-
Install Dependencies:
npm install
-
Run Migrations:
npm run migration:run
-
Run Seeders:
npm run seed:run:relational
-
Start Application:
npm run start:dev
Add your own entities and schema to create a custom application.
Prerequisites:
- Custom SQL Schema: Add your custom SQL schema to the
.hygen/generate-migration/sql-script.sqlfile - Entity Schema JSON: Create
.hygen-entities-generator/entities-generator.json
Setup Steps:
-
Install Dependencies:
npm install
-
Generate Migration from SQL File:
npm run generate:migration-from-sql
-
Run Migrations:
npm run migration:run
-
Run Seeders:
npm run seed:run:relational
-
Generate Custom Entities:
npm run generate:entities
-
Start Application:
npm run start:dev
- API Server: http://localhost:3000
- Swagger Documentation: http://localhost:3000/docs
- Database Admin (Adminer): http://localhost:8080
- Email Testing (Maildev): http://localhost:1080
📖 Complete Documentation - Full documentation with table of contents
# Setup & Development
npm run setup # Complete project setup
npm run start:dev # Development server
npm run build # Production build
# Database
npm run generate:migration-from-sql # create migrations from sql file
npm run migration:run # Run migrations
npm run seed:run:relational # Run seeders
# Code Generation
npm run generate:migration # Generate migrations from sql in interactive mode
npm run generate:entities # Generate from JSON schema
npm run generate:resource # Interactive resource generation
npm run generate:sub-entity # Interactive sub-entities generation
npm run generate:enum # Interactive enum generation
npm run generate:relationship # Interactive relationship generation
# Testing
npm run test # Unit tests
npm run test:e2e # End-to-end tests
npm run lint # Code lintingPrevious: Table of Contents
Next: Docker