A URL shortener application built with Go (backend), MongoDB (database), and Next.js (frontend).
- Go 1.16 or higher
- Node.js 14 or higher
- MongoDB
- npm or yarn
-
Install all dependencies:
npm run install:all
-
Start both frontend and backend services:
npm start
This will start:
- Frontend on
http://localhost:3000 - Backend on
http://localhost:8080
-
Navigate to the backend directory:
cd backend -
Install dependencies:
go mod tidy
-
Start the backend server:
go run main.go
The backend server will run on http://localhost:8080.
-
Navigate to the frontend directory:
cd frontend -
Install dependencies:
npm install
-
Start the development server:
npm run dev
The frontend will run on http://localhost:3000.
- Shorten long URLs
- Redirect to original URLs
- Modern and responsive UI
- Error handling
- Loading states
POST /api/url- Create a new shortened URLGET /api/url/{shortURL}- Get the original URL
.
├── backend/
│ └── main.go
├── frontend/
│ ├── src/
│ │ └── app/
│ │ └── page.tsx
│ └── package.json
├── package.json
└── README.md
