How mohit-gaur75/url-shortner-fullstack works
ShortLink is a full-stack URL-shortening and analytics platform. Users register or log in, create and manage links, and inspect click analytics; visitors follow short codes through the redirect service. The backend also handles sessions, administration, and health checks. Redis supports redirect caching and click buffering, while a BullMQ worker flushes buffered click data to MongoDB. Frontend page-to-page details and several backend subsystems are documented but unsampled, so their connections are shown only where the README or excerpts support them.
Main entry points: App.jsx React application · url.service.js Link resolution and management · app.js Express application · url.routes.js URL routes
Components 28
Web application
- React application
client/src/App.jsx - Link and dashboard pages
client/src/pages - Analytics page
client/src/pages/AnalyticsPage.jsx - Admin page
client/src/pages/AdminPage.jsx - Redirect bridge
client/src/pages/RedirectBridge.jsx - URL API client
client/src/api/urls.js - Auth API client
client/src/api/auth.js
API and security
- Express application
server/app.js - URL routes
server/routes/url.routes.js - Auth routes
server/routes/auth.routes.js - Redirect routes
server/routes/redirect.routes.js - Health probes
server/services/health.service.js
Link and analytics domain
- URL controller
server/controllers/url.controller.js - Link resolution and management
server/services/url.service.js - Click analytics
server/services/analytics.service.js
Identity and administration
- Auth controller
server/controllers/auth.controller.js - Authentication service
server/services/auth.service.js - Session rotation
server/services/session.service.js - Administration
server/services/admin.service.js
Storage and background runtime
- MongoDB
- Redis
- Link cache
server/services/linkCache.service.js - Click buffer
server/services/clickBuffer.service.js - Click recorder
server/services/clickRecorder.js - Flush scheduler and worker
server/jobs/index.js - Click batch flush
server/jobs/clickFlush.job.js
Other components
- Link visitor
- Platform user
Connections 36
- Platform user → React application: uses
README.md - React application → Link and dashboard pages: routes to
client/src/App.jsx - React application → Analytics page: routes to
client/src/App.jsx - React application → Admin page: routes to
client/src/App.jsx - React application → Redirect bridge: routes to
client/src/App.jsx - Link and dashboard pages → URL API client: requests links
- Analytics page → URL API client: requests analytics
- React application → Auth API client: uses
- URL API client → Express application: calls API
- Auth API client → Express application: calls API
- Link visitor → Redirect bridge: opens short link
- Express application → URL routes: mounts
server/app.js - Express application → Auth routes: mounts
server/app.js - Express application → Redirect routes: mounts
server/app.js - URL routes → URL controller: dispatches
server/routes/url.routes.js - Auth routes → Auth controller: dispatches
server/routes/auth.routes.js - Redirect routes → URL controller: dispatches
server/routes/redirect.routes.js - URL controller → Link resolution and management: calls
server/controllers/url.controller.js - URL routes → Click analytics: dispatches
server/routes/url.routes.js - Link resolution and management → MongoDB: reads and writes
server/services/url.service.js - Link resolution and management → Link cache: resolves via
server/services/url.service.js - Link cache → Redis: reads and writes
server/services/linkCache.service.js - Link resolution and management → Click buffer: records clicks
server/services/url.service.js - Link resolution and management → Click recorder: records clicks
server/services/url.service.js - Click buffer → Redis: buffers events
- Click recorder → Click analytics: records events
- Flush scheduler and worker → Click batch flush: schedules
server/jobs/index.js - Click batch flush → MongoDB: bulk writes
README.md - Flush scheduler and worker → Redis: uses queue
server/jobs/index.js - Auth controller → Authentication service: calls
server/controllers/auth.controller.js - Authentication service → Session rotation: manages sessions
server/services/auth.service.js - Session rotation → MongoDB: stores tokens
server/services/session.service.js - Authentication service → MongoDB: reads and writes users
server/services/auth.service.js - Admin page → Administration: requests administration
- Health probes → MongoDB: checks readiness
README.md - Health probes → Redis: checks readiness
README.md