🔗 URL Shorty

Fast, secure, and human-friendly URL shortening API

🚀 Features

📚 API Overview

🛠 Server & Health

GET /health/

Description: Check server and DB health

👤 User Management

POST /usr/register

Description: Register a new user

Request Body Example:

{
  "username": "ExampleUser",
  "password": "ExamplePassword"
}
POST /usr/login

Description: Obtain access and refresh tokens

{
  "username": "ExampleUser",
  "password": "ExamplePassword"
}
GET /usr/me

Description: Get logged-in user info

Headers:

Authorization: Bearer <access_token>
POST /usr/refresh

Description: Refresh access token

{
  "refresh_token": "<refresh_token>"
}
POST /usr/logout

Description: Logout and revoke refresh token

{
  "refresh_token": "<refresh_token>"
}
DELETE /usr/delete

Description: Delete user and URLs

{
  "username": "ExampleUser",
  "password": "ExamplePassword"
}

🔗 URL Management

GET /url/list/

Description: Retrieve list of shortened URLs

POST /url/shorten/

Description: Create a short URL

{
  "original_url": "https://example.com",
  "short_code": "mycustomcode"
}
GET /url/{shortCode}

Description: Retrieve original URL

PATCH /url/

Description: Update short URL

{
  "short_code": "mycustomcode",
  "updated_url": "https://new-destination.com"
}
DELETE /url/

Description: Delete shortened URL

{
  "short_code": "mycustomcode"
}

🖥️ CLI Frontend

Use the frontend_cli to interact with the API via terminal. Learn more here.