2.3 KiB
2.3 KiB
Project: ComFi Management System
Overview
ComFi is a React-based financial and management dashboard.
- Frontend: React 19, Vite, TypeScript.
- Serving (Production): Node.js (Express) via
server.js. - State Management: Context API (
ComFiContext,ToastContext). - Styling: CSS / Lucide React icons.
Architecture
Current (Local)
- Dev Server:
vite(HMR, local dev). - Prod Preview:
node server.jsservingdist/.
Target (Production)
- Containerization: Docker (Multi-stage build).
- Orchestration: Docker Swarm (managed via Portainer).
- CI/CD: Gitea Actions.
- Reverse Proxy: Traefik or Nginx (implied by Swarm/Portainer setup, usually handles SSL termination).
Deployment Roadmap
1. Dockerization
- Create
Dockerfile:- Stage 1 (Builder): Install deps, run
npm run buildto generatedist/. - Stage 2 (Runner): Alpine Node image, copy
dist/,server.js, andpackage.json. Runnpm install --production.
- Stage 1 (Builder): Install deps, run
- Create
docker-compose.ymlfor local testing of the production build.
2. CI/CD (Gitea Actions)
- Define workflow
.gitea/workflows/deploy.yaml. - Steps:
- Checkout code.
- Login to Container Registry.
- Build and Push Docker Image (tagged with commit SHA and
latest). - Trigger Deployment (Portainer Webhook).
3. Portainer & Swarm Configuration
- Stack Definition: A
docker-composestyle file for Swarm. - Secrets Management:
- Registry Credentials (if private).
- Environment variables (if any, e.g., API endpoints).
- Update Mechanism: Webhook URL provided by Portainer Service.
Required Configuration & Secrets
To proceed, we will need to define:
- Registry URL:
gitea.blyzer.com.br - Image Name:
gitea.blyzer.com.br/blyzer/comfi - Portainer Webhook: The URL Portainer provides to trigger a service update.
Secrets (Gitea)
Set these in your Gitea repository settings (Settings > Actions > Secrets):
REGISTRY_USERNAME: Your Gitea username.REGISTRY_TOKEN: Your Gitea password or token.PORTAINER_WEBHOOK: The full webhook URL from Portainer.API_KEY: (Optional) Google GenAI API key.
Directives
- Conventions: Follow existing TypeScript and React patterns.
- Safety: Do not commit
.envfiles. - Style: Maintain the clean, dashboard-style UI.