- flask, flask_wtf, flask_sqlalchemy, flask_migrate:
pip install flask flask_wtf flask_sqlalchemy flask_migrate
- Setting up database:
export FLASK_APP=urlShortener.py ./setup.sh
- Shorten long URL to short codes (generated or custom)
- Using SQLAlchemy to store data
- Models:
- URL (store url, connect to multiple codes and entries)
- Code (store short code)
- Entry (store timestamp when accessing the url with the short code)
- codes, entries connect to URL with url_id = URL.id
- Analytics (Using entry to analyze daily and total access time)
- Refractoring (more descriptive name for variables and functions)