# AI Agent Quick Reference - Normogen

**Last Updated**: 2026-03-09  
**Project**: Open-source health data platform (Rust backend + React frontend)

## 🚀 Essential Commands

```bash
# Backend (Rust + Axum + MongoDB)
cd backend && cargo build              # Build
cd backend && cargo test               # Test
cd backend && cargo clippy             # Lint
cd backend && docker compose up -d     # Run

# Frontend (React + TypeScript)
cd web/normogen-web && npm install     # Setup
cd web/normogen-web && npm start       # Dev server
cd web/normogen-web && npm test        # Test

# Testing
./docs/testing/quick-test.sh           # Quick tests
./docs/testing/test-api-endpoints.sh   # API tests
```

## 📁 Key Locations

```
backend/src/
├── handlers/       # API endpoints (auth, users, medications)
├── models/         # Data models + repositories
├── middleware/     # JWT auth, rate limiting
├── services/       # Business logic
├── config/         # Environment config
└── main.rs         # Entry point, router setup

web/normogen-web/src/
├── pages/          # Route components
├── components/     # Reusable components
├── services/       # API calls (axios)
├── store/          # Zustand state
└── types/          # TypeScript types
```

## 🔑 Patterns

### Add API Endpoint (Rust)
```rust
// 1. Add model in src/models/
// 2. Add handler in src/handlers/
// 3. Register route in src/main.rs
.route("/api/new-endpoint", post(handlers::new_handler))
```

### Add Frontend Page (React)
```typescript
// 1. Add types in src/types/api.ts
// 2. Add API call in src/services/api.ts
// 3. Add store in src/store/useStore.ts
// 4. Create page in src/pages/
```

## 📊 Current Status

- **Phase**: 2.8 (Drug Interactions & Advanced Features)
- **Backend**: ~91% complete
- **Frontend**: ~10% complete
- **Auth**: JWT (15min access, 30day refresh)
- **Database**: MongoDB

## ⚠️ Important

- All protected routes require JWT
- Use environment variables for config
- Write tests for new features
- Follow commit: `feat(scope): description`
- Don't skip tests before committing

## 📚 Full Docs

- **[Complete AI Guide](./AI_AGENT_GUIDE.md)** - Detailed guide
- **[Documentation Index](./README.md)** - All documentation
- **[Current Status](./product/STATUS.md)** - Project status

---

**Quick reference for common tasks. See [AI_AGENT_GUIDE.md](./AI_AGENT_GUIDE.md) for details.**
