Giter VIP home page Giter VIP logo

ksh168 / smolink-url_shortener Goto Github PK

View Code? Open in Web Editor NEW
8.0 1.0 14.0 2.04 MB

This is a simple URL shortener in Flask. Shortens URL upto length 512 characters to 6 characters. Made using Flask-SQLAlchemy. This URL shortener will be able to redirect links and keep stats on the number of times each link was visited. Also has HTTP Basic Authentication to view stats. All this data will be stored in a sqlite3 database.

Python 40.56% HTML 51.55% CSS 3.23% JavaScript 4.65%
url-shortener python flask sqlite database flask-sqlalchemy redirect-links

smolink-url_shortener's Introduction

Hello there! ๐Ÿ‘‹, myself Kunal

TECHNICAL SKILLS

Languages & Frameworks

Java | Spring Boot | TypeScript | JavaScript | NodeJS | NestJS | React | Python | FastAPI

Databases

PostgreSQL | MySQL | MongoDB

Queues

Kafka | SQS

Data Engineering

PySpark | Airflow

Logging

OpenSearch | Cloudwatch

Cloud Platforms

AWS | Azure

MY HOBBIES

Astronomy | Star Gazing | Graphic Designing

Reach me out:

linkedin linkedin website

smolink-url_shortener's People

Contributors

danchris avatar dheerajd5 avatar ksh168 avatar rutvikpadhiyar000 avatar sahil-ramagiri avatar siddharth1010 avatar smartankur avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

smolink-url_shortener's Issues

Reorganize the index.html file

currently the file index.html contains css, html, js all at one place. Separate them into different files to account for future scaling.

Filter user input

In the current design, user input is not filtered. We want to make sure user inserts a URL only.

button to return to index page

After user clicks on "Shorten" button on index page, on the next page add another button which allows user to return to index page again in case they need to generate another URL.

Add requirements.txt file.

Adding requirements.txt file will really make it easy to install all requirements instead of downloading all separately.

Config file not found

FileNotFoundError: [Errno 2] Unable to load configuration file (No such file or directory): '/etc/config.json'

Two questions:
In the readme it is not written anywhere where and how to create a config.
Why is the config created in /etc folder and not in the local folder?

Custom option for making personalized URLs

Allow users to create custom short url of their choice, instead of randomly generated strings. A URL like: localhost/myportfolio is descriptive and is likely to generate more clicks. (This issue is not regarding front end, that's a separate one)

There's error when checking the custom_end input in backend.

  • There's error when checking the custom_end input in backend.

  • This code should give error if custom_end contains characters which are not allowed.

#these two lines are causing error in backend
#purpose of these lines is to check input in custom_end
if((custom_end is not None) and (not re.search(regex, custom_end))):
    return "custom_url contains invalid characters", 400
#end input validation
  • line 61 onwards in "routes.py" file
  • But if custom_end is empty then also it gives error
  • I initially thought (custom_end is not None) will be enough

Account for managing links

Allow users to sign up and generate multiple URLs and then track them all at a single dashboard. We can use external partners like github, google etc. for OAuth2 authentication.

(Please note that this is a broad feature and will be divided into small parts)

Update readme

Update readme with new screenshot of the add link page after generating a URL. This will include a newly added "Shorten new URL" button, which is missing from the current image.

URL length validation

  1. We do not validate the length of original url and custom url, users can send urls of arbitrary character length.
  2. We dont validate custom end request, it can be even spaces.
  3. Sqlite doesn't enforce length of strings , so no errors are reported until now but others do, so it would break when we shift db.
  4. We should discuss on fixing length of custom end, how large can be support

Deployment of website

Currently the test website hosted locally and is only accessible on local system. Make changes to code such that it can be hosted on external service like AWS / Azure / heroku / pythonanywhere etc.

Stats dashboard for individual links

Needs to show stats for each link to their individual links.
Let's say generated url is: localhost/generatedurl
Then if someone types:
localhost/generatedurl-stats or localhost/generatedurl/stats
It should show some basic stats like how many clicks on this link. It can be further enhanced using external analytics tools such as google analytics to find geographical region, device type and it's OS, time of day etc.
See an example here

(This is a broad feature and will be divided into small parts)

UI development

This is a thread for suggesting changes to User Interface.

Using bootstrap is a good way of starting it.

Database improvement

Currently uses sqlite. But if it has to scale up, what DBs should be preferred and why?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.