| name | developer-onboarding |
| description | Get started with CampusOS development. Use when: setting up local environment, making your first contribution, troubleshooting setup issues, understanding project structure. |
Developer Onboarding
When to Use
- First-time setup on new machine
- Contributing to CampusOS for first time
- Environment issues or dependency problems
- Understanding architecture and module organization
- Submitting first pull request
Procedure
1. Environment Setup
Clone and install:
git clone https://github.com/NITRR-Official/CampusOS.git
cd CampusOS
node --version
pnpm --version
npm install -g pnpm@8
pnpm install
cp .env.example .env.local
2. Local Development Setup
Start the database and servers:
docker run -d -p 27017:27017 --name mongodb mongo:latest
pnpm dev
3. Project Structure Understanding
Navigate key directories:
CampusOS/
├── src/ # Frontend (Next.js)
│ ├── app/ # Pages & layout
│ ├── components/ # React components
│ ├── lib/ # Utilities
│ ├── stores/ # Zustand state
│ └── styles/ # CSS & Tailwind
├── backend/ # Express server
│ ├── src/api/ # Route handlers
│ ├── middleware/ # Express middleware
│ ├── models/ # DB models
│ └── services/ # Business logic
├── apps/ # Plugin modules (foundation, execution, etc.)
├── .github/
│ ├── skills/ # Development skills
│ └── workflows/ # CI/CD
└── .humanet/ # Architecture decisions
4. First Contribution Workflow
Make your first change:
git checkout -b feature/123-your-task
pnpm test
pnpm lint
pnpm type-check
git commit -m "feat: add new feature"
git push origin feature/123-your-task
gh pr create
5. Common Daily Commands
Everyday workflows:
pnpm dev:client
pnpm dev:server
pnpm test
pnpm test:watch
pnpm test:coverage
pnpm lint --fix
pnpm type-check
pnpm format
6. Troubleshooting Common Issues
Resolve setup problems:
PORT=3002 pnpm dev
pnpm install --force
pnpm store prune
pnpm install
pnpm generate:types
rm -rf node_modules && pnpm install
node --version
Quick Reference
git clone ... && cd CampusOS && pnpm install && cp .env.example .env.local
pnpm dev
pnpm test
pnpm lint
pnpm test && pnpm lint && pnpm type-check && pnpm build
git checkout -b feature/<issue>-<desc>
git push origin feature/<issue>-<desc>
gh pr create --fill
Common Issues
| Issue | Solution |
|---|
| pnpm not found | Install: npm install -g pnpm@8 |
| Port in use | Kill: lsof -ti:3000 | xargs kill -9 |
| .env.local not working | Copy: cp .env.example .env.local. Ask maintainer for secrets. |
| DB connection fails | Check MongoDB is running (docker start mongodb). Verify MONGODB_URI. |
| TypeScript errors | Run pnpm type-check. Restart VS Code. |
| Tests fail | Clear: pnpm install. Regen types: pnpm generate:types. |
| Can't push branch | Fetch: git fetch origin. Try: git push --set-upstream origin <branch> |
| pnpm install slow | Check internet. Run pnpm store prune. |