Shortify is a modern, full‑stack URL shortening service built with Go (backend), MongoDB (data store), Clerk (authentication), and Next.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
- Database: MongoDB
- Auth: Clerk
- Frontend: Next.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
- Next.js frontend with responsive UI and Clerk integration
Server/— Go backend, API handlers, app logic and MongoDB integrationClient/— Next.js frontend, components, and Clerk auth routesREADME.md— This file
Prerequisites:
- Go 1.20+ installed
- 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/.env.exampletoServer/.envandClient/.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/.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
cd Server
go mod tidy
go build main.go
./main- Frontend: install and run
cd Client
npm install
npm run build
npm run devThe 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:
- 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: leave default (Next.js handled by Vercel).
- Configure required settings and secrets in Vercel (Dashboard → Settings → Environment Variables).
- Deploy — Vercel will run builds on every push.
-
Render (Backend)
- Create a new Web Service on Render and connect it to the repository.
- Set the root directory to
Server. - Environment & Build:
- Build command:
go build main.go - Start command:
./main
- 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 Next.js frontend (serverless/edge‑optimized) and Render (or similar) for the Go 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 run
go buildandnpm run devlocally - 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.