This is a Next.js project for the Bitcoin Bénin community gallery, built with create-next-app.
- Gallery management with albums and images
- Admin interface for content management
- Supabase backend with Row Level Security
- Responsive design with modern UI
- Node.js 18+
- Supabase project (create one at supabase.com)
git clone <repository-url>
cd bitcoinbenin.org
npm install- Create a new Supabase project at supabase.com
- Run the SQL setup script from
supabase-setup-new.sqlin your Supabase SQL Editor - Copy your project credentials from Settings > API
Create a .env.local file in the root directory:
cp .env.local.example .env.localUpdate .env.local with your Supabase credentials:
NEXT_PUBLIC_SUPABASE_URL=https://your-project-ref.supabase.co
NEXT_PUBLIC_SUPABASE_ANON_KEY=your-anon-key-here
SUPABASE_SERVICE_ROLE_KEY=your-service-role-key-hereImportant:
NEXT_PUBLIC_*variables are exposed to the browserSUPABASE_SERVICE_ROLE_KEYis server-side only and bypasses RLS policies- Never commit your
.env.localfile to version control
npm run devOpen http://localhost:3000 with your browser to see the result.
The admin interface is available at /admin/gallery. This uses the service role key to bypass Row Level Security policies for admin operations.
The application uses three main tables:
albums- Photo albumsgallery_images- Individual images with metadataevents- Community events
See supabase-setup-new.sql for the complete schema and RLS policies.
This error occurs when:
- Missing
SUPABASE_SERVICE_ROLE_KEYin your environment - Invalid service role key
- Service role key has incorrect permissions
Solution: Ensure your .env.local contains the correct service role key from Supabase Settings > API.
Check that:
- Supabase storage bucket 'gallery' exists
- RLS policies are correctly configured
- Environment variables are properly set
To learn more about Next.js, take a look at the following resources:
- Next.js Documentation - learn about Next.js features and API.
- Learn Next.js - an interactive Next.js tutorial.
You can check out the Next.js GitHub repository - your feedback and contributions are welcome!
The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.
Check out our Next.js deployment documentation for more details.