First off, thank you for considering contributing to the Dev Weekends Web Platform! 🎉
This project powers the public site and internal portals for the Dev Weekends community. Your contributions help us serve our community of learners, mentors, and tech enthusiasts better.
- Code of Conduct
- Getting Started
- Development Setup
- How to Contribute
- Coding Guidelines
- Commit Guidelines
- Pull Request Process
- Project Structure
- Testing
- Getting Help
This project and everyone participating in it is governed by our Code of Conduct. By participating, you are expected to uphold this code. Please report unacceptable behavior to devweekends@gmail.com.
Before you begin, ensure you have the following installed:
- Node.js 20+ (LTS recommended) – Download
- npm (comes with Node.js) or another package manager
- MongoDB – Local installation or MongoDB Atlas account
- Git – Download
- A code editor (we recommend VS Code with TypeScript support)
- Good First Issues – Perfect for newcomers! Look for the
good first issuelabel. - Help Wanted – Issues where we need community help. Look for the
help wantedlabel. - Bug Fixes – Check the
buglabel. - Feature Requests – Browse the
enhancementlabel.
💡 Tip: Comment on an issue to let others know you're working on it. This prevents duplicate work!
# Fork the repository on GitHub, then clone your fork
git clone https://github.com/YOUR_USERNAME/web-platform.git
cd web-platform
# Add the original repository as upstream
git remote add upstream https://github.com/devweekends/web-platform.gitnpm install# Copy the example environment file
cp .env.example .env.localEdit .env.local with your configuration:
# Required
MONGODB_URI=mongodb://localhost:27017/devweekends # or your MongoDB Atlas URI
JWT_SECRET=your-secret-key-here
# Access codes (set your own for local development)
ADMIN_ACCESS_CODE=your-admin-code
MENTOR_ACCESS_CODE=your-mentor-code
AMBASSADOR_ACCESS_CODE=your-ambassador-code
# Optional
NEXT_PUBLIC_GA_ID=
CLOUDINARY_CLOUD_NAME=
CLOUDINARY_API_KEY=
CLOUDINARY_API_SECRET=npm run devVisit http://localhost:3000 to see the application.
# Fetch upstream changes
git fetch upstream
# Switch to main branch
git checkout main
# Merge upstream changes
git merge upstream/main
# Push to your fork
git push origin mainBefore creating a bug report, please check existing issues to avoid duplicates.
- Go to Issues
- Click "New Issue"
- Select "Bug Report"
- Fill in the template with as much detail as possible
Include:
- Steps to reproduce
- Expected behavior
- Actual behavior
- Screenshots (if applicable)
- Environment details (OS, browser, Node version)
- Go to Issues
- Click "New Issue"
- Select "Feature Request"
- Describe the feature and its use case
-
Create a branch from
main:git checkout -b feature/your-feature-name # or git checkout -b fix/your-bug-fix -
Make your changes following our coding guidelines
-
Test your changes:
npm run lint # Check for linting errors npm run build # Ensure it builds successfully
-
Commit your changes following our commit guidelines
-
Push to your fork:
git push origin feature/your-feature-name
-
Open a Pull Request against the
mainbranch
- Use TypeScript for all new code (
.ts/.tsxfiles) - Enable strict mode – avoid
anytype when possible - Define proper types/interfaces for all props and function parameters
- Export types that may be reused
// ✅ Good
interface SessionProps {
id: string;
name: string;
date: Date;
}
export function Session({ id, name, date }: SessionProps) {
// ...
}
// ❌ Bad
export function Session(props: any) {
// ...
}- Follow App Router conventions
- Use Server Components by default, Client Components only when needed
- Use Server Actions or API Routes for backend logic
// Client component (only when needed)
'use client'
import { useState } from 'react'
export function InteractiveComponent() {
const [state, setState] = useState(false)
// ...
}| Directory | Purpose |
|---|---|
app/ |
Pages and API routes (App Router) |
components/ |
Reusable React components |
components/ui/ |
Primitive UI components |
lib/ |
Utilities, helpers, and shared logic |
models/ |
Mongoose database models |
types/ |
TypeScript type definitions |
Use the @/ path alias for imports:
// ✅ Good
import { Button } from '@/components/ui/button'
import connectDB from '@/lib/db'
import { Session } from '@/models/Session'
// ❌ Bad
import { Button } from '../../../components/ui/button'- Use Tailwind CSS utility classes
- Follow existing patterns and component styles
- Ensure responsive design (mobile-first approach)
- Support both light and dark themes
// ✅ Good - Using Tailwind
<div className="flex items-center gap-4 p-4 rounded-lg bg-card">
<h2 className="text-lg font-semibold text-foreground">Title</h2>
</div>- Always use
connectDB()fromlib/db.ts - Use existing Mongoose models from
models/ - Handle errors gracefully
import connectDB from '@/lib/db'
import { Session } from '@/models/Session'
export async function GET() {
try {
await connectDB()
const sessions = await Session.find()
return Response.json(sessions)
} catch (error) {
console.error('Database error:', error)
return Response.json({ error: 'Internal Server Error' }, { status: 500 })
}
}- Validate all input data
- Return appropriate HTTP status codes
- Use consistent response formats
- Implement proper authentication checks for protected routes
import { NextResponse } from 'next/server'
import connectDB from '@/lib/db'
export async function POST(request: Request) {
try {
const body = await request.json()
// Validate input
if (!body.name || !body.email) {
return NextResponse.json(
{ error: 'Name and email are required' },
{ status: 400 }
)
}
await connectDB()
// ... process request
return NextResponse.json({ success: true }, { status: 201 })
} catch (error) {
console.error('API error:', error)
return NextResponse.json(
{ error: 'Internal Server Error' },
{ status: 500 }
)
}
}We follow Conventional Commits for clear and consistent commit messages.
<type>(<scope>): <description>
[optional body]
[optional footer]
| Type | Description |
|---|---|
feat |
A new feature |
fix |
A bug fix |
docs |
Documentation changes |
style |
Code style changes (formatting, semicolons, etc.) |
refactor |
Code changes that neither fix bugs nor add features |
perf |
Performance improvements |
test |
Adding or updating tests |
chore |
Maintenance tasks (dependencies, configs, etc.) |
ci |
CI/CD configuration changes |
# Feature
feat(sessions): add filtering by category
# Bug fix
fix(auth): resolve token expiration issue
# Documentation
docs(readme): update installation instructions
# Refactor
refactor(api): simplify mentor route handlers- Keep commits small and focused on a single change
- Write commit messages in imperative mood ("Add feature" not "Added feature")
- Reference issue numbers when applicable:
fix(auth): resolve login bug (#123)
- Code follows the project's coding guidelines
- Self-reviewed all changes
-
npm run lintpasses without errors -
npm run buildcompletes successfully - No sensitive data (secrets, API keys) is committed
- Updated documentation if needed
Use the same format as commit messages:
feat(component): add new feature description
fix(api): resolve specific bug
docs(contributing): update guidelines
- Describe what the PR does
- Explain why the change is needed
- Note how to test the changes
- Include screenshots for UI changes
- Reference related issues
- Automated checks must pass (lint, build)
- At least one maintainer approval is required
- Address review feedback promptly
- Once approved, a maintainer will merge your PR
- Delete your feature branch
- Celebrate! 🎉 You've contributed to open source!
web-platform/
├── .github/ # GitHub templates and workflows
│ ├── ISSUE_TEMPLATE/ # Issue templates
│ └── PULL_REQUEST_TEMPLATE.md
├── app/ # Next.js App Router
│ ├── admin/ # Admin dashboard
│ ├── ambassador/ # Ambassador portal
│ ├── mentor/ # Mentor portal
│ ├── api/ # API routes
│ └── ... # Public pages
├── components/ # React components
│ ├── ui/ # Primitive components
│ └── ... # Feature components
├── lib/ # Utilities
│ ├── db.ts # Database connection
│ ├── auth.ts # Auth helpers
│ └── jwt.ts # JWT utilities
├── models/ # Mongoose models
├── public/ # Static assets
├── types/ # TypeScript types
├── .env.example # Environment template
├── CODE_OF_CONDUCT.md # Community guidelines
├── CONTRIBUTING.md # This file
├── LICENSE # MIT License
├── README.md # Project overview
└── SECURITY.md # Security policy
While we don't have extensive automated tests yet, please ensure:
- Manual testing of your changes
- Cross-browser testing for UI changes
- Mobile responsiveness verification
- Authentication flows work correctly for protected features
We welcome contributions to improve our testing infrastructure!
- 📖 README – Project overview and setup
- 📁 Project Structure – Code organization
- 🔒 Security Policy – Reporting vulnerabilities
- 💬 Issues – For bugs and feature requests
- 🔗 Community – Join our community channels
- 📧 Email – devweekends@gmail.com for sensitive matters
- Look for similar existing code and follow the same patterns
- When in doubt, ask! Open an issue to discuss your approach
- Start small – even documentation improvements are valuable
Thank you for contributing to Dev Weekends! Your efforts help us build a better platform for our community of learners and mentors. 🚀
Happy coding! ✨