This document summarizes the changes made to enable GitHub Pages deployment for the Sharothee Wedding website.
File: client/prisma/schema.prisma
- Changed database provider from
mysqltosqlite - Updated datasource configuration to use SQLite file
File: client/next.config.ts
- Enabled static export:
output: 'export' - Added basePath for subdirectory deployment:
/Sharothee-Wedding-arvinwedsincia - Added assetPrefix for proper asset loading
- Enabled trailing slashes for GitHub Pages compatibility
- Set images to unoptimized mode for static export
Created Files:
client/scripts/prepare-static-build.sh- Moves API routes and admin pages before buildclient/scripts/restore-after-build.sh- Restores moved directories after build
Updated File: client/package.json
- Added
build:staticscript: Runs prepare → build → restore sequence - Updated
build:githubto usebuild:static
Modified Files:
client/src/app/rsvp/page.tsx- Added static mode detection and email fallbackclient/src/app/contact/page.tsx- Added static mode detection and email fallback
Both forms now:
- Detect when running in static export mode
- Show success message with email contact information
- Maintain client-side validation
File: .github/workflows/nextjs.yml
- Updated comments to reflect static export functionality
- Changed build command to use
npm run build:static - Updated artifact path to
client/out(static export output) - Updated environment file creation comments
Created Files:
client/public/.nojekyll- Prevents Jekyll processing on GitHub PagesGITHUB_PAGES_DEPLOYMENT.md- Complete deployment documentation
Updated File: client/.gitignore
- Added
.build-backupdirectory to ignore list
- Preparation: API routes and admin directories are temporarily moved to
.build-backup - Build: Next.js generates static HTML/CSS/JS files in
outdirectory - Restore: Moved directories are restored for development use
client/out/
├── .nojekyll # Prevents Jekyll processing
├── index.html # Home page
├── 404.html # 404 error page
├── events/index.html # Events page
├── gallery/index.html # Gallery page
├── live/index.html # Live stream page
├── rsvp/index.html # RSVP page
├── contact/index.html # Contact page
├── travel/index.html # Travel info page
├── _next/ # Next.js static assets
├── images/ # Static images
└── favicon.ico # Favicon
All URLs and asset paths include the basePath /Sharothee-Wedding-arvinwedsincia for subdirectory deployment.
Example:
- Image:
/Sharothee-Wedding-arvinwedsincia/images/photo.jpg - Link:
/Sharothee-Wedding-arvinwedsincia/events/ - Script:
/Sharothee-Wedding-arvinwedsincia/_next/static/chunks/...
The following directories are temporarily moved during build:
src/app/api/- All API routes (18 files)src/app/admin/- Admin dashboard pages (10 files)
These are restored after build for local development but not included in the static export.
The workflow creates a minimal .env.local file with placeholder values:
DATABASE_URL- Points to SQLite file (not used at runtime)NEXTAUTH_SECRET- Placeholder (authentication not used)NEXTAUTH_URL- Placeholder (authentication not used)- Email and Cloudinary keys - Placeholders (not functional in static mode)
cd client
npm run build:static
cd out
python3 -m http.server 8000
# Visit: http://localhost:8000
# Note: BasePath required for full testingOnce merged and deployed: https://codestorm-hub.github.io/Sharothee-Wedding-arvinwedsincia/
For full server functionality (API routes, authentication, database):
- Deploy to Hostinger VPS instead
- Use MySQL database
- Remove
output: 'export'from next.config.ts - Keep basePath empty in production
- Configure proper environment variables
See HOSTINGER_VPS_DEPLOYMENT_PLAN.md for VPS deployment instructions.
.github/workflows/nextjs.ymlclient/.gitignoreclient/next.config.tsclient/package.jsonclient/prisma/schema.prismaclient/src/app/contact/page.tsxclient/src/app/rsvp/page.tsx
client/public/.nojekyllclient/scripts/prepare-static-build.shclient/scripts/restore-after-build.shGITHUB_PAGES_DEPLOYMENT.mdDEPLOYMENT_CHANGES_SUMMARY.md(this file)
- Static build completes successfully
- All 11 pages generated (including 404)
- BasePath correctly applied to all URLs
- .nojekyll file included in output
- API routes and admin pages excluded
- Forms show email fallback
- GitHub Actions workflow updated
- Documentation created
For questions or issues: