Contributing
Contributing
Section titled “Contributing”Thank you for your interest in contributing to Stowaway! This guide will help you get started.
Getting Started
Section titled “Getting Started”1. Fork the Repository
Section titled “1. Fork the Repository”Click the “Fork” button on GitHub to create your own copy.
2. Clone Your Fork
Section titled “2. Clone Your Fork”git clone https://github.com/yourusername/stowaway.gitcd stowaway3. Create a Branch
Section titled “3. Create a Branch”git checkout -b feature/your-feature-name4. Set Up Development Environment
Section titled “4. Set Up Development Environment”# Install dependenciesnpm install
# Set up environmentcp .env.example .env
# Run database migrationsnpx prisma migrate dev
# Start development servernpm run devDevelopment Workflow
Section titled “Development Workflow”Code Style
Section titled “Code Style”- We use ESLint for code linting
- Run
npm run lintbefore committing - Follow existing code patterns
- Use TypeScript strict mode
Commit Messages
Section titled “Commit Messages”Use clear, descriptive commit messages following Conventional Commits:
feat: add barcode scanning featurefix: resolve login redirect issuedocs: update API documentationstyle: format code with prettierrefactor: simplify authentication logictest: add unit tests for item APIPull Request Process
Section titled “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
Section titled “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 uploadsAdding Features
Section titled “Adding Features”New API Endpoint
Section titled “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
Section titled “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
Section titled “Database Changes”- Update
prisma/schema.prisma - Run
npx prisma migrate dev --name description - Update related routes and components
- Update documentation
Testing
Section titled “Testing”# Run unit testsnpm test
# Run E2E testsnpm run test:e2e
# Run with coveragenpm run test:coverageDocumentation
Section titled “Documentation”Documentation is built with MkDocs and hosted on GitHub Pages.
Local Preview
Section titled “Local Preview”# Install Python dependenciespip install -r requirements.txt
# Serve documentation locallymkdocs serve
# Open http://localhost:8000Building Docs
Section titled “Building Docs”mkdocs buildQuestions?
Section titled “Questions?”- Open an issue for questions or discussion
- Join discussions on GitHub
Code of Conduct
Section titled “Code of Conduct”Be respectful and inclusive. We follow the Contributor Covenant.