All checks were successful
Build and Deploy / build-and-push (push) Successful in 1m54s
- Enforced tenant isolation and Role-Based Access Control across all API routes - Implemented secure profile avatar upload using multer and UUIDs - Redesigned UI with a premium "Onyx & Gold" Charcoal dark mode - Added Funnel Stage and Origin filters to Dashboard and User Detail pages - Replaced "Referral" with "Indicação" across the platform and database - Optimized Dockerfile and local environment setup for reliable deployments - Fixed frontend syntax errors and improved KPI/Chart visualizations
73 lines
3.2 KiB
Markdown
73 lines
3.2 KiB
Markdown
# Fasto Project Documentation
|
|
|
|
## Overview
|
|
Fasto is a commercial team management system built with React (Vite) on the frontend and Node.js (Express) on the backend. It uses a MySQL database.
|
|
|
|
## 🚀 Recent Major Changes (March 2026)
|
|
We have transitioned from a mock-based frontend to a fully functional, production-ready system:
|
|
|
|
- **Authentication:** Implemented real JWT-based authentication with password hashing (bcryptjs).
|
|
- **Backend Integration:** Replaced all hardcoded constants with real API calls to a Node.js/Express backend connected to a MySQL 8.0 database.
|
|
- **RBAC (Role-Based Access Control):** Implemented permissions for `super_admin`, `admin`, `manager`, and `agent`.
|
|
- **Membros (Members):** Enhanced to manage roles, teams, and status. Includes a safety modal for deletion.
|
|
- **Times (Teams):** Created a new dashboard to manage sales groups with real-time performance metrics.
|
|
- **UI/UX:** Standardized PT-BR translations and refined modal layouts.
|
|
|
|
## 🛠 Architecture
|
|
- **Frontend**: React 19, TypeScript, Vite, TailwindCSS (CDN).
|
|
- **Backend**: Node.js, Express, MySQL2 (Pool-based).
|
|
- **Database**: MySQL 8.0 (Schema: `agenciac_comia`).
|
|
- **Deployment**: Docker Compose for local development; Gitea Actions for CI/CD pushing to a Gitea Registry and deploying via Portainer webhook.
|
|
|
|
## ⚠️ Current Error: Build Instability
|
|
We are currently resolving a recurring build error: `Unexpected end of file` or `Expected ">" but found "\"`.
|
|
|
|
### Technical Root Cause:
|
|
This is a **tool-level synchronization issue**:
|
|
1. **Truncation:** The file-writing tool (`write_file`) occasionally truncates code before the final braces (`}`) or tags (`</div>`) are written.
|
|
2. **Escaping Glitches:** In long JSX strings (like Tailwind class lists), the system sometimes inserts accidental characters that break the JavaScript syntax.
|
|
3. **Result:** The Vite/Esbuild compiler fails because it reaches the end of an incomplete or syntactically broken file.
|
|
|
|
## 📋 Prerequisites
|
|
- Docker & Docker Compose
|
|
- Node.js (for local development outside Docker)
|
|
|
|
## ⚙️ Setup & Running
|
|
|
|
### 1. Environment Variables
|
|
Copy `.env.example` to `.env` and adjust values:
|
|
```bash
|
|
cp .env.example .env
|
|
```
|
|
Ensure you set the database credentials and `GITEA_RUNNER_REGISTRATION_TOKEN`.
|
|
|
|
### 2. Database
|
|
The project expects a MySQL database. The `docker-compose.yml` initializes it with `agenciac_comia.sql`.
|
|
|
|
### 3. Running with Docker Compose
|
|
To start the application, database, and runner:
|
|
```bash
|
|
docker-compose up -d --build
|
|
```
|
|
- **Frontend/Backend**: http://localhost:3001
|
|
- **Database**: Port 3306
|
|
|
|
### 4. Gitea Runner
|
|
The `docker-compose.yml` includes a service for a Gitea Runner (`fasto-runner`).
|
|
- Persistent data is in `./fasto_runner/data`.
|
|
|
|
## 🔄 CI/CD Pipeline
|
|
The project uses Gitea Actions defined in `.gitea/workflows/build-deploy.yaml`.
|
|
- **Triggers**: Push to `main` or `master`.
|
|
- **Steps**:
|
|
1. Checkout code.
|
|
2. Build Docker image.
|
|
3. Push to `gitea.blyzer.com.br`.
|
|
4. Trigger Portainer webhook.
|
|
- **Secrets Required in Gitea**:
|
|
`REGISTRY_USERNAME`, `REGISTRY_TOKEN`, `PORTAINER_WEBHOOK`, `API_KEY`.
|
|
|
|
## 💻 Development
|
|
- **Frontend**: `npm run dev` (Port 3000)
|
|
- **Backend**: `node backend/index.js` (Port 3001)
|