This project was bootstrapped with Fastify-CLI.
In the project directory, you can run:
To start the app in dev mode.
Open http://localhost:3000 to view it in the browser.
For production mode
Run the test cases.
To learn Fastify, check out the Fastify documentation.
To start the database container
Migrations in TypeORM are used to version-control database schema changes, ensuring consistency across different environments. They allow you to create, modify, or remove database tables and columns in a structured way. To create a new migration, first, define your entity inside the entities directory. Once the entity is set up, you can generate the migration using:
To create migrations, this command will create a new migration file based on the entity changes. If you need to manually create a migration file, use:
To generate migrations
After generating the migration, run it to apply the changes to your database:
If needed, you can revert the last applied migration using:
/src
/schemas
user.schema.ts <-- ✅ JSON Schema for validation
/routes
users.ts <-- ✅ Uses schema for validation
/services
user.service.ts <-- ✅ Business logic
/entities
user.entity.ts <-- ✅ TypeORM model