This is a url shortening application. The API receives a url and returns a shortened version of the url, similar to Bit.ly and Google URL Shortener.
The building blocks are:
- Django - The web framework used.
- Django REST Framework - The framework used to build the API.
- Vue JS - The framework used to build the front-end application.
- VueX - The state management pattern + library for Vue.js.
- Bootstrap + Vue - The front-end CSS library for Vue JS.
- Redis - The in-memory data structure store, used as the database.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
You need the following installed in your machine to be able to run the project:
- Python 3.5
- Node 8+
- Redis
- Pipenv
- Docker (Optional)
These are instructions for setting up Diary API in development environment.
- check out project code:
$ git clone https://github.com/ro6ley/midget.git midget_project
- setup the environment and install requirements:
$ cd midget_project
$ pipenv install
$ cd client && npm install && cd ..
- create database tables:
$ ./midget/manage.py makemigrations
$ ./midget/manage.py migrate
- start the redis server and run development server:
$ redis-server /usr/local/etc/redis.conf
$ ./midget/manage.py runserver
- start the client:
$ cd client && npm run serve
The front-end should now be running at http://localhost:8080/
.
The API will be running on http://localhost:8000/
Once up and running the API documentation is available at: http://localhost:8000/docs
The endpoints in summary:
Endpoint | Functionality |
---|---|
POST /api/links/ | Create a shortened URL |
GET /<slug:link> | Access the shortened URL |
GET /all | Get a list of all shortened URLs |
DELETE /<slug:link> | Delete the shortened URL |
To run the tests:
$ ./midget/manage.py test --settings=settings.testing
- Robley Gori - Initial work
See also the list of contributors who participated in this project.
This project is licensed under the GNU General Public License v3.0.