How shreyabansal08/gdg_r2 works
This Flask URL shortener accepts link creation, redirect, statistics, health, and authenticated deletion requests. Its main workflow validates a URL and optional TTL/alias, generates or accepts a code, persists the link in SQLite, then returns a short URL; following that URL checks expiry, increments clicks, and redirects. The single source file combines routing, domain logic, and persistence. All implementation nodes therefore point to app.py; the README documents the API, while the excerpt confirms the internal calls shown.
Main entry points: app.py Flask Routes
Components 10
HTTP API
- Flask Routes
app.py
Link Handling
- Create Short Link
app.py - URL and TTL Checks
app.py - Code Generation
app.py - Follow and Count
app.py - Link Statistics
app.py - Authenticated Delete
app.py
SQLite Storage
- Link Records
app.py
Other components
- API Client
- Original URL
Connections 12
- API Client → Flask Routes: sends requests
README.md - Flask Routes → Create Short Link: routes creation
app.py - Flask Routes → Follow and Count: routes code
app.py - Flask Routes → Link Statistics: routes statistics
app.py - Flask Routes → Authenticated Delete: routes deletion
app.py - Create Short Link → URL and TTL Checks: checks input
app.py - Create Short Link → Code Generation: generates code
app.py - Create Short Link → Link Records: saves link
app.py - Follow and Count → Link Records: reads and counts
app.py - Follow and Count → Original URL: redirects visitor
app.py - Link Statistics → Link Records: reads link
app.py - Authenticated Delete → Link Records: deletes link
app.py