DevLink is a small profile hub for developers: links, skills, and a clean public profile page.
- Auth
- Email + password (credentials)
- Optional OAuth (GitHub, Google) if env vars are set
- Dashboard
- Edit username, display name, bio, skills, avatar URL
- Add/remove links
- View basic analytics (views, clicks)
- Public profile
GET /u/:username- Tracked links via
GET /l/:linkId(click count + redirect)
- Next.js (App Router)
- NextAuth
- Prisma + Postgres
- Tailwind CSS
npm installdocker compose up -dThis repo maps the container's 5432 to host 5433 to avoid conflicts with an existing local Postgres.
Create .env (or copy from .env.example) and fill in at least:
DATABASE_URLNEXTAUTH_SECRET
Optional (enables OAuth buttons):
GITHUB_CLIENT_ID,GITHUB_CLIENT_SECRETGOOGLE_CLIENT_ID,GOOGLE_CLIENT_SECRET
npx prisma migrate devOptional seed data:
npm run db:seedSeeded credentials:
- Email:
demo@devlink.local - Password:
password123
npm run devOpen:
http://localhost:3000- Create an account at
http://localhost:3000/login
GET /dashboard(authenticated)GET /u/:username(public)GET /l/:linkId(public tracked redirect)
- Link click tracking is done via a server redirect route (
/l/:linkId) so it works without client JS. - OAuth is optional to keep local setup simple.
src/appcontains all Next.js routes (pages, API, server actions).src/componentscontains reusable UI components.src/libcontains helpers (auth, Prisma, rate limit, validators).prisma/schema.prismadefines the database models.
- Use feature branches and pull requests.
- Write tests for new features or bug fixes.
- Run
npm run lintandnpm testbefore submitting. - Document any new endpoints or major changes in README.
- For issues or questions, open a GitHub issue.
- Sessions use NextAuth with JWT.
- Passwords use bcrypt hashes.
- Public routes include
/u/:username,/l/:linkId, and discover endpoints. - Rate limiting uses an in-memory store. It only limits per server instance.
- Login
callbackUrlonly accepts relative paths.
- Hosting targets Vercel.
- Required env vars are
DATABASE_URLandNEXTAUTH_SECRET. - Optional env vars enable OAuth:
GITHUB_CLIENT_ID,GITHUB_CLIENT_SECRET,GOOGLE_CLIENT_ID,GOOGLE_CLIENT_SECRET. - Use a managed Postgres database in production.