Skip to content

shadowpint/shotput

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Shotput -Url Shortener API

Url shortener API with Django and django rest framework.

Project consists to allow a user to transform a long web url into a pattern-consistent (encoded) small url easy to share and remember.

At the same time the user is allowed to transform back (decode) the small url into the original url

It is partly tested as only and was developed as showcase only.

How Url Shortener API Works:



Index:

  • Installation

    1. Installing Django API App
  • Usage:

    1. Available Endpoints
  • What's Next:

    1. thoughts on improving it.
      • Testing
      • UI
      • Database



Installation:

1.Installing Django API App

  1. Clone repository and go inside the repository folder "url-shortener-api"
git clone https://github.com/shadowpint/shotput.git
  1. Create you virtualenv and install the packages
pip install -r requirements.txt
  1. Initialize database and create the database mapping used for persistance in the url shortener API.
python manage.py makemigrations
  1. Apply the database mapping from the app to the database; migrate the database.
python manage.py migrate
  1. Run the application.
python manage.py runserver

USAGE

1. Endpoint List

URI Example: http://localhost:8000/shorten-url/

Available Methods URI Example URL
Project Endpoints
1. POST shorten-url/ http://localhost:8000/shorten-url
2. GET /<short_id> http://localhost:8000/<short_id>

Access and Interact with a GUI app (Postman)

To interact and start using the API, you will need a tool send HTTP requests to your api. I have develop a list of request to test and interact with the api with Postman. You will need to download the Postman Desktop app or the Web Browser plug in for Chrome. Click on the button below to guide you to download the app with the list of request I have developed to test the api fast.

Run in Postman


WHATS NEXT

1. Thoughts on improving it.

Testing
  • integrate functional testing into the django app
  • add personalized assert messages and setup error message separated structure
API
  • set up error handling and eliminate chunks of ugly try:
  • set up rest full service (if required (del, list, ...))
  • do short url should expire set up?
  • refactor
Database
  • set up a mysql db
  • set up and split stats and ShortUrl models
DevOps
  • set up automated testing pipeline

Information:

Technology Stack
Python back-end Back-End
Django django Web Framework
Django Rest Extension api-extension API Django Extension
SQLite database Database
Postman http request app HTTP requests app



About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published