Contributing¶
Thank you for your interest in contributing to Stowaway! This guide will help you get started.
Getting Started¶
1. Fork the Repository¶
Click the "Fork" button on GitHub to create your own copy.
2. Clone Your Fork¶
3. Create a Branch¶
4. Set Up Development Environment¶
# Install dependencies
npm install
# Set up environment
cp .env.example .env
# Run database migrations
npx prisma migrate dev
# Start development server
npm run dev
Development Workflow¶
Code Style¶
- We use ESLint for code linting
- Run
npm run lintbefore committing - Follow existing code patterns
- Use TypeScript strict mode
Commit Messages¶
Use clear, descriptive commit messages following Conventional Commits:
feat: add barcode scanning feature
fix: resolve login redirect issue
docs: update API documentation
style: format code with prettier
refactor: simplify authentication logic
test: add unit tests for item API
Pull Request Process¶
- Update documentation if needed
- Run tests:
npm test - Run linter:
npm run lint - Ensure build passes:
npm run build - Create a pull request with a clear description
Project Structure¶
stowaway/
├── docs/ # Documentation (MkDocs)
├── prisma/ # Database schema & migrations
├── public/ # Static assets
├── src/
│ ├── app/
│ │ ├── (auth)/ # Authentication pages
│ │ ├── (dashboard)/ # Main application
│ │ └── api/ # REST API routes
│ ├── components/
│ │ ├── ui/ # shadcn/ui components
│ │ └── [feature]/ # Feature components
│ └── lib/ # Utilities
└── uploads/ # User uploads
Adding Features¶
New API Endpoint¶
- Create route in
src/app/api/[endpoint]/route.ts - Add Zod schema in
src/lib/validations.ts - Use
auth()for session validation - Update
SPECIFICATION.md - Add API documentation
New Page¶
- Create page in
src/app/(dashboard)/[page]/page.tsx - Add navigation link in
src/components/layout/sidebar.tsx - Create required components
Database Changes¶
- Update
prisma/schema.prisma - Run
npx prisma migrate dev --name description - Update related routes and components
- Update documentation
Testing¶
# Run unit tests
npm test
# Run E2E tests
npm run test:e2e
# Run with coverage
npm run test:coverage
Documentation¶
Documentation is built with MkDocs and hosted on GitHub Pages.
Local Preview¶
# Install Python dependencies
pip install -r requirements.txt
# Serve documentation locally
mkdocs serve
# Open http://localhost:8000
Building Docs¶
Questions?¶
- Open an issue for questions or discussion
- Join discussions on GitHub
Code of Conduct¶
Be respectful and inclusive. We follow the Contributor Covenant.