- Initialize Next.js 15.5.4 with TypeScript and App Router - Configure Tailwind CSS v4 with ShadCN UI component library - Set up OpenNext for Cloudflare Workers deployment - Add Gitea Actions workflows for CI/CD (lint, build, deploy) - Create issue templates (bug, feature, question) and PR template - Add comprehensive CONTRIBUTING.md and README.md documentation - Configure build scripts and deployment configuration
6.6 KiB
Contributing to Biohazard VFX Website
Thank you for contributing to the official Biohazard VFX website! This document provides guidelines and instructions for internal developers working on this project.
Table of Contents
- Getting Started
- Development Workflow
- Coding Standards
- Git Workflow
- Pull Request Process
- Testing
- Deployment
Getting Started
Prerequisites
- Node.js 20.x or higher
- npm (comes with Node.js)
- Git
- A code editor (VS Code recommended)
Initial Setup
-
Clone the repository:
git clone <repository-url> cd biohazard-vfx-website -
Install dependencies:
npm install -
Create your environment file:
cp .env.example .env.localFill in the required environment variables.
-
Start the development server:
npm run dev -
Open http://localhost:3000 in your browser.
Development Workflow
Branch Strategy
main- Production branch, always deployabledevelop- Development branch for integration- Feature branches -
feature/descriptionorfeature/issue-number-description - Bug fix branches -
fix/descriptionorfix/issue-number-description - Hotfix branches -
hotfix/description
Starting New Work
-
Always create a new branch from
develop:git checkout develop git pull origin develop git checkout -b feature/your-feature-name -
Make your changes and commit regularly with clear messages.
-
Keep your branch up to date:
git fetch origin git rebase origin/develop
Coding Standards
TypeScript
- Use TypeScript for all new code
- Avoid using
anytype; use proper types orunknown - Define interfaces for component props and API responses
- Use meaningful variable and function names
React/Next.js
- Use functional components with hooks
- Follow the App Router conventions
- Keep components small and focused (single responsibility)
- Use server components by default, client components only when needed
- Place server components in the
appdirectory - Place reusable client components in
src/components
Styling
- Use Tailwind CSS utility classes
- Follow the ShadCN UI component patterns
- Use CSS variables for theming (defined in
globals.css) - Keep custom CSS to a minimum
File Structure
src/
├── app/ # Next.js App Router pages
├── components/ # Reusable components
│ └── ui/ # ShadCN UI components
├── lib/ # Utility functions
└── hooks/ # Custom React hooks
Code Quality
-
Run linting before committing:
npm run lint -
Run type checking:
npm run type-check -
Fix auto-fixable issues:
npm run lint -- --fix
Git Workflow
Commit Messages
Follow the conventional commits format:
type(scope): subject
body (optional)
footer (optional)
Types:
feat: New featurefix: Bug fixdocs: Documentation changesstyle: Code style changes (formatting, etc.)refactor: Code refactoringperf: Performance improvementstest: Adding or updating testschore: Maintenance tasks
Examples:
feat(portfolio): add project filtering functionality
fix(header): resolve mobile menu overflow issue
docs(readme): update installation instructions
Commit Best Practices
- Make atomic commits (one logical change per commit)
- Write clear, descriptive commit messages
- Commit early and often
- Don't commit sensitive information or credentials
Pull Request Process
Before Creating a PR
-
Ensure your code builds successfully:
npm run build -
Run linting and fix any issues:
npm run lint npm run type-check -
Test your changes thoroughly in multiple browsers if applicable
-
Rebase your branch on the latest
develop:git fetch origin git rebase origin/develop
Creating a PR
-
Push your branch to the remote repository:
git push origin feature/your-feature-name -
Create a Pull Request on Gitea
- Use the PR template provided
- Fill in all relevant sections
- Link to related issues
- Add screenshots for UI changes
- Request review from appropriate team members
-
Ensure CI checks pass
- All tests must pass
- No linting errors
- Build must succeed
PR Review Process
- Address all review comments
- Make requested changes in new commits (don't force push during review)
- Mark conversations as resolved once addressed
- Request re-review after making changes
After PR Approval
- Squash commits if requested
- Merge using the "Squash and Merge" or "Rebase and Merge" option
- Delete your feature branch after merging
Testing
Manual Testing
- Test your changes in multiple browsers (Chrome, Firefox, Safari, Edge)
- Test responsive behavior on different screen sizes
- Verify accessibility (keyboard navigation, screen readers)
- Check performance (Lighthouse scores)
Automated Testing
- Write tests for new features when applicable
- Ensure existing tests pass before submitting PR
Deployment
Environments
- Development: Automatic deployment from
developbranch - Preview: Automatic deployment for each PR
- Production: Automatic deployment from
mainbranch
Deployment Process
- Changes merged to
develop→ Auto-deploy to development environment - PR opened against
main→ Auto-deploy preview environment - PR merged to
main→ Auto-deploy to production via Cloudflare
Cloudflare Configuration
- Production deployments use OpenNext build
- Environment variables are managed through Gitea Secrets
- Wrangler configuration is in
wrangler.toml
Rollback
If a deployment causes issues:
- Revert the problematic commit
- Create a hotfix PR
- Expedite review and merge
- Monitor deployment
Questions or Issues?
If you have questions or run into issues:
- Check existing documentation
- Search for similar issues in the issue tracker
- Ask in the team chat
- Create a new issue using the question template
Additional Resources
- Next.js Documentation
- Tailwind CSS Documentation
- ShadCN UI Documentation
- OpenNext Documentation
- Cloudflare Workers Documentation
Thank you for contributing to Biohazard VFX! Your work helps us showcase amazing visual effects to the world.