๏ฟฝ Setup Guide
A modern personal portfolio website built with Next.js 15, PostgreSQL, and Better Auth.
๐ Prerequisites
- Node.js 18+ installed
- PostgreSQL database (Neon, Supabase, or local)
- Google OAuth credentials (optional, for Google Sign-In)
- Git installed
๐ ๏ธ Installation
1. Clone the Repository
git clone <your-repo-url>
cd personal-site2. Install Dependencies
npm install3. Set Up Environment Variables
Copy the example environment file:
cp .env.example .envEdit .env and configure the following variables:
Required Variables:
Database Configuration:
DATABASE_URL=postgresql://username:password@host:port/database?sslmode=requireGet a free PostgreSQL database from Neon or Supabase
Authentication Secrets:
BETTER_AUTH_SECRET=your-random-secret-key-here-min-32-charsGenerate with: openssl rand -base64 32
URLs:
BETTER_AUTH_URL=http://localhost:3000
NEXT_PUBLIC_APP_URL=http://localhost:3000Admin Credentials:
ADMIN_EMAIL=admin@yourdomain.com
ADMIN_PASSWORD=your-strong-passwordOptional Variables:
Google OAuth (for Google Sign-In):
GOOGLE_CLIENT_ID=your-client-id.apps.googleusercontent.com
GOOGLE_CLIENT_SECRET=your-client-secretGet from Google Cloud Console
Google Analytics:
NEXT_PUBLIC_GA_TRACKING_ID=G-XXXXXXXXXX4. Set Up Database
Run database migrations:
npm run db:pushSeed initial data (optional):
npm run db:seed5. Start Development Server
npm run devVisit http://localhost:3000
๐ฏ Features
Public Pages
- Home (
/) - Hero section with introduction - About (
/about) - About me page with markdown content - Projects (
/projects) - Portfolio projects showcase - Writing (
/writing) - Blog posts listing - Resume (
/resume) - Interactive resume with skills - Contact (
/contact) - Contact information and social links - Stats (
/stats) - Personal statistics
Admin Dashboard
Access at /admin with your admin credentials.
Manage Content:
- About Page - Edit markdown content for about page
- Projects - Create, edit, delete portfolio projects
- Blog Posts - Write and publish blog articles with markdown
๐ Using the Admin Dashboard
1. Login
Navigate to /admin and sign in with:
- Email: Your configured
ADMIN_EMAIL - Password: Your configured
ADMIN_PASSWORD
Or use Google Sign-In if configured.
2. Manage About Page
- Go to Dashboard โ About
- Edit markdown content
- Click Save Changes
- Changes appear immediately on
/about
3. Manage Projects
- Go to Dashboard โ Projects
- Click Create New Project or Edit existing
- Fill in:
- Title (required)
- Subtitle (optional)
- Link URL (optional)
- Image URL (required)
- Date (YYYY-MM or YYYY format)
- Description (required)
- Technologies (comma-separated)
- Featured checkbox
- Click Create/Update Project
- View on
/projects
4. Manage Blog Posts
- Go to Dashboard โ Writing
- Click Create New Post or Edit existing
- Fill in:
- Title (required)
- Slug (URL-friendly, e.g.,
my-first-post) - Description (required)
- Cover Image URL (optional)
- Content (Markdown supported)
- Publish checkbox
- Click Create/Update Post
- Published posts appear on
/writing
๐จ Customization
Update Personal Information
Edit files in src/data/:
about.ts- About page default contentcontact.ts- Contact information and social linksprojects.ts- Initial projects dataroutes.ts- Navigation menu itemsresume/degrees.ts- Education historyresume/work.ts- Work experienceresume/skills.ts- Technical skills
Styling
The site uses CSS custom properties for theming. Edit:
app/styles/tokens/colors.css- Color paletteapp/styles/dark-mode.css- Dark mode colors
Theme automatically switches based on user preference.
๐ Deployment
Vercel (Recommended)
- Push your code to GitHub
- Import project on Vercel
- Add environment variables in project settings
- Deploy
Other Platforms
- Build the project:
npm run build- Start production server:
npm startSet up environment variables in your hosting platform's dashboard.
๐ Tech Stack
- Framework: Next.js 15 with App Router
- Database: PostgreSQL with Drizzle ORM
- Authentication: Better Auth with Google OAuth
- Styling: Custom CSS with CSS Variables
- UI Components: Custom components with Radix UI primitives
- Toast Notifications: Sonner
- Markdown: markdown-to-jsx
๐ง Available Scripts
npm run dev # Start development server
npm run build # Build for production
npm start # Start production server
npm run lint # Run ESLint
npm run db:push # Push database schema changes
npm run db:generate # Generate database migrations
npm run db:seed # Seed database with initial data๐ Troubleshooting
Database Connection Issues:
- Verify
DATABASE_URLis correct - Check if your IP is whitelisted (Neon/Supabase)
- Ensure SSL mode is set correctly
Authentication Not Working:
- Regenerate
BETTER_AUTH_SECRET - Verify URLs match your domain
- Check admin credentials are correct
Google OAuth Issues:
- Verify redirect URI in Google Console
- Ensure OAuth consent screen is configured
- Check client ID and secret are correct
๐ Documentation
๐ก Tips
- Use strong passwords for admin account in production
- Rotate secrets regularly
- Enable database backups
- Set up monitoring and error tracking
- Use environment-specific secrets for dev/staging/production
Need Help? Open an issue or check the documentation links above.