PROJECT / 2024
Albyrådet
Website for Albyrådet, a youth organization in Alby, Botkyrka. Next.js 15 frontend whose API routes send membership applications and contact messages by email through Strato SMTP, with an older Express and MongoDB backend kept in the repo.
- stack
- TypeScript · Next.js 15 · React 18 · Express.js · MongoDB · Mongoose · Nodemailer · Tailwind CSS · shadcn/ui · Framer Motion
How it works
forms
membership and contactAPI
rate-limits and sanitizesMongoDB
applicationsemail
sent over SMTP

01 / Overview
Full-stack site for a Swedish youth organization focused on community safety and youth engagement in Alby, Botkyrka. The frontend is a Next.js 15 App Router app with ten routes — landing page with a full-screen video hero, a projects page covering BotkyrkaChill and UIA, sponsor listings, contact form, membership info, a membership application form, and the usual legal/privacy stuff. The live forms post to Next.js API routes that validate and sanitize input, apply rate limiting and send the email through Nodemailer. An older Express server with Mongoose, which stores membership applications in MongoDB before mailing them, is still in the repo, but the site does not call it.
02 / Key features
- –Hand-built project carousel with Framer Motion spring animations, swipe gestures, auto-rotation, and separate media sets for mobile vs desktop — ended up being way more involved than a typical slider
- –Membership application that collects personal number, address, occupation, and more, then emails the organization. Name, email and personal number format are validated server-side; the old Express route also stores applications in MongoDB
- –Contact form piped through Nodemailer to Strato SMTP, with in-memory rate limiting, validation and basic script-tag stripping on the API route
- –Security headers middleware that injects CSP, HSTS with preload on HTTPS, X-Frame-Options DENY, and X-Content-Type-Options on every non-API, non-static request
- –Dark and light mode throughout — logos, sponsor images, and gradient dividers all swap per theme using next-themes, with a custom Alby color palette baked into the Tailwind config
- –A handful of Node scripts for media housekeeping: Sharp-based WebP conversion and orientation sorting, a media file check, and a batch renamer that patches the media list in the source automatically
03 / Challenges
- –Strato SMTP was a pain to get working. The code toggles between SSL on port 465 and STARTTLS on 587 with extended timeouts and debug logging everywhere — clear signs of trial and error before email delivery started behaving
- –The backend ended up in two places: an Express server with Mongoose and Next.js API routes that overlap in functionality. The migration to API routes was never finished, so the old server still sits in the repo with a different SMTP setup and database storage the live forms no longer use
- –The project carousel looks simple from the outside but handles video autoplay management (pausing slides that leave view, catching browser rejections), directional spring animations, and completely different media sets depending on screen size
04 / Solution
The frontend runs on Next.js App Router with mostly client components, using shadcn/ui as the component library and a Tailwind config extended with Alby's brand colors. The project showcase page has a from-scratch carousel built on Framer Motion's AnimatePresence with spring physics and drag gestures on mobile. Backend-wise, the Next.js API routes handle validation, rate limiting, sanitization and email via Nodemailer, while the older Express server handles MongoDB writes through Mongoose. A middleware file sets security headers — full CSP, HSTS, the works — on all page responses (API routes and static files are excluded). There's also a small toolkit of Node scripts (Sharp for the image work) for converting images to WebP, sorting by orientation, and verifying that every carousel asset actually exists on disk.
05 / Outcome
Live at albyradet.se. The site handles membership applications and contact messages end to end — form submission, validation and an email to the organization. Built pro bono for a local youth organization.