Follow these steps to set up the project showcase feature on your COC website.
npm install
# or
yarn install
# or
pnpm installThis will install the newly added @radix-ui/react-select dependency.
Connect to your Supabase project and execute the SQL migrations in order:
- Go to your Supabase project dashboard
- Navigate to SQL Editor
- Copy and paste the contents of each migration file:
- First:
supabase/migrations/create_projects_table.sql - Then:
supabase/migrations/create_increment_views_function.sql
- First:
- Click "Run" for each migration
# Make sure you have Supabase CLI installed
npm install -g supabase
# Link your project
supabase link --project-ref your-project-ref
# Run migrations
supabase db pushRun this query in Supabase SQL Editor to verify:
-- Check if tables exist
SELECT table_name
FROM information_schema.tables
WHERE table_schema = 'public'
AND table_name IN ('projects', 'project_likes');
-- Should return 2 rowsMake yourself an admin by running this in Supabase SQL Editor:
UPDATE users
SET is_admin = 1
WHERE email = 'your-email@example.com';Replace your-email@example.com with your actual email.
npm run devVisit http://localhost:3000/projects to see the project showcase page.
- Navigate to
/projects - Click "Submit Your Project" (must be signed in)
- Fill out the form and submit
- Your project will appear with "Pending" status
- Navigate to
/admin-dashboard - Click on "Projects" tab
- Review pending submissions
- Approve or reject projects
- Toggle featured status as needed
- Project Showcase:
/projects - Project Submission: Click button on showcase page
- Project Management:
/admin-dashboard→ Projects tab
- Tables:
projects,project_likes - Migrations:
supabase/migrations/ - Queries Reference:
supabase/queries/project_queries.sql
SELECT id, title, status, submitter_name, created_at
FROM projects
ORDER BY created_at DESC;UPDATE projects
SET
status = 'approved',
reviewed_by = 'admin@example.com',
reviewed_at = NOW()
WHERE id = 'project-id-here';UPDATE projects
SET is_featured = true
WHERE id = 'project-id-here'
AND status = 'approved';SELECT COUNT(*) as pending_count
FROM projects
WHERE status = 'pending';- Check status: Only approved projects show on public page
- Check RLS: Ensure Row Level Security policies are active
- Check database: Run
SELECT * FROM projectsto see all records
- Sign in required: User must be authenticated
- Check session: Verify NextAuth session is working
- Check user table: User profile must exist in
userstable
- Check admin status: Run
SELECT is_admin FROM users WHERE email = 'your-email' - Should return 1: If not, update using Step 4 above
- Clear cache: Sign out and sign in again after making admin
- Run npm install: Ensure
@radix-ui/react-selectis installed - Check imports: Verify all imports in component files are correct
- Restart dev server: Stop and restart
npm run dev
- Browse approved projects
- Filter by category
- View project details
- Like/unlike projects
- Submit new projects
- Track your submissions
- Review submissions
- Approve/reject with notes
- Toggle featured status
- Delete projects
- View statistics
- Filter by status
Edit types/projects.ts and update the ProjectCategory type:
export type ProjectCategory =
| 'web-development'
| 'app-development'
| 'your-new-category';Also update the constraint in create_projects_table.sql:
CONSTRAINT valid_category CHECK (category IN (
'web-development',
'app-development',
'your-new-category'
))The project uses the existing theme. To customize, edit the gradient colors in:
app/projects/page.tsxcomponents/ProjectSubmissionModal.tsxcomponents/admin/ProjectManagement.tsx
Look for gradient classes like:
className="bg-gradient-to-r from-blue-500 to-purple-600"- Full Documentation:
PROJECT_SHOWCASE_SETUP.md - Implementation Details:
IMPLEMENTATION_SUMMARY.md - SQL Queries:
supabase/queries/project_queries.sql
- Check the troubleshooting section above
- Review the full documentation files
- Check Supabase logs for database errors
- Verify all migrations ran successfully
- Contact the development team
After setup, you can:
- Submit test projects
- Test the review workflow
- Customize categories for your needs
- Add featured projects to homepage
- Set up email notifications (future enhancement)
Ready to go! 🎉 Your project showcase feature is now set up and ready to use.