How kachechki/chanceofidea-backend works
Chance of Idea is a NestJS REST backend for a marketplace of unfinished projects. The main workflow is GitHub-based sign-in, project publishing and discovery, applications to take over a project, then confirmations that coordinate repository transfer. Categories and tags organize listings; user, project, application, and transfer state persist in PostgreSQL. The graph follows documented capabilities and sampled controller/service calls; links for unsampled routes are limited to README evidence, and no unsampled implementation details are assumed.
Main entry points: data-source.ts PostgreSQL · Project.service.ts Project lifecycle & search · TransferSession.service.ts Transfer sessions · Application.service.ts Applications & decisions
Components 24
Identity & GitHub
- OAuth & JWT
src/auth/services/Auth.service.ts - JWT guard
src/auth/guards/Auth.guard.ts - GitHub credentials
src/auth/services/GithubAccess.service.ts - User profiles
src/user/services/User.service.ts - GitHub API
src/github/services/Github.service.ts - Repository lookup
src/github/github.controller.ts
Project Marketplace
- Project routes
src/project/project.controller.ts - Project lifecycle & search
src/project/services/Project.service.ts - Owner permissions
src/project/guards/Project.guard.ts
Takeover Workflow
- Application routes
src/application/application.controller.ts - Applications & decisions
src/application/services/Application.service.ts - Transfer confirmations
src/transfer-session/transfer-session.controller.ts - Transfer sessions
src/transfer-session/services/TransferSession.service.ts
Listing Organization
- Categories
src/category/services/Category.sevice.ts - Tags
src/tag/services/Tag.service.ts
Persistence
- PostgreSQL
src/database/data-source.ts - Project records
src/project/entities/Project.entity.ts - User records
src/user/entities/User.entity.ts - Application records
src/application/entities/Application.entity.ts - GitHub token records
src/auth/entities/GithubAccess.entity.ts - Transfer records
src/transfer-session/entities/TransferSession.entity.ts - Category records
src/category/entities/Category.entity.ts - Tag records
src/tag/entities/Tag.entity.ts
Other components
- API client
Connections 40
- API client → OAuth & JWT: starts OAuth
README.md - API client → Project routes: uses listings
README.md - API client → Application routes: submits applications
README.md - API client → Transfer confirmations: confirms transfer
README.md - OAuth & JWT → User profiles: saves identity
src/auth/services/Auth.service.ts - OAuth & JWT → GitHub credentials: stores credentials
src/auth/services/Auth.service.ts - JWT guard → API client: authenticates requests
src/auth/guards/Auth.guard.ts - JWT guard → OAuth & JWT: refreshes tokens
src/auth/guards/Auth.guard.ts - GitHub credentials → GitHub token records: persists tokens
src/auth/services/GithubAccess.service.ts - User profiles → User records: reads and writes
src/user/services/User.service.ts - Repository lookup → GitHub API: requests repositories
src/github/github.controller.ts - GitHub API → GitHub credentials: loads credentials
src/github/services/Github.service.ts - GitHub API → Transfer sessions: checks transfer state
src/github/services/Github.service.ts - Project routes → JWT guard: guards routes
src/project/project.controller.ts - Project routes → Owner permissions: checks ownership
src/project/project.controller.ts - Owner permissions → Project lifecycle & search: loads project
src/project/guards/Project.guard.ts - Project routes → Project lifecycle & search: manages listings
src/project/project.controller.ts - Project lifecycle & search → Project records: reads and writes
src/project/services/Project.service.ts - Project lifecycle & search → User profiles: loads owners
src/project/services/Project.service.ts - Project lifecycle & search → Categories: resolves categories
src/project/services/Project.service.ts - Project lifecycle & search → Tags: resolves tags
src/project/services/Project.service.ts - Application routes → JWT guard: guards routes
src/application/application.controller.ts - Application routes → Applications & decisions: submits decisions
src/application/application.controller.ts - Applications & decisions → Application records: reads and writes
src/application/services/Application.service.ts - Applications & decisions → Project lifecycle & search: starts transfer
src/application/services/Application.service.ts - Applications & decisions → Transfer sessions: creates session
src/transfer-session/services/TransferSession.service.ts - Transfer confirmations → JWT guard: guards routes
README.md - Transfer confirmations → Transfer sessions: records confirmations
README.md - Transfer sessions → Transfer records: reads and writes
src/transfer-session/services/TransferSession.service.ts - Transfer sessions → GitHub API: validates repository
src/transfer-session/services/TransferSession.service.ts - Transfer sessions → Applications & decisions: loads application
src/transfer-session/services/TransferSession.service.ts - Categories → Category records: reads and writes
src/category/services/Category.sevice.ts - Tags → Tag records: reads and writes
src/tag/services/Tag.service.ts - PostgreSQL → Project records: stores
- PostgreSQL → User records: stores
- PostgreSQL → Application records: stores
- PostgreSQL → GitHub token records: stores
- PostgreSQL → Transfer records: stores
- PostgreSQL → Category records: stores
- PostgreSQL → Tag records: stores