Skip to content

Commit

Permalink
Merge pull request #9 from vivekashok1221/update-readme
Browse files Browse the repository at this point in the history
Update README.md
  • Loading branch information
vivekashok1221 authored Jul 15, 2023
2 parents 209776e + e937ea2 commit 8d7e0b0
Show file tree
Hide file tree
Showing 2 changed files with 87 additions and 1 deletion.
86 changes: 86 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1 +1,87 @@
![GitHub release](https://img.shields.io/github/v/release/vivekashok1221/lnkshrt?label=latest)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit)](https://github.com/pre-commit/pre-commit)
[![API documentation](https://img.shields.io/badge/API-documentation-green)](https://l.vivekashok.me)


# lnkshrt

lnkshrt is a URL shortener API built with FastAPI. It allows you to generate shortened URLs which redirect you to the original URLs.

The official instance of lnkshrt is hosted at [l.vivekashok.me](https://l.vivekashok.me). However, if you prefer, you can also run your own instance by following the steps in the ["Getting Started"](#getting-started) section.

The lnkshrt API is built using FastAPI, PostgreSQL, and SQLAlchemy.

## Features

- Shorten long URLs to compact and easy-to-share shortened URLs.
- Customizable URLs with the option to specify a custom path for the shortened URL.
- Token-based authentication for secure API access.
- Delete shortened URLs when they are no longer needed.


> `lnkshrt-cli` is a command-line app with which you can easily generate shortened URLs, authenticate with your account, delete links, and perform other actions from the command-line. For detailed usage instructions and installation guide, please refer to the [lnkshrt-cli repository](https://github.com/vivekashok1221/lnkshrt-cli).

## Getting Started
To run the lnkshrt API yourself:-

1. Clone the repository:
```shell
git clone https://github.com/vivekashok1221/lnkshrt.git
```

2. Navigate to the project directory:
```shell
cd lnkshrt
```

3. Assuming you have Docker and Docker Compose installed on your system, you can simply run:
```shell
docker compose up
```
Once the containers are up and running, you can access the lnkshrt API at http://0.0.0.0:8000.


## API Documentation

You can access the API documentation online at [l.vivekashok.me](https://l.vivekashok.me) (or locally at http://0.0.0.0:8000/docs provided the server is running).


## Development

To set up the development environment for the lnkshrt API, follow the steps outlined in the ["Getting Started"](#getting-started) section above.

- ### Set up poetry env

Assuming you have [poetry installed](https://python-poetry.org/docs/#installation), install the dependencies by running:
```shell
poetry install
```

To activate the poetry venv:
```shell
poetry shell
```

- ### Set Up Pre-commit Hooks
```shell
poetry run task precommit
```
`pre-commit` helps ensure code quality and consistency by automatically running various checks and formatting tools on your code before each commit.

- ### Linting

To manually run the linting checks:
```shell
poetry run task lint
```

- ### Generate Database Migrations
```shell
poetry run alembic revision --autogenerate -m "<MESSAGE>"
```

## License

lnkshrt is released under the MIT License.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[tool.poetry]
name = "lnkshrt"
version = "0.1.0"
description = "URL shortening service."
description = "URL shortener API built with FastAPI."
authors = ["vivekashok1221 <[email protected]>"]
license = "MIT"
readme = "README.md"
Expand Down

0 comments on commit 8d7e0b0

Please sign in to comment.