- 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
3.2 KiB
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, andagent. - 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:
- Truncation: The file-writing tool (
write_file) occasionally truncates code before the final braces (}) or tags (</div>) are written. - Escaping Glitches: In long JSX strings (like Tailwind class lists), the system sometimes inserts accidental characters that break the JavaScript syntax.
- 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:
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:
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
mainormaster. - Steps:
- Checkout code.
- Build Docker image.
- Push to
gitea.blyzer.com.br. - 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)