This feature adds a complete project showcase and submission system to the COC website, allowing users to submit their projects for review and display them in a public showcase once approved by admins.
-
Project Showcase Page (
/projects)- Browse all approved projects
- Filter by category (Web Dev, App Dev, ML, AI, Blockchain, etc.)
- View featured projects
- Like projects (requires authentication)
- View project details in a modal
- Track views and likes
- Search and filter functionality
-
Project Submission
- Submit projects for review
- Add project details (title, description, category, tags)
- Include links (GitHub, live demo, video)
- Add team information
- Upload project images
- Project Management Dashboard (Admin Dashboard > Projects tab)
- Review pending project submissions
- Approve or reject projects
- Add review notes
- Toggle featured status
- Delete projects
- View submission statistics
Execute the following SQL migrations in your Supabase database in order:
-- File: supabase/migrations/create_projects_table.sqlThis migration creates:
projectstable with all necessary fieldsproject_likestable for tracking user likes- Indexes for performance optimization
- Row Level Security (RLS) policies
- Automatic timestamp updates
-- File: supabase/migrations/create_increment_views_function.sqlThis creates the increment_project_views() function for atomic view count updates.
After running migrations, verify the tables exist:
-- Check projects table
SELECT * FROM projects LIMIT 1;
-- Check project_likes table
SELECT * FROM project_likes LIMIT 1;RLS policies are automatically enabled. Test them:
-- Test viewing approved projects (should work)
SELECT * FROM projects WHERE status = 'approved';
-- Test viewing all projects (requires admin or owner)
SELECT * FROM projects;| Column | Type | Description |
|---|---|---|
| id | UUID | Primary key |
| title | VARCHAR(255) | Project title |
| description | TEXT | Short description |
| full_description | TEXT | Detailed description |
| category | VARCHAR(100) | Project category |
| tags | TEXT[] | Array of tags |
| github_url | VARCHAR(500) | GitHub repository URL |
| live_url | VARCHAR(500) | Live demo URL |
| video_url | VARCHAR(500) | Video demo URL |
| image_url | VARCHAR(500) | Main project image |
| additional_images | TEXT[] | Additional images |
| team_name | VARCHAR(255) | Team name |
| team_members | JSONB | Array of team member objects |
| submitted_by | VARCHAR(255) | User email |
| submitter_name | VARCHAR(255) | User name |
| submitter_year | INTEGER | Student year |
| submitter_branch | VARCHAR(100) | Student branch |
| status | VARCHAR(50) | pending/approved/rejected |
| review_notes | TEXT | Admin review notes |
| reviewed_by | VARCHAR(255) | Reviewer email |
| reviewed_at | TIMESTAMPTZ | Review timestamp |
| is_featured | BOOLEAN | Featured flag |
| views_count | INTEGER | View count |
| likes_count | INTEGER | Like count |
| created_at | TIMESTAMPTZ | Creation timestamp |
| updated_at | TIMESTAMPTZ | Update timestamp |
| Column | Type | Description |
|---|---|---|
| id | UUID | Primary key |
| project_id | UUID | Foreign key to projects |
| user_email | VARCHAR(255) | User email |
| created_at | TIMESTAMPTZ | Like timestamp |
web-developmentapp-developmentmachine-learningblockchainiotgame-developmentaidata-sciencecybersecurityother
All project operations are handled through server actions in app/actions/projects.ts:
getApprovedProjects(category?, featured?)- Get all approved projectsgetProjectById(id, incrementView?)- Get single projectsubmitProject(projectData)- Submit new projectgetMyProjects()- Get user's own projectstoggleProjectLike(projectId)- Like/unlike projecthasUserLikedProject(projectId)- Check if user liked projectdeleteProject(projectId)- Delete own project
getAllProjects(status?)- Get all projects (requires admin)reviewProject(projectId, reviewData)- Approve/reject projecttoggleFeaturedProject(projectId)- Toggle featured status
const projectData: ProjectSubmission = {
title: "My Awesome Project",
description: "A brief description",
fullDescription: "Detailed description with features and tech stack",
category: "web-development",
tags: ["React", "Next.js", "TypeScript"],
githubUrl: "https://github.com/username/repo",
liveUrl: "https://myproject.com",
imageUrl: "https://example.com/image.png",
teamName: "Team Awesome",
teamMembers: [
{ name: "John Doe", role: "Frontend", email: "john@example.com" },
{ name: "Jane Smith", role: "Backend", email: "jane@example.com" }
]
};
const result = await submitProject(projectData);const reviewData: ProjectReviewData = {
status: "approved",
reviewNotes: "Great project! Well documented."
};
const result = await reviewProject(projectId, reviewData);app/
├── projects/
│ └── page.tsx # Project showcase page
├── actions/
│ └── projects.ts # Server actions
├── admin-dashboard/
│ └── page.tsx # Updated with Projects tab
components/
├── ProjectSubmissionModal.tsx # Project submission form
├── ProjectDetailsModal.tsx # Project details viewer
└── admin/
└── ProjectManagement.tsx # Admin project management
types/
└── projects.ts # TypeScript types
supabase/
└── migrations/
├── create_projects_table.sql
└── create_increment_views_function.sql
- View Projects: Anyone can view approved projects, users can view their own pending/rejected projects
- Submit Projects: Authenticated users can submit projects
- Update Projects: Users can update their own pending projects
- Admin Actions: Only admins can review, approve, reject, feature, or delete any project
Admin status is verified via the users table:
SELECT is_admin FROM users WHERE email = 'user@example.com';- Run database migrations successfully
- Verify tables and indexes created
- Test RLS policies
- Submit a test project as a regular user
- View pending projects as admin
- Approve/reject projects as admin
- Toggle featured status
- Like/unlike projects
- View project details
- Filter projects by category
- Delete projects (as owner and admin)
- Check if projects are approved:
SELECT * FROM projects WHERE status = 'approved'; - Verify RLS policies are working correctly
- Ensure user is authenticated
- Check user profile exists in
userstable - Verify email matches session email
- Verify
is_admin = 1in users table - Check session email matches admin email
- Project search functionality
- Advanced filtering (tags, date range)
- Project comments/feedback
- Project upvoting system
- Analytics dashboard for project views
- Email notifications for project status changes
- Project categories suggestions
- Bulk import projects
- Export project data
For issues or questions, contact the development team or create an issue in the repository.