Skip to content
MakhBethPublic

About

Tax math for Italian freelancers in the flat-tax (forfettario) regime

Resources

Stars

7 stars

Watchers

0 watching

Forks

Latest commit

Β 

History

217 Commits

Folders and files

Repository files navigation

Pivella

Pivella - Gestione P.IVA in forfettario

App per gestire il regime forfettario - P.IVA italiana

Live version: https://pivella.netlify.app/

πŸš€ Quick Start

Prerequisites

  • Node.js (v18 or higher recommended)
  • npm (comes with Node.js)

Installation

  1. Clone the repository:
git clone https://github.com/MakhBeth/pivella.git
cd pivella
  1. Install dependencies:
npm install

Running the Application

Development Mode

Start the development server with hot module replacement:

npm run dev

The application will be available at http://localhost:5173 (default Vite port).

Production Build

Build the application for production:

npm run build

The built files will be in the dist/ directory.

Preview Production Build

Preview the production build locally:

npm run preview

Linting

Check TypeScript types without building:

npm run lint

πŸ—οΈ Project Structure

pivella/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ components/          # React components
β”‚   β”‚   β”œβ”€β”€ Header.tsx       # Header component with navigation
β”‚   β”‚   β”œβ”€β”€ Header.module.css
β”‚   β”‚   β”œβ”€β”€ Footer.tsx       # Footer component
β”‚   β”‚   β”œβ”€β”€ Footer.module.css
β”‚   β”‚   β”œβ”€β”€ Home.tsx         # Main home page component
β”‚   β”‚   β”œβ”€β”€ Home.module.css
β”‚   β”‚   └── ForfettarioApp.tsx # Main app logic
β”‚   β”œβ”€β”€ App.tsx              # Root App component
β”‚   β”œβ”€β”€ App.module.css       # Global styles
β”‚   └── main.tsx             # Application entry point
β”œβ”€β”€ public/                  # Static assets
β”œβ”€β”€ index.html              # HTML template
β”œβ”€β”€ vite.config.ts          # Vite configuration
β”œβ”€β”€ tsconfig.json           # TypeScript configuration
└── package.json            # Project dependencies and scripts

πŸ€– AI assistant (MCP server)

Pivella ships a local MCP server so that Claude, Codex, Cursor or any MCP client can read your data and propose changes, all on your computer. The assistant only proposes; you confirm in the app. It can also generate the FatturaPA XML or a courtesy PDF for a saved invoice, written into documenti/<year> in the sync folder without touching your Pivella data.

claude mcp add pivella -- npx -y pivella-mcp --dir /path/to/sync-folder

Setup for every client, how it works and how to publish the package: mcp/README.md. Package on npm: pivella-mcp.

pivella-mcp 1.0 requires Pivella 7.0 and vice versa: the sync file moves to schema version 3. Update both together.

Browser assistants (WebMCP, experimental)

In Impostazioni β†’ Assistente nel browser, enable WebMCP to let a compatible browser assistant query the selected profile and draft an invoice directly from the open app. No Node installation, MCP server or sync folder is needed. The setting is off by default and can be disabled at any time. Your assistant receives the data returned by its tool calls; its own data handling policy still applies.

The initial tools are list_users (selected profile only), list_clienti, list_fatture, get_riepilogo_anno, propose_fattura, list_proposals and get_proposal. Proposals persist in this browser for review in Impostazioni β†’ Proposte dell’assistente. Confirming revalidates the current data, assigns the invoice number and downloads the XML; rejecting leaves the accounting data unchanged. Drafts are not included in backups or sync files. Confirmed invoices follow the existing backup and sync flows.

WebMCP needs browser and agent support, and Pivella must remain open. It is not a remote MCP URL that can be added to any MCP client. Unsupported browsers show the integration as unavailable; the local MCP server remains available. On pivella.it, Chrome 149+ enables WebMCP through the WebMCP origin trial (token in index.html, valid until 2027-03-30); other origins need the chrome://flags/#enable-webmcp-testing flag. For testing browser support, see the Chrome WebMCP documentation. The adapter uses document.modelContext with registration abort signals, and also supports the earlier navigator.modelContext / unregisterTool API.

πŸ› οΈ Technologies

  • React 18.2.0 - UI library
  • TypeScript 5.9.3 - Type safety
  • Vite 5.0.8 - Build tool and dev server
  • CSS Modules - Scoped component styling
  • Recharts - Charting library
  • Lucide React - Icon library

πŸ“ Development

Component Structure

Each component follows this pattern:

  • ComponentName.tsx - TypeScript React component with typed props
  • ComponentName.module.css - CSS module for component-specific styles

TypeScript

The project uses strict TypeScript configuration. All components are typed with proper interfaces for props and state.

πŸ“¦ Build Output

The production build generates optimized static files including:

  • Minified JavaScript bundles
  • Optimized CSS
  • Service Worker for PWA functionality
  • Static assets

πŸ”§ Configuration

Vite

Configuration can be modified in vite.config.ts.

TypeScript

TypeScript compiler options are in tsconfig.json and tsconfig.node.json.

πŸ“„ License

This project is part of the Pivella suite for managing Italian VAT regime (regime forfettario).

🀝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

πŸ§ͺ The Vibecoding Experiment

This started as an experiment in pure vibecoding. V1 was built entirely with the Claude iOS app, but it couldn't handle deployment. After manually deploying and configuring Netlify (the meme "AI: why can't they see my new site on localhost" is real), I started using GitHub Copilot for new features.

It didn't go badly until: I found conflicts to resolve... in the node_modules folder, a couple of "undefined is not a function" (sigh), and most importantly, hallucinations. So I had to bring out Claude Code and managed to rewrite the project so it wasn't a complete mess anymore.

The vibecoding experiment failed on some CSS and UI bugs that I just couldn't solve with prompting alone, but the product is still nice and it's a tool I'm proud of. Let's see how it goes.

About

Tax math for Italian freelancers in the flat-tax (forfettario) regime

Resources

Stars

7 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages