How arthurmousinho/selffy works
Project type and purpose
• This is a full‐stack SaaS web application (“Selffy”) for managing freelance projects, tasks, costs, and users, with an AI assistant to generate task descriptions/guides.
• It consists of three independently deployable components:
• Web client (“web/”) built in React + Vite
• Main REST API server (“api/”) built on NestJS + Prisma + PostgreSQL
• AI Model microservice (“model/”) built in Node, connecting to Ollama
File structure
• Top-level folders:
• api/ — NestJS monolith implementing controllers, application/use-case layer, domain entities, Prisma repositories, storage & AI services
• web/ — React/Vite SPA with components, hooks, pages, routing, UI library
• model/ — Lightweight Express-style service exposing AI endpoints
• docs/ — architecture TLDR, features, RBAC
• The api/ folder follows a layered “Hexagonal/Clean” architecture:
• infra/http → controllers, DTOs, guards
• application/use-cases → business logic modules (user, project, task, cost)
• domain → entities, repository interfaces, domain services
• infra/database → Prisma service, mappers, repository implementations
• infra/services → Cloudinary (storage), Ollama (AI)
• Docker files in api/ coordinate the API + PostgreSQL.
• model/ has its own .env, router, middleware for API key auth.
• web/ uses Vite’s TS setup, React components, Tailwind, and axios for HTTP.
README for additional insights
• README.MD in root instructs developers to run each component separately.
• RBAC.md and features.md list data flows and security requirements (JWT auth, role guard).