Skip to content

Latest commit

 

History

History
161 lines (117 loc) · 3.71 KB

File metadata and controls

161 lines (117 loc) · 3.71 KB

Contributing to SMKN 32 Smart Assist

Thank you for contributing to the SMKN 32 Smart Assist project! This document outlines our development workflow and branching strategy.

Branching Strategy

This is a monorepo with separate frontend and backend directories. We use a bidirectional auto-sync strategy to keep all branches updated while maintaining clear ownership boundaries.

Branch Overview

Branch Purpose Developers Directory Access
main Production code All (read-only) All directories
frontend-dev Frontend development Frontend team Can only modify frontend/
backend-dev Backend development Backend team Can only modify backend/

Development Workflow

For Frontend Developers

  1. Clone and checkout frontend-dev:

    git clone https://github.com/BinaryNeedle/SMKN32SmartAssist.git
    cd SMKN32SmartAssist
    git checkout frontend-dev
  2. Make changes (only in frontend/ directory):

    cd frontend
    # Make your changes
    git add .
    git commit -m "feat(frontend): your feature description"
  3. Push to frontend-dev:

    git push origin frontend-dev
  4. Automatic sync (handled by GitHub Actions):

    • Your changes auto-merge to main
    • main auto-syncs to backend-dev
    • Backend developers get your latest changes!

For Backend Developers

Same process, but work in backend/ directory:

git checkout backend-dev
cd backend
# Make your changes
git add .
git commit -m "feat(backend): your feature description"
git push origin backend-dev

What You Get

Full monorepo on your branch - Run both frontend and backend locally
Automatic syncing - No manual merges needed
Latest code - Always have the other team's latest changes
Clear boundaries - Can't accidentally modify the wrong directory

PR Validation

Our CI automatically blocks pull requests that violate directory ownership:

  • ❌ Frontend PR touching backend/Rejected
  • ❌ Backend PR touching frontend/Rejected
  • ✅ Frontend PR touching only frontend/Allowed
  • ✅ Backend PR touching only backend/Allowed

Running Locally

Frontend:

cd frontend
npm install
npm run dev
# Open http://localhost:3000

Backend (Bun/TypeScript):

cd backend
bun install
bun run dev
# Backend runs on http://localhost:8000

Both together:

# Terminal 1
cd frontend && npm run dev

# Terminal 2  
cd backend && bun run dev

Commit Message Guidelines

We use semantic commit messages:

<type>(<scope>): <short description>

[optional body]

[optional footer]

Types

  • feat: New feature
  • fix: Bug fix
  • docs: Documentation changes
  • style: Code style changes (formatting, no logic change)
  • refactor: Code refactoring
  • test: Adding tests
  • chore: Maintenance tasks

Scopes

  • frontend: Changes in frontend/ directory
  • backend: Changes in backend/ directory
  • ci: CI/CD workflow changes

Examples

feat(frontend): add chat history pagination
fix(backend): resolve RAG embedding timeout
docs: update README with deployment guide
chore(ci): add PR validation workflow

Code Quality

Frontend

  • Use ESLint and Prettier
  • Run npm run lint before committing
  • Write TypeScript (avoid any types)

Backend

  • Use Biome for formatting
  • Run bun run format before committing
  • Add structured logging (no console.log)

Questions?

  • Technical issues: Open a GitHub issue
  • Security concerns: See backend/SECURITY.md
  • Deployment: See backend/DEPLOYMENT.md

Happy coding! 🚀