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
Hide 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)
- [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)
| [**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) |
| :--------------: | :--------------: | :------------------: | :------------------------------: | :--------------------------: | :------------------------: | :------------------: | :------------------: | :--------------------: | :------------------: | :----------------: |
---
## Pré-requisitos
| Ferramenta | Versão mínima | Link |
|------------|---------------|------|
| Git | – | [git-scm.com](https://git-scm.com) |
| Python | 3.11+ | [python.org](https://python.org) |
| Node.js | 18+ | [nodejs.org](https://nodejs.org) |
| npm | – | Incluído no Node.js |
| Docker | – | [docker.com](https://docker.com) |
| Docker Compose | – | Incluído no Docker Desktop |
## Backend – Opção A: Docker (recomendado)
```bash
git clone https://github.com/noharm-nutricao/nutricao-backend.git
cd nutricao-backend
# Pré-requisito: clonar o repositório do banco
git clone https://github.com/noharm-nutricao/nutricao-database.git
# Editar docker-compose.nitra.yml – substituir path do database nos volumes
# Procurar: # !!!! Adicione aqui o path para o projeto do database !!!!
docker compose -f docker-compose.nitra.yml up --build
```
Serviços disponíveis:
| Serviço | URL |
|---------|-----|
| API Flask | http://localhost:5000 |
| Prometheus | http://localhost:9090 |
| Grafana | http://localhost:3000 (admin/admin) |
## Backend – Opção B: Python local
```bash
git clone https://github.com/noharm-nutricao/nutricao-backend.git
cd nutricao-backend
python3 -m venv env
source env/bin/activate # Linux/macOS
pip install -r requirements.txt
python mobile.py
```
Requer PostgreSQL acessível e variáveis de ambiente configuradas.
## 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
## Sobre o Projeto
> **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.
## Stack Principal
| Camada | Tecnologia |
|--------|------------|
| Frontend | React 18 · Redux Toolkit · TypeScript · Vite 6 · Ant Design · Styled Components |
| Backend | Python 3.11 · Flask 3.0.3 · SQLAlchemy 2.0.29 · APScheduler |
| Banco de Dados | PostgreSQL (multi-tenant por schema) |
| Infraestrutura | AWS (EC2, S3, RDS, Lambda, Bedrock, Route 53, CloudFront) |
| CI/CD | GitHub Actions · SonarCloud · CodeRabbit · Terraform (IaC) |
| Versionamento | GitHub (organização `noharm-nutricao`) |
## Equipe
| Nome | Nível |
|------|-------|
| **Larissa da Rosa Feix** | Stakeholder (NoHarm) |
| **Etielle Pereira Sonaglio** | Stakeholder (NoHarm) |
| **Prof. Dr. Afonso Henrique Corrêa de Sales** | Professor Orientador |
| Felipe Frison | AGES IV |
| Guilherme Ochôa | AGES IV |
| Lucas Ramon S. | AGES IV |
| Otavio Biazetto | AGES IV |
| Willian Weyh | AGES III |
| Gabriel Teiga | AGES III |
| Luana Farias | AGES III |
| Henrique Knack | AGES III |
| Pedro Widholzer | AGES II |
| Vinicius Matos | AGES II |
| Mateus Tieppo | AGES II |
| Matheus Neubarth | AGES II |
| Yasmin Weber | AGES I |
| Vanessa Rutkoski | AGES I |
| João Victor Bonatto | AGES I |
| Gabriel Tavares | AGES I |
## Links Úteis
- 🔗 [Repositório Backend](https://github.com/noharm-nutricao/nutricao-backend)
- 🔗 [Repositório Frontend](https://github.com/noharm-nutricao/nutricao-frontend)
- 🔗 [Repositório Database](https://github.com/noharm-nutricao/nutricao-database)
- 📋 [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)
\ No newline at end of file
Clone repository
  • Nitra
  • arquitetura
  • backend
  • banco_de_dados
  • configuracao
  • design_mockups
  • escopo
  • frontend
  • gerencia
  • Home
  • processo
  • qualidade