Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • W Wiki
  • Project information
    • Project information
    • Activity
    • Labels
    • Planning hierarchy
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Infrastructure Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Módulo de Nutrição
  • Wiki
  • Wiki
  • configuracao

configuracao · Changes

Page history
Atualização de configuracao authored Jun 27, 2026 by Guilherme Ochoa's avatar Guilherme Ochoa
Show whitespace changes
Inline Side-by-side
configuracao.md
View page @ 500cf954
| [Home](home) | [Escopo](escopo) | [Processo](processo) | [Design/Mockups](design_mockups) | [**Configuração**](configuracao) | [Arquitetura](arquitetura) | [Gerência](gerencia) | [BD](banco_de_dados) | [Qualidade](qualidade) | [Frontend](frontend) | [Backend](backend) | <!-- ═══════════════════════════════════════════════════════════════ -->
| :----------: | :------------------: | :------------------: | :------------------------------: | :--------------------------: | :------------------------: | :------------------: | :------------------: | :--------------------: | :------------------: | :----------------: | <!-- PÁGINA: home.md -->
<!-- ═══════════════════════════════════════════════════════════════ -->
# Configuração de Ambiente # 🏠 Home — Wiki do Projeto NITRA
Esta página descreve os passos necessários para configurar o ambiente de desenvolvimento do projeto NITRA. Bem-vindo à Wiki oficial do projeto **NITRA** (Nutrição Integrada e Rastreamento de Assistência)! Este espaço centraliza toda a documentação técnica e de processo do módulo de nutrição hospitalar integrado à plataforma open source NoHarm.
## Sumário ## Navegação
- [Pré-requisitos](#pré-requisitos) | [**Home**](home) | [Escopo](escopo) | [Processo](processo) | [Design/Mockups](design_mockups) | [Configuração](configuracao) | [Arquitetura](arquitetura) | [Gerência](gerencia) | [BD](banco_de_dados) | [Qualidade](qualidade) | [Frontend](frontend) | [Backend](backend) |
- [Backend – Opção A: Docker (recomendado)](#backend--opção-a-docker-recomendado) | :--------------: | :--------------: | :------------------: | :------------------------------: | :--------------------------: | :------------------------: | :------------------: | :------------------: | :--------------------: | :------------------: | :----------------: |
- [Backend – Opção B: Python local](#backend--opção-b-python-local)
- [Frontend](#frontend)
- [Variáveis de Ambiente](#variáveis-de-ambiente)
- [Banco de Testes](#banco-de-testes)
--- ---
## Pré-requisitos ## Sobre o Projeto
| Ferramenta | Versão mínima | Link | > **NITRA** é um módulo de nutrição hospitalar integrado à plataforma open source NoHarm. O sistema automatiza a triagem de risco nutricional de pacientes internados utilizando os protocolos clínicos NRS-2002 (alas de internação) e mNUTRIC modificado sem IL-6 (UTI), oferece suporte ao diagnóstico GLIM pelo nutricionista e monitora instabilidade nutricional via gatilhos laboratoriais, clínicos e de prescrição.
|------------|---------------|------|
| Git | – | [git-scm.com](https://git-scm.com) | ## Stack Principal
| Python | 3.11+ | [python.org](https://python.org) |
| Node.js | 18+ | [nodejs.org](https://nodejs.org) | | Camada | Tecnologia |
| npm | – | Incluído no Node.js | |--------|------------|
| Docker | – | [docker.com](https://docker.com) | | Frontend | React 18 · Redux Toolkit · TypeScript · Vite 6 · Ant Design · Styled Components |
| Docker Compose | – | Incluído no Docker Desktop | | Backend | Python 3.11 · Flask 3.0.3 · SQLAlchemy 2.0.29 · APScheduler |
| Banco de Dados | PostgreSQL (multi-tenant por schema) |
## Backend – Opção A: Docker (recomendado) | Infraestrutura | AWS (EC2, S3, RDS, Lambda, Bedrock, Route 53, CloudFront) |
| CI/CD | GitHub Actions · SonarCloud · CodeRabbit · Terraform (IaC) |
```bash | Versionamento | GitHub (organização `noharm-nutricao`) |
git clone https://github.com/noharm-nutricao/nutricao-backend.git
cd nutricao-backend ## Equipe
# Pré-requisito: clonar o repositório do banco | Nome | Nível |
git clone https://github.com/noharm-nutricao/nutricao-database.git |------|-------|
| **Larissa da Rosa Feix** | Stakeholder (NoHarm) |
# Editar docker-compose.nitra.yml – substituir path do database nos volumes | **Etielle Pereira Sonaglio** | Stakeholder (NoHarm) |
# Procurar: # !!!! Adicione aqui o path para o projeto do database !!!! | **Prof. Dr. Afonso Henrique Corrêa de Sales** | Professor Orientador |
| Felipe Frison | AGES IV |
docker compose -f docker-compose.nitra.yml up --build | Guilherme Ochôa | AGES IV |
``` | Lucas Ramon S. | AGES IV |
| Otavio Biazetto | AGES IV |
Serviços disponíveis: | Willian Weyh | AGES III |
| Gabriel Teiga | AGES III |
| Serviço | URL | | Luana Farias | AGES III |
|---------|-----| | Henrique Knack | AGES III |
| API Flask | http://localhost:5000 | | Pedro Widholzer | AGES II |
| Prometheus | http://localhost:9090 | | Vinicius Matos | AGES II |
| Grafana | http://localhost:3000 (admin/admin) | | Mateus Tieppo | AGES II |
| Matheus Neubarth | AGES II |
## Backend – Opção B: Python local | Yasmin Weber | AGES I |
| Vanessa Rutkoski | AGES I |
```bash | João Victor Bonatto | AGES I |
git clone https://github.com/noharm-nutricao/nutricao-backend.git | Gabriel Tavares | AGES I |
cd nutricao-backend
## Links Úteis
python3 -m venv env
source env/bin/activate # Linux/macOS - 🔗 [Repositório Backend](https://github.com/noharm-nutricao/nutricao-backend)
pip install -r requirements.txt - 🔗 [Repositório Frontend](https://github.com/noharm-nutricao/nutricao-frontend)
- 🔗 [Repositório Database](https://github.com/noharm-nutricao/nutricao-database)
python mobile.py - 📋 [GitHub Projects — Board de tarefas](https://github.com/orgs/noharm-nutricao/projects)
``` - 📄 [Wiki Backend](https://github.com/noharm-nutricao/nutricao-backend/wiki)
- 📄 [Wiki Frontend](https://github.com/noharm-nutricao/nutricao-frontend/wiki)
Requer PostgreSQL acessível e variáveis de ambiente configuradas. \ No newline at end of file
## Frontend
```bash
git clone https://github.com/noharm-nutricao/nutricao-frontend.git
cd nutricao-frontend
npm install
npm run dev
```
A aplicação fica disponível em `http://localhost:3000`.
## Variáveis de Ambiente
### Backend – `.env`
Não existe `.env.example` – usar esta referência:
```env
ENV=development
SECRET_KEY=
# Atenção: typo "POT" herdado do NoHarm – NÃO corrigir
POTGRESQL_CONNECTION_STRING=postgresql://user:pass@localhost:5432/noharm
REPORT_CONNECTION_STRING=postgresql://user:pass@localhost:5432/noharm
REDIS_HOST=localhost
REDIS_PORT=6379
# Job periódico (padrão: 3 minutos)
SCHEDULER_INTERVAL_MINUTES=3
# LLM (AWS Bedrock via Lambda)
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_REGION=us-east-1
NIFI_BUCKET_NAME=
CACHE_BUCKET_NAME=
SCORES_FUNCTION_NAME=
BACKEND_FUNCTION_NAME=
```
### Frontend – `.env.local`
```env
VITE_APP_API_URL=/api
```
O proxy Vite em `vite.config.ts` redireciona `/api` para `localhost:5000`.
> ⚠️ **Todas as variáveis do frontend usam prefixo `VITE_APP_` e são acessadas via `import.meta.env`.**
## Banco de Testes
Setup inicial (rodar uma vez):
```bash
make test-setup
```
Sobe Docker com PostgreSQL 16-alpine e carrega o schema automaticamente via `scripts/setup-test-db.sh`.
\ No newline at end of file
Clone repository
  • Nitra
  • arquitetura
  • backend
  • banco_de_dados
  • configuracao
  • design_mockups
  • escopo
  • frontend
  • gerencia
  • Home
  • processo
  • qualidade