How sukanta116/url_shortner_api works
Linkora is a URL-shortening web application. Users register or log in, then reach an authenticated dashboard to create and review short links; visiting a short-link path looks up the saved destination and redirects the visitor. The server also validates account input, issues and verifies signed JWT cookies, and persists users, links, and the ID counter through Mongoose models. The graph follows the sampled routes and calls; README documentation was not provided, so unsampled capabilities are not inferred.
Main entry points: app.js Express routes · urlMaker.js Short-link controller · script.js Login and register UI · dashboard.js Dashboard UI
Components 12
Browser experience
- Login and register UI
views/script.js - Dashboard UI
views/dashboard.js
HTTP and identity
- Express routes
app.js - Login validation
midlewares/loginValidation.js - Registration validation
midlewares/userValidation.js - Account controllers
controllers/auth.js - Cookie authentication
midlewares/authenticate.js
Short-link operations
- Short-link controller
controllers/urlMaker.js
Persistent records
- User records
models/User.js - Link records
models/Link.js - ID counter
models/Counter.js
Other components
- Browser
Connections 16
- Browser → Login and register UI: uses
views/script.js - Browser → Dashboard UI: uses
views/dashboard.js - Login and register UI → Express routes: posts auth requests
views/script.js - Dashboard UI → Express routes: requests dashboard data
views/dashboard.js - Express routes → Login and register UI: serves home page
app.js - Express routes → Dashboard UI: serves dashboard
app.js - Express routes → Login validation: runs login checks
app.js - Express routes → Registration validation: runs registration checks
app.js - Express routes → Account controllers: dispatches auth routes
app.js - Express routes → Cookie authentication: guards private routes
app.js - Express routes → Short-link controller: dispatches link routes
app.js - Login validation → User records: checks account
midlewares/loginValidation.js - Registration validation → User records: checks account
midlewares/userValidation.js - Account controllers → User records: creates and finds users
controllers/auth.js - Short-link controller → ID counter: increments ID
controllers/urlMaker.js - Short-link controller → Link records: stores and looks up links
controllers/urlMaker.js