A modern platform for developers to share, discover, and showcase their projects.
DevShowcase is a full-stack web application where developers can post their projects, get feedback through likes and comments, and build their developer identity. Think of it as a social network specifically designed for developer portfolios.
- Features
- Tech Stack
- Project Structure
- Prerequisites
- Installation
- Environment Variables
- Database Setup
- Running the Application
- API Endpoints
- Features Breakdown
- Contributing
- License
- Google OAuth Authentication via Supabase
- Fully Responsive Design - Mobile-first approach
- Dark Mode Support - Persistent theme preference
- Like System - Like/unlike projects with real-time updates
- Comments System - Engage with developers through comments
- Project Management - Create, edit, and delete your projects
- Image Upload - Upload project thumbnails via Supabase Storage
- User Profiles - Customizable profiles with avatar, bio, and social links
- Project Discovery - Browse all projects with filtering options
- Optimistic UI Updates - Instant feedback on user interactions
- Real-time Data Sync - React Query for efficient data fetching
- Material-UI Components - Modern, accessible UI components
- Protected Routes - Secure authentication flow
- PostgreSQL Database - Hosted on Neon
- RESTful API - Clean backend architecture
- React 18 - UI library
- Material-UI (MUI) - Component library
- React Router v6 - Client-side routing
- TanStack Query (React Query) - Server state management
- Axios - HTTP client
- Supabase Client - Authentication
- Node.js - Runtime environment
- Express.js - Web framework
- PostgreSQL - Database (Neon serverless)
- Supabase - Authentication & Storage
- Multer - File upload handling
- pg - PostgreSQL client
devshowcase/
βββ frontend/
β βββ src/
β β βββ api/ # API service functions
β β βββ assets/ # Static assets
β β βββ components/ # Reusable React components
β β β βββ Navbar.jsx
β β β βββ Sidebar.jsx
β β β βββ Topbar.jsx
β β β βββ ProjectCard.jsx
β β β βββ CommentsModal.jsx
β β β βββ ProjectDetailsModal.jsx
β β βββ context/ # React Context providers
β β β βββ ThemeContext.jsx
β β βββ layouts/ # Layout components
β β β βββ AppLayout.jsx
β β βββ pages/ # Page components
β β β βββ Landing.jsx
β β β βββ Home.jsx
β β β βββ MyProjects.jsx
β β β βββ ProjectPage.jsx
β β β βββ Settings.jsx
β β β βββ About.jsx
β β β βββ AuthCallback.jsx
β β βββ router/ # Routing configuration
β β β βββ AppRouter.jsx
β β βββ App.jsx # Root component
β β βββ main.jsx # Entry point
β β βββ config.js # Configuration
β β βββ supabaseClient.js # Supabase initialization
β βββ package.json
β
βββ backend/
β βββ middleware/ # Express middleware
β β βββ requireAuth.js
β β βββ requireAuthOptional.js
β βββ routes/ # API routes
β β βββ users.js
β β βββ projects.js
β β βββ comments.js
β β βββ upload.js
β βββ db.js # Database connection
β βββ supabase.js # Supabase server config
β βββ server.js # Express server
β βββ package.json
β
βββ README.md
Before you begin, ensure you have the following installed:
- Node.js (v16 or higher)
- npm or yarn
- PostgreSQL account (Neon recommended)
- Supabase account (for authentication and storage)
git clone https://github.com/yourusername/devshowcase.git
cd devshowcasecd frontend
npm installcd ../backend
npm installCreate a .env file in the frontend directory:
VITE_API_URL=http://localhost:5000
VITE_SUPABASE_URL=your_supabase_project_url
VITE_SUPABASE_ANON_KEY=your_supabase_anon_keyCreate a .env file in the backend directory:
PORT=5000
DATABASE_URL=your_neon_postgresql_connection_string
SUPABASE_URL=your_supabase_project_url
SUPABASE_SERVICE_ROLE=your_supabase_service_role_keyRun the following SQL commands in your PostgreSQL database (Neon):
-- Users table
CREATE TABLE users (
id UUID PRIMARY KEY,
email VARCHAR(255) UNIQUE NOT NULL,
name VARCHAR(255) NOT NULL,
username VARCHAR(100),
bio TEXT,
avatar TEXT,
github VARCHAR(255),
linkedin VARCHAR(255),
website VARCHAR(255),
created_at TIMESTAMP DEFAULT NOW()
);
-- Projects table
CREATE TABLE projects (
id SERIAL PRIMARY KEY,
user_id UUID REFERENCES users(id) ON DELETE CASCADE,
title VARCHAR(255) NOT NULL,
short_desc TEXT,
full_desc TEXT,
image TEXT,
github VARCHAR(255),
live VARCHAR(255),
tags TEXT[],
created_at TIMESTAMP DEFAULT NOW()
);
-- Votes (likes) table
CREATE TABLE votes (
id SERIAL PRIMARY KEY,
user_id UUID REFERENCES users(id) ON DELETE CASCADE,
project_id INTEGER REFERENCES projects(id) ON DELETE CASCADE,
created_at TIMESTAMP DEFAULT NOW(),
UNIQUE(user_id, project_id)
);
-- Comments table
CREATE TABLE comments (
id SERIAL PRIMARY KEY,
user_id UUID REFERENCES users(id) ON DELETE CASCADE,
project_id INTEGER REFERENCES projects(id) ON DELETE CASCADE,
text TEXT NOT NULL,
created_at TIMESTAMP DEFAULT NOW()
);
-- Indexes for performance
CREATE INDEX idx_projects_user_id ON projects(user_id);
CREATE INDEX idx_votes_project_id ON votes(project_id);
CREATE INDEX idx_votes_user_id ON votes(user_id);
CREATE INDEX idx_comments_project_id ON comments(project_id);- Go to your Supabase dashboard
- Navigate to Storage
- Create two buckets:
project-images(public)avatars(public)
- Set both buckets to public access
Terminal 1 - Backend:
cd backend
npm run devTerminal 2 - Frontend:
cd frontend
npm run devThe application will be available at:
- Frontend: http://localhost:5173
- Backend: http://localhost:5000
Frontend:
cd frontend
npm run buildBackend:
cd backend
npm start- Uses Supabase OAuth with Google provider
POST /api/users- Create/sync userGET /api/users/me- Get current user profilePUT /api/users/me- Update user profileGET /api/users- Get all users
GET /api/projects- Get all projects (with optional auth)GET /api/projects/me- Get current user's projects (auth required)GET /api/projects/:id- Get single project by IDPOST /api/projects- Create new project (auth required)PATCH /api/projects/:id- Update project (auth required)DELETE /api/projects/:id- Delete project (auth required)
POST /api/projects/:id/like- Like a project (auth required)DELETE /api/projects/:id/like- Unlike a project (auth required)
GET /api/comments/:projectId- Get comments for a projectPOST /api/comments/:projectId- Add comment (auth required)DELETE /api/comments/:commentId- Delete comment (auth required)
POST /api/upload- Upload project image (auth required)POST /api/upload/avatar- Upload user avatar (auth required)
- User clicks "Sign In with Google"
- Redirected to Google OAuth via Supabase
- After authentication, redirected to
/auth/callback - Token stored in localStorage
- User data synced to PostgreSQL database
- Optimistic Updates: UI updates immediately before server response
- Database Tracking: Votes stored in
votestable with unique constraint - Real-time Counts: Like counts updated on every action
- Persistent State: Liked status persists across page reloads
- Real-time comment posting
- Display user name with each comment
- Delete own comments (future feature)
- Create projects with title, descriptions, images, and links
- Upload images to Supabase Storage
- Edit and delete your own projects
- Tag system for categorization
- Theme preference stored in localStorage
- Persists across sessions
- Affects entire app including mobile browser UI
- Resets to light mode on logout
- Mobile-first approach
- Sidebar navigation on desktop
- Drawer navigation on mobile
- Adaptive layouts for all screen sizes
- Sidebar navigation with active route highlighting
- Top bar with user avatar and logout
- Grid layout for project cards
- Modal dialogs for project details and comments
- Collapsible drawer navigation
- Full-width buttons for better touch targets
- Optimized typography and spacing
- Mobile logout button in sidebar
- Responsive project grid (1 column on mobile)
- GitHub-inspired dark theme
- Proper contrast ratios for accessibility
- Dark mobile browser UI bar
- Smooth theme transitions
- JWT Authentication: Supabase handles token generation
- Protected Routes: Client-side route protection
- Server-side Auth: Middleware validates tokens on backend
- User Ownership: Users can only edit/delete their own content
- SQL Injection Prevention: Parameterized queries
- XSS Protection: React's built-in sanitization
- Search and filter projects
- User profiles with project portfolio
- Follow system
- Notifications
- Project analytics
- Social sharing
- Email notifications
- Advanced tagging and categories
- Project showcase page
- Trending projects algorithm
Contributions are welcome! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Made with β€οΈ by Gaurav