https://github.com/specvital/infra
🏗️ Local development infrastructure and PostgreSQL schema management using Docker and Atlas migrations.
https://github.com/specvital/infra
atlas database-migrations devops docker infrastructure postgresql redis
Last synced: 3 months ago
JSON representation
🏗️ Local development infrastructure and PostgreSQL schema management using Docker and Atlas migrations.
- Host: GitHub
- URL: https://github.com/specvital/infra
- Owner: specvital
- License: mit
- Created: 2025-12-08T05:41:39.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2026-01-12T15:34:13.000Z (3 months ago)
- Last Synced: 2026-01-12T21:37:57.851Z (3 months ago)
- Topics: atlas, database-migrations, devops, docker, infrastructure, postgresql, redis
- Language: HCL
- Homepage:
- Size: 759 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# 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
```bash
cd .devcontainer && docker compose up -d
```
## Services
| Service | Port | Container Name |
| ---------- | ---- | ------------------ |
| PostgreSQL | 5432 | specvital-postgres |
| Redis | 6379 | specvital-redis |
## Commands
```bash
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`:
```yaml
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](https://atlasgo.io/).
| 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