Skip to content

πŸ—οΈ Local development infrastructure and PostgreSQL schema management using Docker and Atlas migrations.

License

Notifications You must be signed in to change notification settings

specvital/infra

Repository files navigation

Specvital Infrastructure

Shared infrastructure for Specvital project - local development environment and database schema management.

Quick Start

VS Code Devcontainer (Recommended)

  1. Open this folder in VS Code
  2. Click "Reopen in Container" when prompted
  3. PostgreSQL and Redis start automatically

Docker Compose

cd .devcontainer && docker compose up -d

Services

Service Port Container Name
PostgreSQL 5432 specvital-postgres
Redis 6379 specvital-redis

Commands

just --list              # View all commands

just deps                # Install dependencies
just migrate             # Apply DB migrations
just reset               # Reset DB (wipe + migrate)
just makemigration name  # Create new migration
just lint all            # Format all files

Multi-Repository Setup

specvital/
β”œβ”€β”€ infra        # This repo - start first!
β”œβ”€β”€ collector    # Go Worker
└── web          # NestJS + Next.js

Workflow: Open infra devcontainer first β†’ then open other repos

Connecting from Other Repos

Add to .devcontainer/docker-compose.yml:

networks:
  specvital-network:
    name: specvital-network
    external: true

Environment variables:

DATABASE_URL=postgres://postgres:postgres@specvital-postgres:5432/specvital?sslmode=disable
REDIS_URL=redis://specvital-redis:6379

Schema Management

Database schema is managed with Atlas.

Path Description
db/schema/schema.hcl Declarative schema
db/schema/migrations Timestamped SQL files
db/atlas.hcl Environment configs

Troubleshooting

Network not found: Start infra devcontainer first, or run docker network create specvital-network

Port conflict: docker ps | grep -E "5432|6379" β†’ stop conflicting container

About

πŸ—οΈ Local development infrastructure and PostgreSQL schema management using Docker and Atlas migrations.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •