|
| 1 | +# Contributing to From Zero RAG |
| 2 | + |
| 3 | +Thanks for your interest in contributing! This is primarily a learning project, but improvements, bug fixes and ideas are welcome. |
| 4 | + |
| 5 | +## Getting Started |
| 6 | + |
| 7 | +### Prerequisites |
| 8 | + |
| 9 | +- [Node.js 20+](https://nodejs.org/) |
| 10 | +- [pnpm 10+](https://pnpm.io/) — `npm install -g pnpm` |
| 11 | +- [Docker + Docker Compose](https://docs.docker.com/get-docker/) |
| 12 | +- An Ollama instance or API key for Google/OpenAI embeddings |
| 13 | + |
| 14 | +### Local Setup |
| 15 | + |
| 16 | +```bash |
| 17 | +# 1. Clone the repo |
| 18 | +git clone https://github.com/albegosu/from-zero-rag.git |
| 19 | +cd from-zero-rag |
| 20 | + |
| 21 | +# 2. Install dependencies (all workspace packages) |
| 22 | +pnpm install |
| 23 | + |
| 24 | +# 3. Start the backend services (DB + Ollama) |
| 25 | +docker compose --profile api up -d |
| 26 | + |
| 27 | +# 4. Set up environment for the API |
| 28 | +cp rag-api/.env.example rag-api/.env |
| 29 | +# Edit rag-api/.env with your settings |
| 30 | + |
| 31 | +# 5. Run database migrations |
| 32 | +cd rag-api && npx prisma migrate dev && cd .. |
| 33 | + |
| 34 | +# 6. Start everything in dev mode |
| 35 | +pnpm dev |
| 36 | +``` |
| 37 | + |
| 38 | +## Project Structure |
| 39 | + |
| 40 | +``` |
| 41 | +from-zero-rag/ |
| 42 | +├── rag-api/ # NestJS backend (RAG pipeline, vector search) |
| 43 | +├── rag-ui/ # Nuxt 3 frontend (chat, document management) |
| 44 | +├── packages/ |
| 45 | +│ ├── rag-learning/ # Shared challenge/validator library |
| 46 | +│ └── rag-playground/ # Interactive learning UI |
| 47 | +└── docker-compose.yml # Full stack orchestration |
| 48 | +``` |
| 49 | + |
| 50 | +## Development Workflow |
| 51 | + |
| 52 | +1. **Fork** the repository |
| 53 | +2. **Create a branch** from `main`: `git checkout -b feat/your-feature` |
| 54 | +3. **Make your changes** and add tests if applicable |
| 55 | +4. **Run the checks** before pushing: |
| 56 | + |
| 57 | +```bash |
| 58 | +# Backend tests |
| 59 | +cd rag-api && pnpm test |
| 60 | + |
| 61 | +# Backend lint |
| 62 | +cd rag-api && pnpm lint |
| 63 | + |
| 64 | +# Learning package build |
| 65 | +pnpm --filter @rag/learning build |
| 66 | +``` |
| 67 | + |
| 68 | +5. **Open a pull request** against `main` — CI will run automatically |
| 69 | + |
| 70 | +## Branch Naming |
| 71 | + |
| 72 | +| Type | Pattern | Example | |
| 73 | +|------|---------|---------| |
| 74 | +| Feature | `feat/short-description` | `feat/streaming-responses` | |
| 75 | +| Bug fix | `fix/short-description` | `fix/chunking-offset` | |
| 76 | +| Docs | `docs/short-description` | `docs/api-endpoints` | |
| 77 | +| Chore | `chore/short-description` | `chore/update-deps` | |
| 78 | + |
| 79 | +## Commit Style |
| 80 | + |
| 81 | +Follow [Conventional Commits](https://www.conventionalcommits.org/): |
| 82 | + |
| 83 | +``` |
| 84 | +feat: add streaming support for chat responses |
| 85 | +fix: correct chunk offset calculation for unicode text |
| 86 | +docs: add deployment guide for Railway |
| 87 | +chore: update pnpm lockfile |
| 88 | +``` |
| 89 | + |
| 90 | +## What to Contribute |
| 91 | + |
| 92 | +- **Bug fixes** — especially around chunking accuracy, embedding edge cases |
| 93 | +- **New validators** for the learning playground challenges |
| 94 | +- **Documentation** improvements and clarifications |
| 95 | +- **Tests** — the backend test coverage can always grow |
| 96 | +- **UI/UX** improvements for the chat or document management views |
| 97 | + |
| 98 | +## Questions? |
| 99 | + |
| 100 | +Open an [issue](https://github.com/albegosu/from-zero-rag/issues) with your question or idea before starting large changes — it helps align effort. |
0 commit comments