Tue Oct 13 2026


Kooza Collinz Portfolio
Next.js
TypeScript
Go
Gin
GORM
PostgreSQL
Redis
Docker
A full-stack developer portfolio with a Next.js frontend and a custom Go (Gin) backend. It ships with secure authentication, OAuth social login, a contact inbox with admin replies, audit logging, an admin dashboard and auto-generated API docs, all deployed to a self-hosted VPS with Docker.
What is the Kooza Collinz Portfolio?

The Kooza Collinz Portfolio is more than a static showcase. It is a full-stack product with a Next.js frontend and a purpose-built Go backend. The public site presents Kooza's work and takes enquiries, while a protected admin dashboard lets him manage users, read and reply to contact messages, and review an audit trail of everything that happens in the system.
Core Philosophy: A portfolio should be as well engineered as the work it presents.
The Problem
Most developer portfolios are static pages with a contact form wired to a third-party service. That leaves a few gaps:
- No ownership of data: Messages live in someone else's inbox or dashboard
- No real auth: Nothing to protect an admin area beyond a hardcoded password
- No visibility: No record of who did what, and when
- No replies in context: Answering a visitor means leaving the site and opening an email client
- No proof of backend skill: The portfolio itself says nothing about how the owner builds servers
The Solution
1. A Dedicated Go Backend
Why Go?
Go gives a small, fast, strongly typed API with simple deployment: one compiled binary, predictable performance and very little runtime overhead. It also demonstrates backend range beyond the usual JavaScript stack.
Key Benefits:
- Fast cold starts and low memory use
- Strict typing and explicit error handling
- Clean layering: controllers, DTOs, models, middleware and packages
- Easy containerization with Docker
2. Secure Authentication
Authentication is built from first principles rather than bolted on:
- JWT sessions signed with a server secret and a 30-day expiry
- bcrypt password hashing
- Email verification using a hash-only token pattern: the raw token is emailed to the user and only its SHA-256 hash is stored, alongside an expiry timestamp
- Forgot and reset password flows
- OAuth social login with Google, GitHub, LinkedIn, Spotify and Discord, protected by an HMAC-signed, stateless CSRF state
3. A Contact Inbox That Works
Visitors send a message through the public form. The admin reads it in the dashboard and replies from the same screen.
- Replies are emailed to the sender through a template system
- A message is marked as replied only after the email actually sends
- The reply text and timestamp are stored with the message
Key Features
1. Authentication and Sessions
A complete account system:
- Sign up, login and session validation
- Email verification with resend support
- Password reset by email
- Social login with five providers
- JWT kept in an httpOnly session cookie on the Next.js server, never exposed to client-side JavaScript
2. Contact Management
Everything about incoming enquiries:
- Public create endpoint protected by IP rate limiting (5 per hour)
- Admin-only list, update, delete and reply endpoints
- Redis caching of the message list (60-second TTL), invalidated on any change
- Reply history stored with each message
3. Audit Logging
A built-in trail of important actions:
- Records the action, model, record ID, actor and changes
- Covers CREATE, UPDATE, DELETE, LOGIN, REPLY and PASSWORD_RESET events
- Paginated, admin-only
GET /audit-logsendpoint - Best-effort, non-transactional writes so logging never blocks a request
4. Admin Dashboard
A protected area for managing the site:
- User profile page with editable name, bio and other profile fields
- Avatar upload through a dropzone
- Backed by
GET /users/:idandPATCH /users/:idon the Go side
5. Interactive API Documentation
The backend documents itself:
- Scalar API reference served at
/docs - OpenAPI specification generated from the backend
- A faster way for anyone, including future-me, to explore the endpoints
How It Works
Technical Architecture
Frontend:
- Next.js 16 with Turbopack
- TypeScript for type safety
- TailwindCSS for styling
react-hook-formwith Zod schemas for validated formssonnerfor toast notifications- Server actions for every call to the backend
Backend:
- Go with the Gin web framework
- GORM for database access
- PostgreSQL for persistent data
- Redis for caching and rate limiting
- JWT (
golang-jwt/jwt/v5) and bcrypt for auth - A mail package with templates for verification and replies
Infrastructure:
- Docker Compose for local and production environments
- Self-hosted VPS deployment with Dokploy
- Hot reload in development with
air - Mailhog for catching emails locally
Request Flow
- User Submits a Form → A Next.js server action validates the input
- Server Action Calls the Go API → The JWT is attached from the httpOnly cookie
- Gin Middleware Runs → Authentication, role checks and rate limiting
- Controller Handles the Request → Reads or writes PostgreSQL via GORM, with Redis where it helps
- Standard Response Envelope →
{ success, data, message, error }returned to the frontend - Frontend Maps the Payload → Snake_case backend fields become camelCase types for the UI
Design Decisions
Standardized Response Envelope
Every endpoint returns the same shape, with SuccessResponse and ErrorResponse DTOs on the Go side and a generic ApiEnvelope<T> type on the frontend. The shared envelope types live in their own types/api.ts, so new domains such as contact messages reuse them without duplication.
Validation Stays in the Backend
Session and user validation is handled by the Go backend through /users/validate instead of being moved into Next.js. This keeps a single source of truth for auth and performs better.
Tokens Never Touch the Browser
The frontend talks to the backend only through server actions. The JWT is stored as an httpOnly cookie and added to requests on the server, so client-side scripts never see it.
Numeric IDs
Users and contact messages use auto-increment uint primary keys, keeping the data model simple and consistent across the whole schema.
Technical Stack
Frontend Technologies
- Framework: Next.js 16
- Language: TypeScript
- Styling: TailwindCSS
- Forms: react-hook-form, Zod
- Feedback: sonner, ldrs loaders
- Runtime and Package Manager: Bun
Backend and Infrastructure
- Language: Go
- Framework: Gin
- ORM: GORM
- Database: PostgreSQL
- Cache and Rate Limiting: Redis
- Auth: JWT, bcrypt, OAuth 2.0
- API Docs: Scalar
- Deployment: Docker Compose, Dokploy on a VPS
Development Tools
- Hot Reload: air
- Local Email: Mailhog
- Database Inspection: GORM Studio (development only)
- Version Control: Git, GitHub
Lessons Learned
- Isolate internal services in production. A previous deploy resolved another project's Redis because both used the same service name. Giving each internal service a unique network alias fixes this.
- Type changes ripple. Switching IDs to
uintaffects JWT handling, sincejwt.MapClaimsdecodes numeric claims asfloat64. Auth middleware needs to account for it. - Store less, expose less. Hash-only verification tokens and httpOnly cookies reduce what an attacker could ever obtain.
Future Enhancements
-
Blog Engine
- MDX posts managed from the admin dashboard
- Draft and publish workflow
-
Analytics
- Privacy-friendly visit and contact statistics
- Dashboard charts
-
Role Management
- Fine-grained permissions beyond admin and user
- Audit log filters and export
-
Testing and CI
- Unit and integration tests for controllers
- Automated build and deploy pipeline
Project Origin
Created By
Watuulo Richard (Full-Stack Developer)
Built for Kooza Collinz as a portfolio that doubles as a working example of clean full-stack architecture: a typed Next.js frontend, a Go API, and infrastructure that is fully under the owner's control.
Mission Statement
"Your portfolio is your first project. Build it like one."
Get Involved
Open Source
The backend is open source and welcomes contributions:
Ways to Contribute:
- Report bugs or issues
- Suggest new features
- Improve documentation
- Review the auth and security flows
- Add tests
Visit the GitHub repository to get started.
Conclusion
The Kooza Collinz Portfolio shows how a personal site can be a real system: authenticated, observable, documented and deployable. A Next.js frontend delivers the experience, and a Go backend handles the data, the security and the logic behind it.
Built with Next.js and Go.
Visit collinzdev.lubegajovan.org to see it live.
#NextJS #Golang #FullStack #Portfolio #WebDevelopment