How thibault-hen/la-pince works
Project Type and Purpose
• This is a full-stack personal finance application (“La Pince”) comprised of a Node.js/TypeScript backend and a React/TypeScript frontend. The backend exposes REST and WebSocket endpoints for user authentication, budget tracking, expenses, incomes, notifications, and currency exchange. The frontend uses Vite, React, and a custom component library to render pages, forms, charts, and modals for managing personal finances.
File Structure Analysis
• Top-level folders:
• backend – Node.js/Express (app.ts, router.ts), Prisma ORM with migrations, Redis integration, mailing service, middleware (auth, logger), controllers, services, WebSockets for real-time notifications, tests (vitest).
• frontend – Vite/React app in src, organized by assets, components (UI primitives, domain modules: auth, budget, expense, etc.), hooks, services to call backend APIs, stores (state management), layouts, pages, schemas, i18n, tests.
• .github/workflows/ci-cd.yaml for automated CI/CD.
• Dockerfiles and docker-compose setup to bring up backend, PostgreSQL, Redis.
README Insights
• Confirms Docker Compose brings up backend + PostgreSQL + Redis.
• Frontend runs independently in dev mode (npm run dev).
a. Main Components
• Frontend SPA (React/Vite)
• Backend API Server (Node.js/Express)
• PostgreSQL Database (Prisma ORM)
• Redis Cache/Session Store
• Email Service (mailer service via SMTP or third-party)
• CI/CD pipeline (GitHub Actions)
b. Relationships and Interactions
• Frontend ↔ Backend over HTTPS (RESTful endpoints)
• Backend ↔ PostgreSQL for CRUD operations (Prisma)
• Backend ↔ Redis for rate-limiting, sessions, notifications
• Backend WebSocket server → Frontend (real-time notifications)
• Backend → Email Service for password resets and notifications
• GitHub Actions → Docker Hub/Vercel (deployment)
c. Architectural Patterns and Principles
• Layered architecture on the backend:
• HTTP controllers → service layer → ORM layer → external systems (DB, Redis, mailer)
• REST API design with JSON, plus WebSocket for push notifications
• MVC-style separation: controllers, services, middlewares, validators
• Frontend component-driven UI with state management via custom hooks and stores
• I18n for multi-language support
d. Key Technologies
• Node.js, Express, TypeScript, Prisma, PostgreSQL, Redis, Vitest
• Vite, React, TypeScript, Zustand (or similar) stores, i18next, Tailwind or custom CSS, Sonner for toasts
• Docker, Docker Compose, GitHub Actions, Vercel
Detailed Capture of Architectural Elements
• Middleware chain on the backend (logger, auth, rate limiter).
• WebSocket channel topics and how notifiableUsers are tracked.
• Which components are covered by Vitest tests for design completeness.