Short url application done with React, Zustand, React Query, Typescript and Tailwind running with Golang api using PostgreSQL database and OAuth authentication.
In testing, unit tests with Vitest, React Testing Library and Playwright for end-to-end tests.
This short URL application simplifies the process of creating and managing short URLs. Users input their desired URLs, and the app generates a concise, user-friendly short URL based on a predefined format. The shortened URL is then displayed to the user, enabling efficient storage and easy retrieval.
A key feature of the app is the ability for users to personalize their experience by managing titles associated with each URL. This customization ensures a clear and organized overview of the user's stored URLs within their profile.
Moreover, the application seamlessly handles redirections. When a user accesses a short URL, the app queries the database to retrieve the original URL associated with it, effortlessly redirecting users to the intended destination. This robust redirection mechanism ensures a smooth and expected user experience.
A simple layout of the system design:
To run the app locally, follow the steps below:
Create a .env
file in the backend
directory using the provided example (backend/.env.example
). Adjust the values according to your local environment.
PORT=xxx
HOST=xxx
DB_URL=xxx
SECRET=xxx
// For OAuth tokens
GOOGLE_CLIENT_ID=xxx
GOOGLE_CLIENT_SECRET=xxx
GITHUB_CLIENT_ID=xxx
GITHUB_CLIENT_SECRET=xxx
Run the following command to install the necessary dependencies:
make install_app
Start the frontend and backend servers using the following commands:
make start_f
make start_b
Navigate to the api_spec directory and open the API documentation using:
cd api_spec && make serve