feat: initialize finance project with Fastify, Prisma, and Zod

- Added package.json with necessary dependencies and scripts for development and production.
- Created Prisma schema for BankAccount model with fields: id, name, bankName, accountNumber, createdAt, and updatedAt.
- Implemented Fastify server with CRUD operations for bank accounts, including validation using Zod.
- Added graceful shutdown handling for server and Prisma client.
This commit is contained in:
Peter Wood
2025-04-05 17:52:40 -04:00
parent 7c1cf427d1
commit d150757025
14 changed files with 2266 additions and 710 deletions

44
docker-compose.yml Normal file
View File

@@ -0,0 +1,44 @@
name: finance-api
services:
postgres:
container_name: postgres_container
image: postgres:15
environment:
POSTGRES_USER: ${POSTGRES_USER:-financeuser}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-changeme}
POSTGRES_DB: ${POSTGRES_DB:-finance}
PGDATA: /data/postgres
volumes:
- postgres_data:/data/postgres
ports:
- "${POSTGRES_PORT}:5432"
networks:
- postgres
restart: unless-stopped
labels:
- diun.enable=true
pgadmin:
container_name: pgadmin_container
image: dpage/pgadmin4
environment:
PGADMIN_DEFAULT_EMAIL: ${PGADMIN_DEFAULT_EMAIL:-peter@peterwood.dev}
PGADMIN_DEFAULT_PASSWORD: ${PGADMIN_DEFAULT_PASSWORD:-admin}
PGADMIN_CONFIG_SERVER_MODE: 'False'
volumes:
- pgadmin_data:/var/lib/pgadmin
ports:
- "${PGADMIN_PORT:-5050}:80"
networks:
- postgres
restart: unless-stopped
labels:
- diun.enable=true
networks:
postgres:
driver: bridge
volumes:
postgres_data:
pgadmin_data: