Local invoices application using git as sync service.
| components | ||
| composables | ||
| layouts | ||
| lib | ||
| middleware | ||
| pages | ||
| plugins | ||
| public | ||
| server | ||
| types | ||
| utils | ||
| .gitignore | ||
| app.vue | ||
| biome.json | ||
| nuxt.config.ts | ||
| package.json | ||
| pnpm-lock.yaml | ||
| README.md | ||
| tsconfig.json | ||
local.invoices
Local first invoice application. Built on Nuxt. Below are the generic details for starting the project from the Nuxt starter. Edited slightly for some brevity.
Development Notes
Data
The idea is to have the data locally stored using Dexie.js and then "synchronised" using isomorphic.git or a local first sync library like zero, jazz or rxdb (in order of preference).
Structure
Working bit by bit, first developing the relationship between client and invoice.
---
title: Client -> Invoice Structure
---
erDiagram
CLIENT {
uuid id PK
string name
string email
string phone
string website
string prefix
uuid company_id
uuid billing_address_id
uuid shipping_address_id
uuid currency_id
}
COMPANY {
uuid id PK
string name
string registration
}
ADDRESS {
uuid id PK
string name
array street
string city
string state
string country
string post_code
}
CURRENCY {
int id PK
string name
string symbol
string code
}
BANK {
uuid id PK
string bank_name
string bank_number
string bank_swift
}
INVOICE {
uuid id PK
uuid client_id FK
string number
date date
date due_date
string notes
float total
float paid
uuid status_id
float discount
}
INVOICE_ITEM {
uuid id PK
uuid invoice_id FK
string name
float quantity
string unit
float price
}
TAX {
int id PK
string name
float rate
string description
}
INVOICE_STATUS {
uuid id PK
string label
}
INVOICE_TAX_ITEM {
int id PK
int tax_id FK
float value
}
INVOICE_PAYMENT {
uuid id PK
date date
uuid invoice_id FK
uuid client_id FK
float amount
}
INVOICE ||--|{ INVOICE_ITEM : contains
INVOICE ||--o{ INVOICE_TAX_ITEM : has
INVOICE ||--|| CURRENCY : has
INVOICE ||--|| INVOICE_STATUS : has
INVOICE ||--o{ INVOICE_PAYMENT : has
INVOICE ||--o{ INVOICE_PAYMENT : has
INVOICE_TAX_ITEM }o--|| TAX : is
CLIENT ||--|{ ADDRESS : has
CLIENT ||--o{ INVOICE : has
CLIENT ||--|| COMPANY : represents
CLIENT ||--|| CURRENCY : has
CLIENT ||--|| BANK : has
CLIENT ||--o{ INVOICE_PAYMENT : has
Setup
Make sure to install dependencies:
# npm
npm install
# pnpm
pnpm install
Development Server
Start the development server on http://localhost:3000:
# npm
npm run dev
# pnpm
pnpm dev
Production
Build the application for production:
# npm
npm run build
# pnpm
pnpm build
Locally preview production build:
# npm
npm run preview
# pnpm
pnpm preview
Check out the deployment documentation for more information.