Files
encoach_backend_new_v2/README.md
devops 9b6a2b7c22 Merge feature/full-backend-v1 into main (initial backend codebase by Yamen)
Resolved merge conflicts in .gitignore and README.md by combining
our CI/CD workflow docs with Yamen's project documentation.

Made-with: Cursor
2026-04-01 18:10:01 +04:00

140 lines
3.5 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# EnCoach Backend — v2
## Branching Workflow
This repo is connected to the staging server via a Git post-receive hook.
**All deployment is automatic — but only after code review approval.**
### How to contribute
1. Never push directly to `main` — branch protection will block it.
2. Push your changes to your feature branch (e.g. `feature/full-backend-v1`)
3. Open a Pull Request on Gitea targeting `main`
4. Request review from **devops (Talal)**
5. Once approved and merged, the staging server rebuilds and redeploys automatically.
### Environment
The `.env` file is **not committed**. It lives only on the staging server at `/opt/encoach/backend-v2/.env`.
---
# Odoo 19 Community Local setup (macOS)
Run Odoo 19 Community on your Mac.
---
## Option A: Run with Docker (easiest)
No Python or PostgreSQL needed on your machine.
**Requirements:** [Docker Desktop](https://www.docker.com/products/docker-desktop/) for Mac.
```bash
cd /Users/yamenahmad/projects2026/odoo/odoo19
docker compose up -d
```
Open **http://localhost:8069**. First time: create a new database (name, email, password).
**Test that its running:**
```bash
./test_odoo.sh
```
Stop: `docker compose down`
---
**Manual terminal guide (no scripts):** see **[MANUAL-RUN.md](MANUAL-RUN.md)** for step-by-step commands only.
---
## Option B: Run from source (venv + PostgreSQL)
## Prerequisites
- **macOS** (Sonoma, Ventura, or Monterey)
- **Homebrew** [brew.sh](https://brew.sh) install with:
```bash
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
```
- **Xcode Command Line Tools** (for compilers):
```bash
xcode-select --install
```
## 1. Install PostgreSQL and wkhtmltopdf
```bash
brew install postgresql@15 wkhtmltopdf
brew services start postgresql@15
```
Create an Odoo database user (optional; you can also use your macOS user):
```bash
# Using your current user (no password by default on Mac)
createuser -s $(whoami)
# Or create a dedicated user with password:
createuser -s odoo
# Then in psql: ALTER USER odoo WITH PASSWORD 'odoo';
```
## 2. Run the setup script
From this directory:
```bash
chmod +x setup.sh
./setup.sh
```
This will:
- Clone Odoo 19.0 into `./odoo/`
- Create a Python virtual environment in `./venv/`
- Install Python dependencies from `odoo/requirements.txt`
## 3. Configure Odoo (optional)
Copy the example config and edit if needed:
```bash
cp odoo.conf.example odoo.conf
```
- **db_user**: your PostgreSQL user (e.g. your Mac username or `odoo`)
- **db_password**: leave empty if you use trust auth (typical on Mac)
- **addons_path**: defaults to `odoo/addons` (Community only)
## 4. Run Odoo
```bash
./run.sh
```
Or manually:
```bash
source venv/bin/activate
cd odoo && ./odoo-bin -c ../odoo.conf
```
- Open **http://localhost:8069**
- First run: create a new database (name, email, password, language)
- Default admin login after creating DB: email `admin`, password `admin` (if you use the demo setup)
## Useful options
- **Custom database name:** `./odoo-bin -c odoo.conf -d mydb`
- **Development mode (auto-reload):** add `--dev=all` to the command
- **Install modules at start:** `-i sale,crm` (comma-separated)
## Troubleshooting
- **Port 8069 in use:** change `xmlrpc_port` in `odoo.conf` or run with `--http-port=8070`
- **PostgreSQL connection refused:** ensure its running: `brew services start postgresql@15`
- **Python / pip errors:** use Python 3.10, 3.11, or 3.12; create a fresh venv and run `pip install -r odoo/requirements.txt` again