{"id":41430996,"url":"https://github.com/thara/facility_reservation_go","last_synced_at":"2026-01-23T14:31:05.254Z","repository":{"id":299185136,"uuid":"1001512620","full_name":"thara/facility_reservation_go","owner":"thara","description":"This project is my experiment of (almost) vibe coding","archived":false,"fork":false,"pushed_at":"2025-07-12T11:48:46.000Z","size":297,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-11-21T17:10:44.814Z","etag":null,"topics":["agentic-coding"],"latest_commit_sha":null,"homepage":"http://thara.dev/facility_reservation_go/","language":"Go","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thara.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-06-13T14:04:41.000Z","updated_at":"2025-07-12T11:48:49.000Z","dependencies_parsed_at":"2025-07-12T13:16:46.038Z","dependency_job_id":"9f411789-0570-4731-a22e-7138f9e0062f","html_url":"https://github.com/thara/facility_reservation_go","commit_stats":null,"previous_names":["thara/facility_reservation_go"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/thara/facility_reservation_go","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thara%2Ffacility_reservation_go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thara%2Ffacility_reservation_go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thara%2Ffacility_reservation_go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thara%2Ffacility_reservation_go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thara","download_url":"https://codeload.github.com/thara/facility_reservation_go/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thara%2Ffacility_reservation_go/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28694248,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-23T14:15:13.573Z","status":"ssl_error","status_checked_at":"2026-01-23T14:09:05.534Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["agentic-coding"],"created_at":"2026-01-23T14:31:04.378Z","updated_at":"2026-01-23T14:31:05.158Z","avatar_url":"https://github.com/thara.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Facility Reservation API\n\nA Go-based facility reservation system built with a contract-first approach using modern tooling for type-safe development.\n\n## Architecture\n\nThis project uses a **contract-first** architecture with two key boundaries that drive code generation:\n\n- **Data Contract**: Database schema (`_db/schema.sql`) defines the data model\n- **API Contract**: TypeSpec specification (`spec/main.tsp`) defines the interface\n\nThe architecture uses the following key technologies:\n\n- **Atlas**: Database schema-as-code for migrations and schema management\n- **sqlc**: Type-safe Go code generation from SQL queries\n- **ogen**: HTTP server generation from TypeSpec API specifications\n- **PostgreSQL**: Primary database with pgx driver for connection pooling\n\n## Quick Start\n\n### Prerequisites\n\n- Docker and Docker Compose\n- Go 1.21+\n- Ports 5432 and 5433 available on localhost\n\n### Setup\n\n1. Install development dependencies:\n   ```bash\n   make dev-deps\n   ```\n\n2. Start the database:\n   ```bash\n   make db-up\n   ```\n\n3. Setup database schema:\n   ```bash\n   make db-setup\n   ```\n\n4. Build and test:\n   ```bash\n   make build_dev\n   ```\n\n5. Run the server:\n   ```bash\n   go run cmd/api-server/main.go\n   ```\n\n## API Endpoints\n\nThe API provides three main endpoint groups:\n\n- `/api/v1/admin/users/` - User management (admin only)\n- `/api/v1/facilities/` - Facility CRUD operations\n- `/api/v1/me/` - Current user profile\n\n## Development Workflow\n\n1. **Schema Changes**: Modify `_db/schema.sql`\n2. **Apply Schema**: `make atlas-apply`\n3. **Update Queries**: Edit `_db/query_*.sql`\n4. **Generate Code**: `make sqlc-generate`\n5. **API Changes**: Modify `spec/main.tsp`\n6. **Update Server**: `make ogen`\n7. **Implement Logic**: Update `internal/api_service.go`\n8. **Test**: `make build_dev`\n\n## Key Commands\n\n### Database Operations\n```bash\nmake db-up          # Start PostgreSQL\nmake db-down        # Stop database\nmake db-setup       # Setup schema\nmake atlas-apply    # Apply schema changes\nmake sqlc-generate  # Generate Go code from SQL\n```\n\n### Development\n```bash\nmake build_dev      # Full development build pipeline\nmake test-short     # Unit tests only\nmake test-integration # Integration tests with database\nmake fmt           # Format code\nmake lint          # Run linter\n```\n\n### API Generation\n```bash\nmake ogen          # Generate Go server from TypeSpec\nmake tsp           # Generate TypeSpec schema only\n```\n\n## Database Configuration\n\n- **Development**: `postgres://postgres:postgres@localhost:5432/facility_reservation_db?sslmode=disable`\n- **Test**: `postgres://postgres:postgres@localhost:5433/facility_reservation_db?sslmode=disable`\n- **Custom**: Set `DATABASE_URL` environment variable or use `-database-url` flag\n\n## Project Structure\n\n\n```\n_db/                    # Database schema and queries\n├── schema.sql         # Database schema (source of truth)\n└── query_*.sql        # SQL queries for CRUD operations\napi/                   # Auto-generated HTTP server code\ninternal/\n├── db/               # Auto-generated database code\n├── api_service.go        # Business logic implementation\n└── db_service.go       # Database service\nspec/\n└── main.tsp          # TypeSpec API specification\ncmd/api-server/       # Server entry point\n```\n\n\n## Important Notes\n\n- **Never edit** files in `api/` or `internal/db/` directories (auto-generated)\n- **Database schema** in `_db/schema.sql` is the single source of truth\n- **All code changes** must pass `make build_dev` before being considered complete\n- **No database functions** - all business logic stays in the application layer","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthara%2Ffacility_reservation_go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthara%2Ffacility_reservation_go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthara%2Ffacility_reservation_go/lists"}