Development Setup
This guide covers how to set up your local development environment and contribute to ShipKit.
Prerequisites
Before you begin, ensure you have the following installed:
Getting Started
Clone the Repository
Install Dependencies
Environment Setup
Required environment variables:
Development Services
Using Docker Compose for local services:
Database Setup
Development Workflow
Running the Application
Testing
Code Quality
Git Workflow
Branching Strategy
We follow a trunk-based development workflow:
- Create feature branches from
main
- Keep branches short-lived (1-2 days max)
- Rebase frequently to stay up to date
Commit Guidelines
We use conventional commits for clear history:
Types:
feat
: New feature
fix
: Bug fix
docs
: Documentation
style
: Formatting
refactor
: Code restructuring
test
: Tests
chore
: Maintenance
Pull Requests
- Title: Use conventional commit format
- Description: Include:
- What changes were made
- Why changes were needed
- How to test changes
- Screenshots (if UI changes)
Example PR template:
Code Style
TypeScript
React Components
Project Structure
Common Issues
Database Connection
If you can't connect to the database:
- Check if PostgreSQL is running
- Verify
DATABASE_URL
is correct
- Ensure database exists
- Check network/firewall settings
Build Errors
For build errors:
- Clear Next.js cache:
rm -rf .next
- Remove dependencies:
rm -rf node_modules
- Clean install:
pnpm install
- Rebuild:
pnpm build
Type Errors
For TypeScript errors:
- Run
pnpm typecheck
for details
- Update types:
pnpm db:generate
- Check
tsconfig.json
settings
- Verify package versions match
Best Practices
Code Quality
-
Testing
- Write tests for new features
- Maintain high coverage
- Use meaningful assertions
-
Documentation
- Document new features
- Update existing docs
- Include code examples
-
Performance
- Profile before optimizing
- Consider bundle size
- Use performance tools
Security
-
Secrets
- Never commit secrets
- Use environment variables
- Rotate compromised keys
-
Dependencies
- Keep dependencies updated
- Review security advisories
- Use lock files
-
Code Review
- Review security implications
- Check for vulnerabilities
- Validate input/output
Getting Help
Related Resources