A PicoURL is a URL shortener written in python using Flask and pymongo.
The code contains unit tests for all modules and also integration tests for all RESTful endpoints.
Picourl supports the following
1. Creating short urls anonymously
2. Login support for users.
3. Shows users 7 most clicked urls.
-
To install the application clone the application using
git clone https://github.com/PradheepShrinivasan/picourl.git
-
Install the required python dependencies using
pip install requirements.txt
-
Install mongodb using the following commands as mentioned in mongodb documentation
Picourl allows configuration of the following variables in config.py
PORT - the port to listen to(default 5000)
CONNECTION_STRING - the mongodb string to connect(default is mongodb://localhost:27017/)
SITE_URL - the site prefix in url shortener (default is localhost)
To run the application go to the cloned folder and run it using
```
flask run
```
if you have used the default configuration the system must be listening in port 5000
and you can access it by using
http://localhost:5000
The application screen should something like below
And logged in page looks like below
one can look at the site hosted at heroku http://picourl.herokuapp.com/
The discussion on design and configuration are available in blog post 1,2,3 4
0.4 - Updated to the latest version of python and dependencies
0.3 - Added support to show the users clicked 7 urls.
0.2 - Added UI and form validation using csrf tokens.
0.1 - Basic working code with storage to backend mongodb and redirect on using shortURL
The software is provided in BSD licence, see LICENCE file for more details.