- 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
- POST
/api/auth/login
- Authenticate user.
- Request Body:
{ "email": "[email protected]", "password": "pikacu123" }
- POST
/api/auth/register
- Register a new user.
- Request Body:
{ "email": "[email protected]", "password": "pikacu123" }
- 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).
- 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
/api/auth/urls/
- Delete multiple URLs at once.
- Request Body:
{ "urls_ids": ["url_id1", "url_id2"] }
- DELETE
/api/auth/urls/:urlId
- Delete a specific 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
/api/auth/urls/stats/:urlId
- Get statistics of a specific URL.
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.
- Dockerize the application
- Improve configuration management
- Add tests
- Add UI
- Redis integration for caching