How raja7744/the-corporate-blog works
This repository implements a blog publishing platform: writers and editors manage posts, while public readers browse and search published content. The backend provides authentication, post and publishing workflows, search, images, and SEO-related endpoints; a Next.js frontend provides authoring and public pages. The sampled code verifies several backend calls and data accesses. Frontend-to-backend HTTP wiring and some listed subsystems were not sampled, so those connections are omitted or marked unverified.
Main entry points: prisma.ts Application database · post.routes.ts Post routes · token.service.ts Token service · auth.controller.ts Authentication handlers
Components 27
Web application
- Author dashboard
tcb-frontend/src/app/(dashboard)/dashboard/posts/page.tsx - Post editor
tcb-frontend/src/components/editor/PostEditor.tsx - Public blog pages
tcb-frontend/src/app/(public)/blog/[slug]/page.tsx - Search page
tcb-frontend/src/app/(public)/search/page.tsx
Identity and access
- Authentication routes
tcb-backend/src/auth/routes/auth.routes.ts - Authentication handlers
tcb-backend/src/auth/controllers/auth.controller.ts - Account service
tcb-backend/src/auth/services/auth.service.ts - Token service
tcb-backend/src/auth/services/token.service.ts - Authentication checks
tcb-backend/src/auth/middleware/authenticate.ts
Content management
- Post routes
tcb-backend/src/posts/routes/post.routes.ts - Post handlers
tcb-backend/src/posts/controllers/post.controller.ts - Post service
tcb-backend/src/posts/services/post.service.ts - Publishing handlers
tcb-backend/src/posts/controllers/publish.controller.ts - Publishing service
tcb-backend/src/posts/services/publish.service.ts - Image routes
tcb-backend/src/images/routes/image.routes.ts - Image handlers
tcb-backend/src/images/controllers/image.controller.ts - Image service
tcb-backend/src/images/services/image.service.ts
Reader discovery
- Search routes
tcb-backend/src/search/routes/search.routes.ts - Search handlers
tcb-backend/src/search/controllers/search.controller.ts - Search and discovery
tcb-backend/src/search/services/search.service.ts - SEO and sitemap
tcb-backend/src/seo/routes/sitemap.routes.ts
Backend platform
- Application database
tcb-backend/src/lib/prisma.ts - Search cache
tcb-backend/src/lib/cache.ts - Error handling
tcb-backend/src/middleware/errorHandler.ts - Health metrics
tcb-backend/src/metrics.controller.ts
Other components
- Writer or editor
- Public reader
Connections 30
- Writer or editor → Author dashboard: manages posts
- Author dashboard → Post editor: opens editor
- Public reader → Public blog pages: reads content
- Public reader → Search page: searches content
- Authentication routes → Authentication handlers: routes requests
tcb-backend/src/auth/routes/auth.routes.ts - Authentication handlers → Account service: registers or logs in
tcb-backend/src/auth/controllers/auth.controller.ts - Authentication handlers → Token service: rotates or revokes
tcb-backend/src/auth/controllers/auth.controller.ts - Account service → Token service: issues tokens
tcb-backend/src/auth/services/auth.service.ts - Account service → Application database: reads and writes users
tcb-backend/src/auth/services/auth.service.ts - Token service → Application database: stores refresh tokens
tcb-backend/src/auth/services/token.service.ts - Authentication checks → Token service: verifies token
tcb-backend/src/auth/middleware/authenticate.ts - Authentication checks → Application database: checks user
tcb-backend/src/auth/middleware/authenticate.ts - Post routes → Post handlers: routes requests
tcb-backend/src/posts/routes/post.routes.ts - Post routes → Publishing handlers: routes publishing
tcb-backend/src/posts/routes/post.routes.ts - Post handlers → Post service: manages posts
tcb-backend/src/posts/controllers/post.controller.ts - Publishing handlers → Publishing service: handles publishing
tcb-backend/src/posts/controllers/publish.controller.ts - Post service → Application database: reads and writes posts
tcb-backend/src/posts/services/post.service.ts - Image routes → Image handlers: routes requests
tcb-backend/src/images/routes/image.routes.ts - Image handlers → Image service: handles images
tcb-backend/src/images/controllers/image.controller.ts - Image service → Application database: uses persistence
tcb-backend/src/images/services/image.service.ts - Search routes → Search handlers: routes requests
tcb-backend/src/search/routes/search.routes.ts - Search handlers → Search and discovery: searches or retrieves
tcb-backend/src/search/controllers/search.controller.ts - Search and discovery → Application database: queries posts and logs
tcb-backend/src/search/services/search.service.ts - Search and discovery → Search cache: caches popular posts
tcb-backend/src/search/services/search.service.ts - SEO and sitemap → Application database: reads sitemap data
tcb-backend/src/seo/routes/sitemap.routes.ts - Health metrics → Application database: checks database health
tcb-backend/src/metrics.controller.ts - Error handling → Application database: reports exceptions
- Post editor → Post routes: submits post data
- Public blog pages → Post routes: loads published posts
- Search page → Search routes: submits searches