A production-grade URL redirection system built with Next.js 15, TypeScript, and Tailwind CSS.
git clone https://github.com/0x3f-lancers/url-redirector.git
cd url-redirector
npm install
mkdir -p src/data
echo '{"redirects":[]}' > src/data/redirects.json
npm run dev
Visit http://localhost:3000 to see the dashboard.
URL-Redirector
āāā README.md
āāā app
āĀ Ā āāā [slug]
āĀ Ā āĀ Ā āāā route.ts
āĀ Ā āāā api
āĀ Ā āĀ Ā āāā redirects
āĀ Ā āĀ Ā āāā [slug]
āĀ Ā āĀ Ā āĀ Ā āāā route.ts
āĀ Ā āĀ Ā āāā route.ts
āĀ Ā āāā components
āĀ Ā āĀ Ā āāā redirects-table.tsx
āĀ Ā āĀ Ā āāā search-input.tsx
āĀ Ā āāā data
āĀ Ā āĀ Ā āāā redirects.json
āĀ Ā āāā error.tsx
āĀ Ā āāā favicon.ico
āĀ Ā āāā globals.css
āĀ Ā āāā layout.tsx
āĀ Ā āāā lib
āĀ Ā āĀ Ā āāā redirect.ts
āĀ Ā āĀ Ā āāā validations
āĀ Ā āĀ Ā āāā redirect.ts
āĀ Ā āāā middleware.ts
āĀ Ā āāā not-found.tsx
āĀ Ā āāā page.tsx
āĀ Ā āāā types
āĀ Ā āāā redirects.ts
āāā next-env.d.ts
āāā next.config.ts
āāā package-lock.json
āāā package.json
āāā postcss.config.mjs
āāā tailwind.config.ts
āāā tsconfig.json
Visit the dashboard at http://localhost:3000 to:
curl -X POST http://localhost:3000/api/redirects \
-H "Content-Type: application/json" \
-d '{
"slug": "example",
"url": "https://example.com",
"title": "Example Website"
}'
curl http://localhost:3000/api/redirects
curl -X PATCH http://localhost:3000/api/redirects/example \
-H "Content-Type: application/json" \
-d '{
"url": "https://new-example.com",
"title": "Updated Example"
}'
curl -X DELETE http://localhost:3000/api/redirects/example
Once created, redirects are accessible at:
http://localhost:3000/{slug}
For example:
http://localhost:3000/github
redirects to GitHubhttp://localhost:3000/google
redirects to GoogleThe application includes several security features:
No environment variables are required for local development.
npm run type-check
npm run lint
npm run build
npm start
git checkout -b feature/amazing-feature
git commit -m 'Add amazing feature'
git push origin feature/amazing-feature
This project is licensed under the MIT License - see the LICENSE file for details.
Created by Ad-h0c & Lancers Technology