This project is a Node.js application built using Fastify, TypeORM, and AdminJS. It simulates a RESTful API for managing accounts and compliance data.
- Docker (version 20.10.17 or higher)
- Docker Compose (version 2.6.0 or higher)
- Clone the repository:
git clone https://github.com/your-repo-url.git
- Create a
.env
file by copying theexample.env
file:cp example.env .env
- Update the environment variables in the
.env
file as needed - Build the Docker image:
docker-compose build
- Start the Docker containers:
docker-compose up
- Access the pg instance and create the database if not already created.
- Access the AdminJS interface at
http://localhost:3000/admin
- Use
docker-compose run app ash
to access the container's shell and run commands, for example:docker-compose run app ash yarn db:migrate
to run database migrationsdocker-compose run app ash yarn lint
to run ESLint on the source code
This project assumes a feature-first approach.
src/
: Source code directoryapp.ts
: Main application filedb/
: Database configuration and migrationsresources/
: Resource definitions for AdminJSshared/
: Shared utility functions and constants
dist/
: Compiled JavaScript output directorynode_modules/
: Dependency directory.eslintrc.cjs
: ESLint configuration filetsconfig.json
: TypeScript configuration filedocker-compose.yml
: Docker Compose definition fileDockerfile
: Dockerfile for building the application imageexample.env
: Example environment variables file
dev
: Starts the development server withtsx watch src/app.ts
lint
: Runs ESLint on the source codelint:fix
: Runs ESLint with automatic fixbuild
: Compiles the TypeScript code to JavaScriptstart
: Starts the production server withnode dist/app.js
typeorm
: Runs TypeORM CLI commandsdb:migrate
: Runs database migrationsdb:migrate:create
: Creates a new database migrationdb:migrate:generate
: Generates a database migration from the current schemadb:migrate:revert
: Reverts the last database migration
@adminjs/fastify
: AdminJS Fastify adapter@adminjs/typeorm
: AdminJS TypeORM adapter@fastify/session
: Fastify session pluginadminjs
: AdminJS librarydate-fns
: Date utility libraryfastify
: Fastify frameworkpg
: PostgreSQL driverreflect-metadata
: Reflect metadata librarytypeorm
: TypeORM library
This project is licensed under the MIT License.