Welcome
Welcome to the DeltaHacks Portal project! This guide will help you get started as a DeltaHacks technical team member and provide you with the guidelines for contributing to the project.Getting Started
As a new DeltaHacks technical team member working on this project:- Clone the repository to your local machine
- Set up your development environment (see setup guide below)
- Create a feature branch for your work
- Make your changes following our guidelines
- Submit a pull request when you’re ready
Development Setup
Prerequisites
Required Software
Required Software
- Node.js (version 18 or higher) - Download
- pnpm (package manager) - Install:
npm install -g pnpm - Git - Download
- Docker - Required for local database
- Recommended: OrbStack - Fast, lightweight Docker alternative for macOS
- Alternative: Docker Desktop
Recommended Tools
Recommended Tools
- VSCode - Recommended IDE
- Extensions:
Installation Steps
Set up the database
setup-db.sh script:- Checks for Docker or Podman installation
- Creates a CockroachDB container if it doesn’t exist
- Starts the database on port 26257
- Provides a web UI on port 8080
Project Structure
Technology Stack
This project uses the T3 Stack:Next.js
React framework for the application
TypeScript
Type safety across the entire stack
Prisma
Database ORM for CockroachDB
tRPC
End-to-end typesafe APIs
NextAuth.js
Authentication with OAuth
TailwindCSS
Utility-first CSS framework
Code Organization
- Components: Place reusable components in
src/components/ - Pages: Use the app directory for new pages, legacy pages are in
src/pages/ - API Routes: Place API routes in
src/app/api/ - Database: Use Prisma for all database operations
- Validation: Use Zod schemas for input validation
Development Guidelines
Best Practices
Type Safety
Always use TypeScript and avoid
any typesError Handling
Implement proper error handling and user feedback
Accessibility
Follow WCAG guidelines and use semantic HTML
Performance
Optimize for performance and consider bundle size
Security
Validate all inputs and follow security best practices
Documentation
Document complex logic and public APIs
Code Style
TypeScript
- Use strict TypeScript configuration
- Prefer interfaces over types for object shapes
- Use proper type annotations
- Avoid type assertions unless absolutely necessary
React
- Use functional components with hooks
- Follow React best practices
- Use proper prop types and interfaces
- Implement proper error boundaries
State Management Best Practices
Avoid unnecessary useState
Avoid unnecessary useState
Don’t use state for values that can be derived from props or other state:Don’t use state for values that don’t trigger re-renders:
Cache expensive calculations
Cache expensive calculations
Avoid unnecessary Effects
Avoid unnecessary Effects
- If you can calculate something during render, you don’t need an Effect
- To cache expensive calculations, use
useMemoinstead ofuseEffect - Code that runs because a component was displayed should be in Effects
- Code that runs because a user did something should be in event handlers
Styling
- Use TailwindCSS for styling
- Follow the existing design system
- Use CSS custom properties for theming
- Ensure responsive design
File Naming
- Use PascalCase for components:
MyComponent.tsx - Use camelCase for utilities:
myUtility.ts - Use kebab-case for pages:
my-page.tsx
Database Changes
Making Schema Changes
Database Guidelines
- Always create migrations for schema changes
- Test migrations on a copy of production data when possible
- Document breaking changes in PR description
- Use proper relationships and constraints
- Consider migration rollback strategy
Pull Request Process
Before Submitting
Pull Request Guidelines
- Use descriptive titles and descriptions
- Reference related issues using keywords (Fixes #123, Closes #456)
- Include screenshots for UI changes
- Describe the changes and their impact
- Request reviews from appropriate team members
PR Template
Commit Messages
Use conventional commit messages:Development Commands
Testing
Running Tests
Writing Tests
Getting Help
Contact Channels
- Discord: Ask for help in the
#technical-chatchannel - GitHub: Comment on pull requests or issues
- Email: tech@deltahacks.com
Technical VP Support Policy
This follows the Slack Engineering intern pattern where you must demonstrate your problem-solving process before seeking help. The key question to ask yourself is: “Will I learn anything from spending more time on this?”When to Ask for Help Immediately
Formatting and syntax issues
Formatting and syntax issues
Straightforward technical questions with clear answers.Example: “How do I fix this TypeScript error?” or “What’s the correct import syntax?”
Which function to call
Which function to call
Knowledge-based questions about the codebase.Example: “Which tRPC procedure should I use to get user data?” or “Where is the email sending function?”
Environment setup issues
Environment setup issues
Problems with local development environment.Example: “Docker won’t start” or “Database connection failing”
When to Spend More Time First
How a function works internally
How a function works internally
Understanding-based questions requiring deeper comprehension.What to do: Read the code, add console.logs, step through with debugger
State management issues
State management issues
How state changes flow through the application.What to do: Use React DevTools, trace data flow, read React docs
Logic bugs
Logic bugs
Code that runs but produces incorrect results.What to do: Debug step-by-step, test edge cases, review logic
Before Reaching Out
You must:- Attempt to solve the problem yourself - Research, debug, try different approaches
- Create a pull request - Show your attempted solution, even if it doesn’t work
- Document your process - Explain what you tried, why it didn’t work, what you learned
- Come prepared - Bring specific questions about what you’ve already attempted
How to Ask for Help Effectively
When you do reach out, include:“I’m trying to add email notifications when an application is reviewed. I tried using SendGrid in the tRPC mutation, but emails aren’t sending. I checked: (1) API key is set, (2) email template exists, (3) no errors in logs. Here’s my PR: #123. Question: Should I be using a background job instead of sending inline?”Bad Example:
“Emails not working, can you help?”
Reporting Issues
Bug Reports
When reporting bugs, include:- Clear description of the issue
- Steps to reproduce
- Expected vs actual behavior
- Environment details (browser, OS, Node version)
- Screenshots or videos if applicable
- Error messages (full stack trace)
Feature Requests
When requesting features, include:- Clear description of the feature
- Use case and benefits
- Implementation suggestions if any
- Priority level (low, medium, high)
Resources
Documentation
Learning Resources
Code Review Guidelines
As a Reviewer
- Be constructive and respectful
- Explain why changes are needed
- Suggest alternatives when possible
- Approve when ready or request changes clearly
- Focus on:
- Code correctness
- Security implications
- Performance concerns
- Maintainability
- Test coverage
As an Author
- Respond to all comments
- Ask questions if feedback is unclear
- Make requested changes or discuss alternatives
- Re-request review after addressing feedback
- Thank reviewers for their time
Additional Notes
Don’t Commit
.envfilesnode_modules/- Build artifacts (
dist/,.next/) - IDE-specific files (
.vscode/,.idea/) - OS files (
.DS_Store,Thumbs.db) - Sensitive data or credentials
Do Commit
- Source code
- Configuration files (
.env.example) - Documentation
- Tests
- Database migrations
- Type definitions
Welcome to the team! We’re excited to have you working on the DeltaHacks Portal project! 🚀 For more information: