chore: muta portul implicit 8000 -> 8010 (evita coliziunea cu roa2web)
start.sh, docker-compose.yml, README.md, CLAUDE.md aliniate la 8010 pentru a nu se suprapune cu backend-ul roa2web pe masina de test. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
44
README.md
44
README.md
@@ -53,9 +53,9 @@ credentialele de test (fisierul **nu** se comite).
|
||||
### 1. Porneste API-ul
|
||||
|
||||
```bash
|
||||
uvicorn app.main:app --reload --port 8000
|
||||
uvicorn app.main:app --reload --port 8010
|
||||
# sau, daca uvicorn nu e pe PATH:
|
||||
python3 -m uvicorn app.main:app --reload --port 8000
|
||||
python3 -m uvicorn app.main:app --reload --port 8010
|
||||
```
|
||||
|
||||
La prima pornire se creeaza schema SQLite si se face seed la nomenclatorul RAR (18 coduri
|
||||
@@ -75,10 +75,10 @@ python3 -m app.worker
|
||||
`start.sh` ambaleaza pornirea pe mediu (`test` / `prod`) si rol (`api` / `worker` / `both`):
|
||||
|
||||
```bash
|
||||
./start.sh test api # API pe :8000, mediu test
|
||||
./start.sh test api # API pe :8010, mediu test
|
||||
./start.sh test worker --send # worker care TRIMITE la RAR test
|
||||
./start.sh test both --send # API + worker impreuna (dev end-to-end, loguri in .run/)
|
||||
./start.sh prod api --port 8000 # API mediu prod
|
||||
./start.sh prod api --port 8010 # API mediu prod
|
||||
./start.sh prod worker --send # worker prod (NU foloseste creds de test)
|
||||
./start.sh status # stare procese + /healthz
|
||||
./start.sh stop # opreste procesele pornite cu "both"
|
||||
@@ -110,10 +110,10 @@ Cu API-ul pornit, deschide in browser:
|
||||
|
||||
| URL | Ce vezi |
|
||||
|-----|---------|
|
||||
| `http://localhost:8000/` | **Dashboard** — stare coada, banner prezentari blocate, stare worker / ultim login RAR, editor mapari operatii, browser nomenclator, sectiune **import fisier** |
|
||||
| `http://localhost:8000/docs` | **Swagger UI** — API v1 interactiv (incearca endpointurile direct din browser) |
|
||||
| `http://localhost:8000/healthz` | JSON sanatate: worker viu, ultim login RAR, adancime coada |
|
||||
| `http://localhost:8000/metrics` | metrici text (submissions pe status) |
|
||||
| `http://localhost:8010/` | **Dashboard** — stare coada, banner prezentari blocate, stare worker / ultim login RAR, editor mapari operatii, browser nomenclator, sectiune **import fisier** |
|
||||
| `http://localhost:8010/docs` | **Swagger UI** — API v1 interactiv (incearca endpointurile direct din browser) |
|
||||
| `http://localhost:8010/healthz` | JSON sanatate: worker viu, ultim login RAR, adancime coada |
|
||||
| `http://localhost:8010/metrics` | metrici text (submissions pe status) |
|
||||
|
||||
### Fluxul de import fisier (xlsx / csv) din browser
|
||||
|
||||
@@ -179,9 +179,9 @@ end-to-end pe contul de test RAR:
|
||||
|
||||
4. **Vizualizeaza prezentarile trimise** — trei feluri:
|
||||
|
||||
- **Dashboard** (`http://localhost:8000/`) — tabelul de jos arata fiecare submission cu
|
||||
- **Dashboard** (`http://localhost:8010/`) — tabelul de jos arata fiecare submission cu
|
||||
status (`sent`/`error`/...), `id_prezentare`, cod RAR si eroare. Se actualizeaza singur.
|
||||
- **API**: `curl -s http://localhost:8000/v1/prezentari` — coada locala cu statusuri.
|
||||
- **API**: `curl -s http://localhost:8010/v1/prezentari` — coada locala cu statusuri.
|
||||
- **Direct de la RAR** (confirmare independenta ca au ajuns):
|
||||
|
||||
```bash
|
||||
@@ -285,7 +285,7 @@ Ca worker-ul sa poata trimite pentru un service fara ca fiecare cerere sa-i poar
|
||||
RAR, seteaza credentialele RAR durabile pe cont (criptate Fernet at-rest):
|
||||
|
||||
```bash
|
||||
curl -s -X POST http://localhost:8000/v1/conturi/rar-creds \
|
||||
curl -s -X POST http://localhost:8010/v1/conturi/rar-creds \
|
||||
-H 'X-API-Key: rfak_...' -H 'Content-Type: application/json' \
|
||||
-d '{"email": "service@exemplu.ro", "password": "parola-rar"}'
|
||||
```
|
||||
@@ -298,16 +298,16 @@ obligatorie.
|
||||
|
||||
```bash
|
||||
# Sanatate (neprotejat)
|
||||
curl -s http://localhost:8000/healthz | python3 -m json.tool
|
||||
curl -s http://localhost:8010/healthz | python3 -m json.tool
|
||||
|
||||
# Nomenclator RAR (cache local)
|
||||
curl -s http://localhost:8000/v1/nomenclator
|
||||
curl -s http://localhost:8010/v1/nomenclator
|
||||
|
||||
# Coada de prezentari (monitorizare; momentan globala + neprotejata, vezi nota de mai sus)
|
||||
curl -s http://localhost:8000/v1/prezentari
|
||||
curl -s http://localhost:8010/v1/prezentari
|
||||
|
||||
# Trimite o prezentare -- dev (fara cheie API -> cont id=1)
|
||||
curl -s -X POST http://localhost:8000/v1/prezentari \
|
||||
curl -s -X POST http://localhost:8010/v1/prezentari \
|
||||
-H 'Content-Type: application/json' \
|
||||
-d '{
|
||||
"rar_credentials": {"email": "test@example.ro", "password": "secret"},
|
||||
@@ -321,7 +321,7 @@ curl -s -X POST http://localhost:8000/v1/prezentari \
|
||||
}'
|
||||
|
||||
# Trimite o prezentare -- service cu cheie API (account_id curge din cheie)
|
||||
curl -s -X POST http://localhost:8000/v1/prezentari \
|
||||
curl -s -X POST http://localhost:8010/v1/prezentari \
|
||||
-H 'X-API-Key: rfak_...' -H 'Content-Type: application/json' \
|
||||
-d '{
|
||||
"rar_credentials": {"email": "service@exemplu.ro", "password": "parola-rar"},
|
||||
@@ -335,7 +335,7 @@ curl -s -X POST http://localhost:8000/v1/prezentari \
|
||||
}'
|
||||
|
||||
# Import fisier prin API pentru un service (multi-tenant: contul vine din cheie)
|
||||
curl -s -X POST http://localhost:8000/v1/import \
|
||||
curl -s -X POST http://localhost:8010/v1/import \
|
||||
-H 'X-API-Key: rfak_...' -F 'file=@sample_import.xlsx'
|
||||
```
|
||||
|
||||
@@ -344,16 +344,16 @@ pune cheia prin butonul "Authorize" sau adauga header-ul `X-API-Key`.
|
||||
|
||||
```bash
|
||||
# Sanatate
|
||||
curl -s http://localhost:8000/healthz | python3 -m json.tool
|
||||
curl -s http://localhost:8010/healthz | python3 -m json.tool
|
||||
|
||||
# Nomenclator RAR (cache local)
|
||||
curl -s http://localhost:8000/v1/nomenclator
|
||||
curl -s http://localhost:8010/v1/nomenclator
|
||||
|
||||
# Coada de prezentari
|
||||
curl -s http://localhost:8000/v1/prezentari
|
||||
curl -s http://localhost:8010/v1/prezentari
|
||||
|
||||
# Trimite o prezentare (dev: fara cheie API -> cont id=1)
|
||||
curl -s -X POST http://localhost:8000/v1/prezentari \
|
||||
curl -s -X POST http://localhost:8010/v1/prezentari \
|
||||
-H 'Content-Type: application/json' \
|
||||
-d '{
|
||||
"rar_credentials": {"email": "test@example.ro", "password": "secret"},
|
||||
@@ -389,7 +389,7 @@ cp .env.example .env
|
||||
docker compose up --build
|
||||
```
|
||||
|
||||
`docker-compose.yml` porneste trei containere: `api` (port 8000), `worker` si `autoheal`
|
||||
`docker-compose.yml` porneste trei containere: `api` (port 8010), `worker` si `autoheal`
|
||||
(restarteaza worker-ul cand heartbeat-ul devine invechit). Ambele servicii folosesc acelasi
|
||||
image si acelasi volum SQLite persistent.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user