How dilshadk9/kodo-assignment works
This is a Node.js posts browser and REST API. Users can browse or search posts, with the web view adding pagination and sorting; API clients can request all posts or search results. Search results can be served from Redis, with cache misses fetched through the search API and then cached. The shown source supports the routing and service links below; templates and mock data are represented from the tree, while Redis is documented in the README.
Main entry points: app.js Express application · posts-service.js Post and search service · posts.js Posts pages · postApi.js Posts API
Components 10
Web experience
- Express application
app.js - Home redirect
routes/index.js - Posts pages
routes/posts.js - Posts template
views/posts.ejs
REST API
- Posts API
routes/postApi.js
Posts and cache
- Post and search service
services/posts-service.js - Mock posts
mock_data.json - Redis cache
Other components
- Browser user
- API client
Connections 12
- Browser user → Express application: requests pages
README.md - API client → Express application: requests API
README.md - Express application → Home redirect: mounts at /
app.js - Express application → Posts pages: mounts at /posts
app.js - Express application → Posts API: mounts at /api/posts
app.js - Home redirect → Posts pages: redirects to
routes/index.js - Posts pages → Post and search service: requests posts
routes/posts.js - Posts pages → Posts template: renders
routes/posts.js - Posts API → Post and search service: requests posts
routes/postApi.js - Post and search service → Mock posts: reads posts
services/posts-service.js - Post and search service → Redis cache: reads and writes cache
services/posts-service.js - Post and search service → Posts API: fetches search results
services/posts-service.js