Developer Quickstart Guide
This guide provides instructions for setting up your development environment to contribute to Gofannon.
Prerequisites
Before you begin, ensure you have the following installed:
- Operating System: Linux, macOS, or WSL (Windows Subsystem for Linux).
- Python: Version 3.10 or higher.
- Node.js: Version 18 or higher.
- pnpm: Version 8 or higher (Installation:
npm install -g pnpm). - Git: For version control.
1. Cloning the Project
We follow a fork-based workflow.
-
Fork the repository on GitHub to your own account.
-
Clone your fork locally:
git clone https://github.com/YOUR_USERNAME/gofannon.git
cd gofannon -
Add the upstream remote to keep your fork in sync:
git remote add upstream https://github.com/the-ai-alliance/gofannon.git
2. Setting Up the Environment
The project is a monorepo containing a Python backend and a React frontend. You will need to set up both.
Backend (Python)
-
Navigate to the user service directory:
cd webapp/packages/api/user-service -
Create a virtual environment:
python3.10 -m venv venv -
Activate the virtual environment:
- Linux/macOS:
source venv/bin/activate - Windows (PowerShell):
.\venv\Scripts\Activate.ps1
- Linux/macOS:
-
Install dependencies:
pip install -r requirements.txt
Frontend (Node.js/React)
-
Navigate to the
gofannon/webappdirectory:cd ../../../../../ # Assuming you were in the api directory -
Install dependencies using pnpm:
pnpm install
3. Running the Application Locally
Running the Backend
Ensure your virtual environment is activated (source webapp/packages/api/user-service/venv/bin/activate).
cd webapp/packages/api/user-service
uvicorn main:app --reload
The API will be available at http://localhost:8000.
Running the Frontend
cd webapp
pnpm --filter webui dev
The web UI will be available at http://localhost:5173.
4. Running Tests
We strongly encourage running tests locally before opening a Pull Request.
Backend Tests
From the webapp directory (or root), with your virtual environment from the previous step activated:
# Run backend unit tests
pnpm test:unit:backend
# Or directly from the user-service directory with active venv
cd webapp/packages/api/user-service
python -m pytest tests/unit -v
Frontend Tests
From the webapp directory:
# Run frontend unit tests
pnpm test:unit:frontend
All Tests
To run all unit tests:
cd webapp
pnpm test:unit
5. Development Conventions
To ensure a smooth collaboration process, please adhere to the following conventions:
- Fork & Branch: Always work on your own fork.
- Branch Naming:
- Use the issue number as the prefix if applicable:
XXX-short-desc(e.g.,123-fix-login-bug). - Alternatively, use
feature/orfix/prefixes if no issue exists.
- Use the issue number as the prefix if applicable:
- Commit Signing: Sign your commits using
git commit -sto certify the Developer Certificate of Origin (DCO). - Testing:
- Run existing tests to ensure no regressions.
- Add new tests for any new code or features you implement.
- Ensure
pnpm test:unitpasses before submitting a PR.
- Code Style: Follow the existing coding style in the project.
Thank you for contributing!