How fernando-mashimo/github-users-db works
Project type and purpose
• This is a TypeScript-based CLI application (“github-users-db”) that fetches GitHub user data via the GitHub REST API, persists it in a PostgreSQL database (in Docker), and displays it in the terminal.
• It employs a Clean-Architecture/Hexagonal style: a thin CLI entrypoint, an application/use-case layer, a domain layer, and infrastructure adapters (database, GitHub API).
File structure
• Top-level scripts/config:
• docker-compose.yml (Postgres container)
• runMigrations.ts, runSeeds.ts, resetDb.ts (DB lifecycle)
• .env.example, infrastructure/config/database.ts (environment & DB config)
• src/cliApp.ts & src/cliApp_v2.ts: two implementations of the CLI entrypoint.
• src/application/useCases/: use-case interactors (fetchPersistUser, getUsersByFilters) with input/output DTOs and tests.
• src/domain/entities/user.ts: domain model for User.
• src/infrastructure/github/github.ts: GitHub API adapter.
• src/infrastructure/database/functions/*: CRUD functions for User persistence.
• src/infrastructure/database/migrations & seeds: SQL DDL/DML scripts.
• Tests and lint/jest configs.
README for additional insights
• Confirms technologies: Node.js 18+, TypeScript, Jest, ESLint, Docker/Postgres, optional Commander.js.
Detail without overthinking
• Every major folder as a component.
• Data flows (CLI → Use Case → Domain → Infra → External).
• Configuration scripts (migrations, seeds) as part of the Infrastructure block.