GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - TLabTech/API-Insurance-Policy

BranchesTags
Open more actions menu

Latest commit

 

History

4 Commits
4 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
src
src
 
 
test
test
 
 
.env.example
.env.example
 
 
.gitignore
.gitignore
 
 
.gitlab-ci.yml
.gitlab-ci.yml
 
 
.prettierrc
.prettierrc
 
 
Dockerfile
Dockerfile
 
 
README.md
README.md
 
 
docker-compose.training.yaml
docker-compose.training.yaml
 
 
docker-compose.yaml
docker-compose.yaml
 
 
eslint.config.mjs
eslint.config.mjs
 
 
nest-cli.json
nest-cli.json
 
 
ormconfig.json
ormconfig.json
 
 
package-lock.json
package-lock.json
 
 
package.json
package.json
 
 
tsconfig.build.json
tsconfig.build.json
 
 
tsconfig.json
tsconfig.json
 
 

Repository files navigation

Nest Logo

A progressive Node.js framework for building efficient and scalable server-side applications.

NPM Version Package License NPM Downloads CircleCI Discord Backers Sponsors Donate


Description

Nest framework TypeScript starter repository.


🚀 Project Setup (Local)

1. Install dependencies

npm install

2. Run the project

# development
npm run start

# watch mode
npm run start:dev

# production
npm run start:prod

🐳 Running with Docker

This project includes a full Docker setup for NestJS + PostgreSQL + TypeORM migrations & seeders.

1. Build and start containers

docker compose up -d

This command will:

  • Start the NestJS app container (insurance_policy_app)
  • Start the PostgreSQL container (insurance_policy_postgres)

2. Run database migrations

docker compose run --rm migrate

This will execute all pending TypeORM migrations inside the container.

3. Run database seeders

docker compose run --rm seed

Runs the seeders defined in src/db/seeders/ (e.g. role.seeder.ts, user.seeder.ts, etc.).

4. Verify containers

docker compose ps

You should see something like:

insurance_policy_postgres   Up   0.0.0.0:5432->5432/tcp
insurance_policy_app        Up   0.0.0.0:3000->3000/tcp

5. Access the application

Once containers are up, the app is available at:

http://localhost:3000

6. Access Swagger API docs

http://localhost:3000/api

7. Stop all containers

docker compose down

To reset all data (remove database volume):

docker compose down -v

🗄️ Database Management

Database Migrations

Script Command Description
npm run migration:generate <name> Generate new migration Creates a migration from entity changes
npm run migration:create <name> Create empty migration Creates an empty migration file
npm run migration:run Run migrations Executes pending migrations
npm run migration:revert Revert migration Reverts the last executed migration
npm run migration:show Show migrations Lists all migrations and their status

Example:

npm run migration:generate src/db/migrations/AddUserColumn
npm run migration:run

🧠 Note: In Docker, you can also run migrations using:

docker compose run --rm migrate

Database Seeders

Seeders populate initial data in the application.

Available Seeder Commands

# Local (requires npm dependencies)
npm run seed
npm run seed:dev

# Dockerized environment
docker compose run --rm seed

Seeder Flow

  1. role.seeder.ts → create default roles
  2. user.seeder.ts → create admin & default users
  3. All seeders registered in main.seeder.ts

📜 API Documentation

Once running, Swagger is available at:

http://localhost:3000/api

Features

  • JWT Authentication
  • File Upload (JPEG, PNG, PDF)
  • CORS Enabled
  • Validation using class-validator

🧰 Development Notes

Environment Files

  • .env is automatically loaded into Docker containers.
  • Example configuration:
    DB_HOST=db
    DB_PORT=5432
    DB_USERNAME=postgres
    DB_PASSWORD=postgres
    DB_NAME=insurance_policy_db

Volume Persistence

Database data is stored in Docker volume pgdata:

docker volume ls

To clear database data:

docker compose down -v

✅ Production Checklist

  • synchronize: false in data-source.ts
  • Test migrations before deployment
  • Backup production DB before running migrations
  • Use strong passwords & secrets
  • Set proper CORS origins
  • Enable HTTPS in production

🧠 Quick Summary

Task Local Command Docker Command
Run App npm run start:dev docker compose up -d
Run Migrations npm run migration:run docker compose run --rm migrate
Run Seeders npm run seed:dev docker compose run --rm seed
Stop All Ctrl + C docker compose down

License

Nest is MIT licensed.

About

No description, website, or topics provided.

Resources

Readme
Activity

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.