How dev-macb/breve-link works
Breve Link is a URL shortener with an administrative React panel, API, and local SQLite-backed access analytics. The main workflow is an administrator creating or managing a short link, a visitor requesting its slug, and the API redirecting to the destination while recording a GET access; administrators can then inspect link statistics and QR codes. The graph also covers authentication, user administration, and legacy collection. Relationships are grounded in the README and shown excerpts; unsampled route-to-controller wiring is left out where it cannot be verified.
Main entry points: app.ts Express server · LinkController.ts Link HTTP actions · App.tsx App routes · http.ts HTTP client
Components 27
Admin panel
- App routes
app/src/app/App.tsx - Web session
app/src/app/Sessao.tsx - HTTP client
app/src/services/http.ts - Link dashboard
app/src/paginas/Dashboard.tsx - Statistics view
app/src/paginas/Estatisticas.tsx - Statistics data
app/src/funcionalidades/estatisticas/useEstatisticas.ts - User administration
app/src/paginas/Usuarios.tsx - Session and notices UI
app/src/app
HTTP API
- Express server
api/src/app.ts - Authentication routes
api/src/routes/AutenticacaoRouter.ts - Session authentication
api/src/middlewares/AutenticacaoMiddleware.ts - Link HTTP actions
api/src/controllers/LinkController.ts - User HTTP actions
api/src/controllers/UsuarioController.ts
Link and account domain
- Link rules
api/src/services/LinkService.ts - User and login rules
api/src/services/UsuarioService.ts - QR generation
api/src/utils/QrCodeUtil.ts - Access collection
api/src/utils/ColetaAcessoUtil.ts
Persistence and analytics
- Link records
api/src/repositories/LinkRepository.ts - User records
api/src/repositories/UsuarioRepository.ts - Access analytics
api/src/repositories/AcessoRepository.ts - Legacy geo collection
api/src/services/GeolocalizacaoService.ts - SQLite database
api/src/config/knex/Ambiente.ts
Runtime configuration
- Dependency wiring
api/src/config/Conteiner.ts - Web and session config
api/src/config - API configuration
api/src/config/Ambiente.ts
Other components
- Administrator
- Link visitor
Connections 33
- Administrator → App routes: uses panel
- App routes → Web session: provides session
app/src/app/App.tsx - App routes → Link dashboard: routes to
app/src/app/App.tsx - App routes → Statistics view: routes to
app/src/app/App.tsx - App routes → User administration: routes to
app/src/app/App.tsx - Link dashboard → HTTP client: requests API
- Statistics view → Statistics data: renders data
- Statistics data → HTTP client: fetches stats
app/src/funcionalidades/estatisticas/useEstatisticas.ts - User administration → HTTP client: requests API
app/src/paginas/Usuarios.tsx - Web session → HTTP client: checks session
app/src/app/Sessao.tsx - HTTP client → Express server: sends requests
- Link visitor → Express server: requests slug
- Express server → Link HTTP actions: dispatches redirect
api/src/app.ts - Express server → Authentication routes: mounts auth
api/src/app.ts - Authentication routes → User HTTP actions: dispatches login
api/src/routes/AutenticacaoRouter.ts - Authentication routes → Session authentication: guards session routes
api/src/routes/AutenticacaoRouter.ts - Session authentication → SQLite database: revalidates session
api/src/middlewares/AutenticacaoMiddleware.ts - Link HTTP actions → Link rules: runs link actions
- User HTTP actions → User and login rules: runs user actions
api/src/controllers/UsuarioController.ts - Link HTTP actions → QR generation: generates QR
api/src/controllers/LinkController.ts - Link HTTP actions → Access collection: collects request data
api/src/controllers/LinkController.ts - Link HTTP actions → Link visitor: redirects to destination
api/src/controllers/LinkController.ts - Link rules → Link records: uses link records
- User and login rules → User records: uses user records
- Link rules → Access analytics: records access
- Access analytics → SQLite database: reads and writes
api/src/repositories/AcessoRepository.ts - Link records → SQLite database: reads and writes
api/src/repositories/LinkRepository.ts - User records → SQLite database: persists accounts
- Express server → Legacy geo collection: accepts legacy collection
api/src/app.ts - Legacy geo collection → SQLite database: stores legacy geo data
- Dependency wiring → Link HTTP actions: registers controller
api/src/config/Conteiner.ts - API configuration → Express server: configures runtime
api/src/app.ts - Web and session config → Express server: sets web behavior
api/src/app.ts