Modern marketing site for the Swelly Discord music bot. Built with Next.js 14 (App Router), TypeScript, Tailwind CSS, NextAuth (Discord), and framer-motion. The UI is themed to Swelly’s red logo with glassmorphism, subtle motion, and animated orbs.
- Next.js 14 (App Router) + TypeScript
- Tailwind CSS (custom theme, glass cards, utilities)
- NextAuth (Discord OAuth2) with JWT session
- framer-motion (client-only wrappers)
- React Icons
- Landing page with animated parallax orbs and gradient accents
- Commands directory with search/filter
- Premium pages (tiers + comparison)
- Invite, Status (mock API), FAQ, Top Songs, Blog, Support
- Auth: Login with Discord, Profile
- Servers list (managed/owned guilds via Discord API)
- Dashboard shell, Leaderboard, Referral
app/— App Router pages and API routesapi/auth/[...nextauth]— NextAuth handlerapi/status— mock status JSONapi/me/guilds— Discord guilds for the signed-in user
components/— UI, motion, auth, providerslib/authOptions.ts— NextAuth configuration (Discord provider, JWT/session callbacks)app/globals.css— global styles, utilities, glass & button effectstailwind.config.ts— theme tokens (primary red palette)
- Install Node.js 18+.
- Copy the example env file and fill values:
cp .env.example .env.local
- Install dependencies:
npm ci
- Run the dev server:
npm run dev
Open http://localhost:3000.
Create .env.local (or use the provided .env.example):
DISCORD_CLIENT_ID=your_discord_app_client_id
DISCORD_CLIENT_SECRET=your_discord_oauth_client_secret # not the bot token
NEXTAUTH_SECRET=generate_a_strong_random_string
NEXTAUTH_URL=http://localhost:3000
NEXT_PUBLIC_DISCORD_INVITE_URL=https://discord.com/oauth2/authorize?client_id=YOUR_ID&scope=bot%20applications.commands&permissions=36700160
NEXT_PUBLIC_DISCORD_SUPPORT_URL=https://discord.gg/yourserver
NEXT_PUBLIC_TOPGG_URL=https://top.gg/bot/YOUR_ID
Discord Developer Portal setup:
- Add Redirect URL:
http://localhost:3000/api/auth/callback/discord - If your local server runs on a different port (e.g. 3001), update both the Redirect URL and
NEXTAUTH_URLaccordingly.
- On sign-in, the Discord
access_tokenis persisted in the JWT. - The session object includes
user.idand exposes theaccessTokenfor server-side API fetches. - The route
app/api/me/guildsfetches the user’s guilds and filters those they own or can manage.
- Tailwind theme primary is red (
primary.DEFAULT: #ef4444/primary.light: #f87171) with warm orange/rose accents. - Glass cards and button gradients live in
app/globals.css. - Motion:
components/motion/FadeIn(entrances) andcomponents/motion/ParallaxOrbs(ambient backdrop). framer-motion is used only in"use client"components.
npm run dev— start Next.js in devnpm run build— production buildnpm run start— run the built appnpm run lint— lint with eslint
GET /api/status— mock status (uptime, latency, shards)GET /api/auth/providers— NextAuth providersGET /api/me/guilds— requires session; returns managed/owned guilds
next.config.mjs allows Discord CDN:
- cdn.discordapp.com
- media.discordapp.net
- NextAuth
NO_SECRETor hkdf error: setNEXTAUTH_SECRETto a non-empty strong string. invalid_clientorclient_id is required: check your.env.localand Discord app Client ID/Secret; confirm the Redirect URL matches exactly.- Windows EPERM on
.next/trace: stop dev server and delete the.nextfolder; exclude the project from antivirus real-time scanning. - Port changed to 3001: update
NEXTAUTH_URLand Discord Redirect URL tohttp://localhost:3001/....
- Vercel: set all env variables in the project settings. Build with
npm run build.NEXTAUTH_URLshould be your production URL, and the Discord Redirect URL should match that domain.
Swelly © 2025. Logo and brand elements belong to their respective owner.