How drotyk/recipe-hub works
Recipe Hub is a recipe-sharing web app: people browse and search recipes, inspect details, and—when authenticated—manage recipes, ingredients, recipe-ingredient links, profiles, and comments. The React client routes pages through a shared API layer to a NestJS API; authentication supports passwords and Google OAuth, with JWT-protected operations. Backend services apply domain logic and use TypeORM repositories for PostgreSQL persistence. The README documents additional capabilities such as ownership/admin rules and Swagger; source excerpts are sampled, so uncertain internal links are omitted.
Main entry points: recipe-ingredients.repository.ts TypeORM repositories · recipe.controller.ts REST controllers · auth.service.ts Authentication · api.ts API client
Components 19
React client
- App and routes
apps/frontend/src/App.tsx - Feature pages
apps/frontend/src/pages/recipes-pages.tsx - Auth provider
apps/frontend/src/auth.tsx - API client
apps/frontend/src/api.ts
NestJS API
- REST controllers
apps/backend/src/controllers/recipe.controller.ts - Auth endpoints
apps/backend/src/controllers/auth.controller.ts - JWT guard
apps/backend/src/common/guards/jwt-auth.guard.ts - Swagger API
apps/backend/src/main.ts
Business logic
- Authentication
apps/backend/src/business-logic/auth/auth.service.ts - Recipe management
apps/backend/src/business-logic/recipe.service.ts - Ingredient catalog
apps/backend/src/business-logic/ingredient.service.ts - Recipe ingredients
apps/backend/src/business-logic/recipe-ingredient.service.ts - Comments
apps/backend/src/business-logic/comment.service.ts - User profiles
apps/backend/src/business-logic/user.service.ts
Persistence
- TypeORM repositories
apps/backend/src/repositories/recipe-ingredients.repository.ts - Domain entities
apps/backend/src/domains/entities/recipe.entity.ts - PostgreSQL
External services
- Google OAuth
Other components
- User
Connections 22
- User → App and routes: uses
- App and routes → Feature pages: routes to
- Feature pages → API client: requests data
- Auth provider → API client: calls
- API client → JWT guard: sends API requests
- JWT guard → REST controllers: admits requests
- REST controllers → Recipe management: calls
- REST controllers → Ingredient catalog: calls
- REST controllers → Recipe ingredients: calls
- REST controllers → Comments: calls
- REST controllers → User profiles: calls
- Auth endpoints → Authentication: calls
- Authentication → User profiles: looks up users
- Recipe management → TypeORM repositories: persists recipes
- Ingredient catalog → TypeORM repositories: persists ingredients
- Recipe ingredients → TypeORM repositories: reads and writes
- Comments → TypeORM repositories: persists comments
- User profiles → TypeORM repositories: persists users
- TypeORM repositories → Domain entities: uses mappings
- TypeORM repositories → PostgreSQL: reads and writes
- Authentication → Google OAuth: verifies OAuth
- User → Swagger API: explores API