Shortify is a modern, fullโstack URL shortening service built with Go/Java (backend), MongoDB (data store), Clerk (authentication), and React.js (frontend). It's designed for rapid development and production readiness with clean APIs and a polished UI.
-
๐ Frontend (Vercel)
๐ https://myshortify.vercel.app -
โ๏ธ Backend (Render)
๐ https://shortwave.onrender.com
- Backend: Go / Java (Spring Boot)
- Database: MongoDB
- Auth: Clerk
- Frontend: React.js
- Shorten URLs into vanity links (username + slug)
- Fast redirect service for shortened links
- User management and authentication via Clerk
- MongoDB for reliable storage of users and links
- React.js frontend with responsive UI and Clerk integration
- Dual backend support (Go and Java) with identical APIs
Server/Go/โ Go backend, API handlers, app logic and MongoDB integrationServer/Java/โ Java Spring Boot backend (API-compatible with Go)Client/โ React.js frontend, components, and Clerk auth routesREADME.mdโ This file
Prerequisites:
- Go 1.20+ installed (for Go backend)
- Java 17+ and Maven 3.6+ installed (for Java backend)
- MongoDB accessible (local or hosted)
- Clerk account and API keys (for auth)
- Clone the repo
mkdir Shortify
cd Shortify
git clone https://github.com/<your-github-username>/Shortify.git .- Configure application settings (local & production)
Before running the app locally or deploying, make sure your runtime configuration is in place:
-
Local development: copy
Server/Go/.env.exampletoServer/Go/.env(orServer/Java/.env.exampletoServer/Java/.env) andClient/.env.exampletoClient/.env, then open those files and fill in values specific to your environment. Keep sensitive values out of version control. -
Production: configure required settings and secrets in your hosting platform's environment manager (Vercel, Render, etc.). Ensure callback/webhook URLs (for Clerk and other services) point to your deployed URLs.
Use the example files in Server/Go/.env.example, Server/Java/.env.example and Client/.env.example as the authoritative list of keys to provide; the README avoids enumerating individual variable names to keep configuration details centralized in the example files.
- Run the backend (choose one)
Option A: Go Backend
cd Server/Go
go mod tidy
go build main.go
./mainOption B: Java Backend
cd Server/Java
mvn clean package -DskipTests
java -jar target/shortify-1.0.0.jarOr using Maven directly:
cd Server/Java
mvn spring-boot:run- Frontend: install and run
cd Client
npm install
npm run devTo build for production:
npm run buildThe frontend typically runs on http://localhost:3000 and the backend on http://localhost:3001 (configurable).
- Redirect (public):
GET /{username}/{slug}โ redirects to the destination URL of the link - API base:
/api/v1- User webhook:
POST /api/v1/user/webhook(Clerk) - Update username:
PUT /api/v1/user/username - Links CRUD: under
/api/v1/link
- User webhook:
Note: Both Go and Java backends expose identical API endpoints and response formats. No frontend changes required when switching backends.
- Use
curl -v http://localhost:3001/username/slugto test redirects. - Run
go build main.goto check for backend compile errors. - Ensure Clerk webhooks point to the server's
/api/v1/user/webhookduring integration.
Below are quick deployment flows for the frontend (Vercel) and backend (Render). These are minimal steps โ adapt them for your environment and secrets manager.
-
Vercel (Frontend)
- Create a Vercel project and connect it to this repository.
- Set the Project Root to
Client(or import as a monorepo and point the app toClient). - Build command:
npm run build - Output directory:
dist - Configure required settings and secrets in Vercel (Dashboard โ Settings โ Environment Variables).
- Deploy โ Vercel will run builds on every push.
-
Render (Backend - Go)
- Create a new Web Service on Render and connect it to the repository.
- Set the root directory to
Server/Go. - Environment & Build:
- Build command:
go build main.go - Start command:
./main
- Build command:
- Configure required settings and secrets in Render (Service settings โ Environment).
- Deploy โ Render will build and start the service; check logs for startup errors.
-
Render (Backend - Java)
- Create a new Web Service on Render and connect it to the repository.
- Set the root directory to
Server/Java. - Environment & Build:
- Build command:
mvn clean package -DskipTests - Start command:
java -jar target/shortify-1.0.0.jar
- Build command:
- Configure required settings and secrets in Render (Service settings โ Environment).
- Deploy โ Render will build and start the service; check logs for startup errors.
Tips:
- Use Vercel for the React.js frontend and Render (or similar) for the Go/Java backend.
- Keep production secrets in the platform's environment manager โ never commit them.
- If using webhooks (Clerk), configure callback URLs in Clerk to point to your deployed
POST /api/v1/user/webhookendpoint.
Contributions welcome โ open issues or submit PRs. Follow these steps:
- Fork the repo
- Create a feature branch
- Make changes and test locally:
- Go backend:
cd Server/Go && go build main.go - Java backend:
cd Server/Java && mvn compile - Frontend:
cd Client && npm run dev
- Go backend:
- Open a PR with a clear description
This project uses the license in the repository. Feel free to adapt as needed.
Enjoy Shortify โ deployment and CI-CD guidance have been added above. Open an issue or PR if you want badges, examples, or more detailed deployment templates.