How manojgaddigolla/url-shortener works
Short.ly is a full-stack URL shortener: visitors create links anonymously or while signed in, then short codes redirect to destinations while recording click telemetry. Signed-in users manage links and inspect analytics; optional AI features suggest aliases and answer questions about traffic. The graph follows the visible Express routing and controller calls and the documented client capabilities. Some client and route implementations were not excerpted, so those connections are omitted where evidence is limited.
Main entry points: server.js Express server · App.jsx React application · linkService.js Link API client · ShortenPage.jsx Shorten page
Components 25
Web client
- React application
client/src/App.jsx - Home page
client/src/pages/HomePage.jsx - Shorten page
client/src/pages/ShortenPage.jsx - Dashboard
client/src/pages/DashboardPage.jsx - Analytics modal
client/src/components/LinkAnalyticsModal.jsx - Navigation
client/src/components/Navbar.jsx - Link API client
client/src/services/linkService.js - API client
client/src/services/apiService.js - Auth service
client/src/services/authService.js
HTTP API
- Express server
backend/server.js - Short URL routes
backend/routes/urls.js - Link routes
backend/routes/links.js - Redirect routes
backend/routes/index.js - Webhook route
backend/routes/webhooks.js - URL controller
backend/controllers/urlController.js - Link controller
backend/controllers/linksController.js - Webhook controller
backend/controllers/webhookController.js - Error middleware
backend/middleware/errorMiddleware.js
Identity and persistence
- URL records
backend/models/Url.js - User records
backend/models/User.js - MongoDB
- Database connection
backend/config/db.js
External services
- Clerk identity
- Gemini AI
Other components
- Visitor
Connections 29
- Visitor → React application: uses
README.md - React application → Home page: routes to
client/src/App.jsx - React application → Shorten page: routes to
client/src/App.jsx - React application → Dashboard: protects route
client/src/App.jsx - React application → Navigation: renders
client/src/App.jsx - Shorten page → Link API client: calls
client/src/pages/ShortenPage.jsx - Shorten page → API client: calls
client/src/pages/ShortenPage.jsx - Dashboard → Link API client: calls
client/src/pages/DashboardPage.jsx - Dashboard → Analytics modal: renders
client/src/pages/DashboardPage.jsx - Analytics modal → Link API client: calls
client/src/components/LinkAnalyticsModal.jsx - Link API client → Express server: HTTP requests
client/src/services/linkService.js - Express server → Short URL routes: mounts
backend/server.js - Express server → Link routes: mounts
backend/server.js - Express server → Redirect routes: mounts
backend/server.js - Express server → Webhook route: mounts
backend/server.js - Short URL routes → URL controller: dispatches
backend/routes/urls.js - Redirect routes → URL controller: dispatches
backend/routes/index.js - Link routes → Link controller: dispatches
backend/routes/links.js - Webhook route → Webhook controller: dispatches
backend/routes/webhooks.js - URL controller → URL records: reads and writes
backend/controllers/urlController.js - Link controller → URL records: reads and writes
backend/controllers/linksController.js - Webhook controller → User records: upserts and deletes
backend/controllers/webhookController.js - Express server → Database connection: connects
backend/server.js - Database connection → MongoDB: connects to
backend/config/db.js - URL records → MongoDB: persists
README.md - User records → MongoDB: persists
README.md - Link controller → Gemini AI: requests insights
backend/controllers/linksController.js - Webhook controller → Clerk identity: verifies events
backend/controllers/webhookController.js - Express server → Error middleware: handles errors
backend/server.js