🚩 Free & Simple CTF Platform — Deploy seamlessly with Vercel + Supabase. Perfect for individuals or teams who want a free and lightweight CTF platform.
git clone https://github.com/ariafatah0711/ctfs cd ctfs-
Create Supabase Project Log in to Supabase and create a new project.
-
Import Schema Upload
sql/schema.sqlinto the Supabase SQL editor and run it to set up the database schema. -
Disable Email Confirmation (Opsional) Go to Authentication in Supabase and disable email confirmation.

-
Enable Allow manual linking (Opsional) Go to Authentication → Settings → External OAuth Providers and enable the option. (jika ingin ingin bisa bind google ketika sudah login manual)

-
Enable Realtime public.solves Go to Database → Table and enable Realtime for the
public.solvestable.
-
Optional Testing Data
- Testing challenges →
sql/testing_challenges.sql - Dummy scoreboard →
sql/dummy_scoreboard/- Dummy challenges →
dummy_user_challenges.sql - Dummy solves →
dummy_solves.sql(can be generated usingcreate_solves.pyor use the pre-generated file) - Reset dummy data →
dummy_reset.sql
- Dummy challenges →
- Testing challenges →
The application can be customized through src/config.ts:
export const APP = { shortName: 'FGTE', // Short name for your CTF platform fullName: 'CTFS Platform', // Full name of your platform description: 'Your description', // Platform description flagFormat: 'FGTE{your_flag_here}', // Flag format for challenges challengeCategories: [ // Available challenge categories 'Intro', 'Misc', 'Osint', 'Crypto', 'Forensics', 'Web', 'Reverse', ], links: { // Platform-related links github: 'your_github_repo', discord: 'your_discord_invite', // ... other links }, }Create a .env.local file at the project root:
NEXT_PUBLIC_SUPABASE_URL=your_supabase_url NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key NEXT_PUBLIC_SITE_URL=https://ctf.ariaf.my.idGet these values from your Supabase project dashboard.
# Generate file src/version.ts dari package.json & waktu build node scripts/gen-version.js# Install dependencies (requires Node.js 18+ and npm 9+) npm install # Generate version info (WAJIB sebelum build) node scripts/gen-version.js # Start development server npm run devUntuk test production build:
# Generate version info (WAJIB sebelum build) node scripts/gen-version.js # Build for production npm run build # (Optional) Preview production build npm run startTip: After registering a user, you can make them an administrator by setting
admintotruein the Supabaseuserstable via the dashboard.
# Install Vercel CLI globally npm i -g vercel # Log in to Vercel vercel login # Link your project vercel link # Set environment variables (can also be done in Vercel dashboard) vercel env add # Deploy to production vercel --prod- Push the project to GitHub.
- Log in to Vercel and import the repository.
- Set environment variables in Vercel (from
.env.local). - Deploy!
-
Enable Google Provider in Supabase Dashboard → Authentication → Providers → Google → Enable. Enter Client ID and Client Secret from Google Cloud Console.
-
Create OAuth Client in Google Cloud Console
-
APIs & Services → Credentials → Create OAuth Client ID.
-
Application type: Web.
-
Authorized redirect URIs:
https://<YOUR_PROJECT_REF>.supabase.co/auth/v1/callback
-
-
Configure Redirect URL Dashboard → Authentication → URL Configuration → Site URL. Set this to your domain, for example:
https://ctf.ariaf.my.id
<table width="100%" cellpadding="0" cellspacing="0" style="max-width: 600px; margin: auto; background: #ffffff; border-radius: 12px; box-shadow: 0 4px 10px rgba(0,0,0,0.05);"> <tr> <td style="padding: 32px; text-align: center;"> <h2 style="color: #111827; margin-bottom: 16px;">Reset Password</h2> <p style="color: #374151; font-size: 15px; line-height: 1.6; margin-bottom: 24px;"> Kamu menerima email ini karena ada permintaan untuk reset password akunmu. Klik tombol di bawah untuk membuat password baru. </p> <a href="{{ .ConfirmationURL }}" style="display: inline-block; background-color: #3b82f6; color: #ffffff; text-decoration: none; padding: 12px 24px; border-radius: 8px; font-weight: bold; font-size: 15px;"> Reset Password </a> <p style="color: #6b7280; font-size: 13px; line-height: 1.6; margin-top: 24px;"> Jika kamu tidak meminta reset password, abaikan email ini. </p> </td> </tr> </table> <p style="text-align: center; color: #9ca3af; font-size: 12px; margin-top: 16px;">{{ .SiteURL }} © {{ .SiteURL }} - Semua hak dilindungi </p>Automate daily backup of your Supabase database to GitHub using matheusbcprog/supabase-backup.
-
Fork or copy the workflow:
- Go to supabase-backup.
- Copy
.github/workflows/backup.ymlinto your repo.
-
Add required secrets in your GitHub repository:
SUPABASE_URL— your Supabase project URLSUPABASE_SERVICE_ROLE_KEY— service role key (from Supabase dashboard)GITHUB_TOKEN— default GitHub Actions token
-
Customize schedule (optional):
- Edit the
croninbackup.ymlto set backup frequency.
- Edit the
-
Restore:
- Backups are saved in your repo under
/backups. Restore via Supabase SQL editor.
- Backups are saved in your repo under
- If you modify the schema, re-run the Supabase SQL setup and redeploy to Vercel.
- Warning: Schema changes may wipe existing data.
- Backup regularly!











