This is a simple URL shortener project, made for learning purposes.
It is similar to Bit.ly or TinyURL, and allows users to input a long URL and receive a shortened version of it. This makes sharing links easier and helps in tracking and managing URLs.
View the live application here 👈.
- Shorten URLs: Convert long URLs into manageable short links.
- Easy to use: Simple interface for creating and managing URLs.
- PWA: Easily install the application on Windows, macOS, Android, and iOS. Click here to see how
- Backend: Go, Gin
- Database: PostgreSQL
- Frontend: Next.js, TypeScript, SCSS.modules
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
What things you need to install the software and how to install them:
For the server:
- Go: Download and install Go
- Air: Install Air if you want to use live reload
- PostgreSQL: Download and install PostgreSQL
For the client:
- Node.js: Download and install Node.js
- npm: Download and install npm
A step by step series of examples that tell you how to get a development env running:
-
Clone the repository:
git clone github.com/nitzanpap/url-shortener
-
Change into the project directory:
cd url-shortener
- Note: If you are using VS Code, you can use the
Go
extension to install the necessary tools and dependencies.
-
Change into the server directory:
cd server
-
Create a
.env
file in the server directory:touch .env
Make sure to populate the
.env
file according to the.env.example
file. -
Run the server via make:
-
For development, run with live reload:
make run/live
-
Or build and run the server:
-
Manually:
make build && make run
-
Via Docker:
docker compose up
-
-
-
Change into the client directory:
cd client
-
Create a
.env.local
file in the client directory:touch .env.local
Make sure to populate the
.env.local
file according to the.env.example
file. -
Install the dependencies:
npm install
-
Run the development server:
-
For development:
npm run dev
-
For production:
npm run build && npm start
-
If you are using VS Code, you can use the launch.json
configurations to debug the server and client code.
I am deploying the server to render.com and the client to Vercel. You can deploy the server and client to any platform of your choice.