Frontend CD / build (push) Failing after 57s
## What - Added button to start a sale from the router stop list - Replaced the dropdown input in the Manage POS modal in the Routes page by an input text search. ## Why - Improvements to make the user's life easier. ## Mood <img width="200" src="https://media2.giphy.com/media/ui1hpJSyBDWlG/giphy.gif?cid=36b14facxaosmt8cmpptl1gkbb6j2zzupsb9r2icd7va79ml&ep=v1_gifs_search&rid=giphy.gif&ct=g" /> Reviewed-on: #9
3.0 KiB
3.0 KiB
Gemini Context: Polpa Go
This project is a full-stack business management web application designed for managing customers, products, sales, and delivery routes.
Project Overview
- Architecture: Monorepo-like structure with separate
backendandfrontenddirectories. - Backend: Node.js 22, Fastify 5, TypeScript, Prisma ORM.
- Frontend: React 19, TypeScript, Vite, Bootstrap 5.
- Database: PostgreSQL 15.
- Infrastructure: Docker, Docker Compose, GitHub Actions, Terraform.
Directory Structure
backend/: Fastify API server and Prisma schema.src/routes/: API endpoint definitions.prisma/: Database schema and migrations.
frontend/: React application.src/pages/: Main view components.src/components/: Reusable UI components.src/context/: React context providers (e.g., Toast).
docker-compose.yml: Orchestrates the database, backend, and frontend for local development.
Building and Running
Local Development (Recommended)
The easiest way to run the full stack is using Docker Compose:
docker compose up
- Frontend: http://localhost:5173
- Backend API: http://localhost:3000
- Database: localhost:5432 (User:
admin, Password:adminpassword, DB:polpa_gestao)
Manual Setup
Backend
cd backend
npm install
# Ensure DATABASE_URL is set in .env
npx prisma migrate dev
npm run server # or ./run-server.sh which uses ts-node
Frontend
cd frontend
npm install
npm run dev
Development Conventions
Backend
- Routing: Register new routes in
backend/src/index.tsfrom thebackend/src/routes/directory. - Authentication: Use the
authenticatedecorator on routes requiring protection. Authentication is JWT-based. - Database: Always update
prisma/schema.prismaand runnpx prisma migrate devfor schema changes. - Validation: Use Fastify's built-in schema validation where possible.
Frontend
- Styling: Primarily Bootstrap 5 with custom CSS in
.cssfiles. - State Management: React Hooks (useState, useEffect) and Context API for global UI state (like notifications).
- API Calls: Use
axios. Environment variables (likeVITE_BACKEND_SERVER) are used for configuration.
General
- Naming: Use
camelCasefor TypeScript variables, functions, and database fields (as per Prisma schema). - Types: Strictly adhere to TypeScript. Define shared types in
frontend/src/types.tsor relevant backend models. - Testing: No formal test suite is currently implemented (placeholder in
package.json). Add tests tobackend/testsorfrontend/src/__tests__as needed.
Common Tasks
- Seeding the Database:
Run
backend/run-seed.shornode dist/seed.jsinside the backend container. - Adding a new Data Model:
- Edit
backend/prisma/schema.prisma. - Run
npx prisma migrate dev --name <migration_name>. - Regenerate Prisma client (done automatically by migrate).
- Edit
- Updating Frontend PWA:
Vite PWA plugin is configured in
frontend/vite.config.ts.