command
module
Version:
v0.0.0-...-1d517b5
Opens a new window with list of versions in this module.
Published: Apr 8, 2024
License: MIT
Opens a new window with license information.
Imports: 5
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
¶
⚠️ This project is currently under development. However, the current version is functional.
URL SHORTENER - SPECS
- A sign up page
- A sign in page
- Create a new short URL page
- A short URL should have a URL that it points to
- A name
- An ID
- A flag that keeps track whether the short URL is active and accessible - if this is set to false by the user it the short url should give 404
- List URLS page
- Users should be able to delete individual lists here
- Users should be able to bulk delete lists here
- Users should be able to order by creation date, update date, and clicks
- A detail page
- Users should be able to delete and edit the URL - AKA where it points to, if it is active, change the name etc. but the id should be read only
- It should contain stats on the URL
- How many times it has been clicked
- IP addresses of the clicks
- Device info of the clicks
- Mobile vs Desktop
HOW TO USE API
Auth API
Login
Register
URL Management
Get URL Details
- GET
/api/auth/urls/:urlId
- Retrieve details of a specific URL.
- GET
/api/auth/urls
- Retrieve URLs with pagination.
- Query Parameters:
limit
: Number of URLs per page (default: 20).
page
: Page number (default: 1).
Create URL
- POST
/api/auth/urls/
- Create a new shortened URL.
- Request Body:
{
"name": "example",
"long": "https://example.com",
"alias": "example",
"expires_at": "2022-01-01T00:00:00Z"
}
Delete URLs (Bulk)
Delete URL
- DELETE
/api/auth/urls/:urlId
Update URL
- PATCH
/api/auth/urls/:urlId
- Update details of a specific URL.
- Request Body:
{
"active": true,
"alias": "example",
"name": "example",
"long": "https://example.com",
"expires_at": "2022-01-01T00:00:00Z"
}
Get URL Stats
- GET
/api/auth/urls/stats/:urlId
- Get statistics of a specific URL.
Environment Variables
This application relies on the following environment variables for proper functioning:
- APP_ADDRESS: Specifies the address where the application is accessible.
- DATABASE_URL: Specifies the URL for the database connection. (Postgres)
- AUTH_SECRET: Specifies the secret key used for authentication and session management.
- REDIS_URL: Specifies the URL for the Redis database connection.
Please ensure that these environment variables are correctly configured for the successful operation of the application.
TODO
- Dockerize the application
- Improve configuration management
- Add tests
- Add UI
- Redis integration for caching
Documentation
¶
There is no documentation for this package.
Source Files
¶
Directories
¶
api
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Click to show internal directories.
Click to hide internal directories.