Giter VIP home page Giter VIP logo

drunkleen / link-shrink-w-ip-grabber Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 1.0 25.47 MB

This is a simple API built using FastAPI that allows users to login with JWT tokens and create short links. It also logs each request made to the short link endpoint, storing the visitor's IP address, user agent, and timestamp in a PostgreSQL database.

License: MIT License

Python 100.00%
grabify ipgrabber fastapi jwt-authentication

link-shrink-w-ip-grabber's Introduction

Link-Shrink with IP Grabber

This is a simple API built using FastAPI that allows users to login with JWT tokens and create short links. It also logs each request made to the short link endpoint, storing the visitor's IP address, user agent, and timestamp in a PostgreSQL database.

Requirements

To run this project, you'll need the following software installed on your machine:

Python 3.7 or higher
PostgreSQL 12 or higher

You'll also need to install the required Python packages using pip:

pip install -r requirements.txt

Configuration

Before you can run the application, you'll need to create a .env file in the project root directory with the following environment variables for example:

DATABASE_HOSTNAME=localhost
DATABASE_PORT=5432
DATABASE_NAME=IP-Grabber
DATABASE_USERNAME=postgres
DATABASE_PASSWORD=123
SECRET_KEY=jHj8O4oSAfi5jkaSDFG41Rg33NOawBHHIoWp4cgqWN
ALGORITHM=HS256
ACCESS_TOKEN_MINUTES=60

Usage

To start the web server, run the main.py file or run the following command:

uvicorn main:app --reload

To view the API documentation visit localhost:8000/redoc or localhost:8000/docs.

License

This project is licensed under the MIT License. See the LICENSE file for details.

link-shrink-w-ip-grabber's People

Contributors

drunkleen avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Forkers

varganae

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.