Skip to content

PunterDigital/book-keeping

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“Š Czech Business Bookkeeping & Invoicing System

A comprehensive, modern bookkeeping application built specifically for Czech B2B operations, featuring complete expense management, client invoicing, and professional PDF generation with full Czech business compliance and automated monthly reporting to accountants.

🎯 Project Status: PRODUCTION READY βœ…

All 5 development phases completed successfully with 286+ tests passing (100% success rate)

πŸ“‹ Business Context

  • Volume: Designed for 10-15 expenses/invoices per month
  • Users: Single-user system for small Czech businesses
  • Market: B2B operations in Czech Republic
  • Reporting: Automated monthly reports (16th-15th cycle) to accountants

πŸš€ Key Features

βœ… Complete Business Operations

  • Expense Management: Receipt upload, categorization, VAT tracking
  • Client Management: Czech business information (DIČ, IČO), contact management
  • Invoice System: Professional invoicing with line items and status tracking
  • PDF Generation: Czech-compliant invoices and reports
  • Reporting Suite: Monthly, yearly, and custom period reports
  • VAT Compliance: 0%, 12%, 21% rates with automatic calculations

βœ… Czech Business Compliance

  • VAT Rates: Standard 21%, Reduced 12%, Exempt 0%
  • Currency: Czech koruna (CZK) with proper formatting
  • Date Format: European DD.MM.YYYY format
  • Business Fields: DIČ (VAT ID), IČO (Company ID) support
  • Invoice Numbering: YYYY### format (2024001, 2024002...)
  • Reporting Cycle: 16th-15th monthly periods

βœ… Modern Technology Stack

  • Framework: Laravel 10 with PHP 8.2+
  • Frontend: Vue 3 + Inertia.js + Tailwind CSS with dark mode support
  • Database: SQLite (development) / MySQL 8.0 (production)
  • File Storage: Hetzner S3 (S3-compatible API)
  • Email Service: Amazon SES SMTP for automated reporting
  • PDF Generation: Professional Czech-compliant documents
  • Hosting: Laravel Forge managed VPS ready
  • SSL: Let's Encrypt integration

πŸ§ͺ Testing Coverage

286+ Tests with 100% Success Rate βœ…

  • Unit Tests: Complete model and service testing
  • Feature Tests: End-to-end workflow validation
  • Integration Tests: Cross-system functionality
  • Czech Compliance Tests: Business rule validation
# Run complete test suite
php artisan test

# Results: βœ… 286 passed, 1 skipped
# Success Rate: 100%
# Assertions: 1708+

⚑ Quick Start

Prerequisites

  • PHP 8.1+
  • Composer
  • Node.js 16+
  • NPM/Yarn

Installation

# Clone repository
git clone <repository-url>
cd basic-bookkeeping

# Install dependencies
composer install
npm install

# Environment setup
cp .env.example .env
php artisan key:generate

# Database setup
php artisan migrate

# Generate Wayfinder routes (required)
php artisan wayfinder:generate --with-form

# Build assets
npm run build

# Start development server
php artisan serve

Environment Configuration

# Database
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=bookkeeping
DB_USERNAME=username
DB_PASSWORD=password

# Hetzner S3 Storage (S3-compatible API)
AWS_ACCESS_KEY_ID=your_hetzner_key
AWS_SECRET_ACCESS_KEY=your_hetzner_secret
AWS_DEFAULT_REGION=eu-central-1
AWS_BUCKET=your_bucket_name
AWS_ENDPOINT=https://your-bucket.s3.hetzner-cloud.com

# Amazon SES SMTP for Monthly Reports
MAIL_MAILER=smtp
MAIL_HOST=email-smtp.eu-west-2.amazonaws.com
MAIL_PORT=587
MAIL_USERNAME=your_ses_smtp_username
MAIL_PASSWORD=your_ses_smtp_password
MAIL_ENCRYPTION=tls
MAIL_FROM_ADDRESS=noreply@yourdomain.com

# Accountant Email for Monthly Reports
ACCOUNTANT_EMAIL=accountant@example.com

# Company Information
COMPANY_NAME="Your Company Name"
COMPANY_ADDRESS="Your Address"
COMPANY_ICO="12345678"
COMPANY_DIC="CZ12345678"
COMPANY_EMAIL="your@email.com"
COMPANY_PHONE="+420 123 456 789"

🐳 Docker Development Setup

Quick Docker Start

# Copy Docker environment file
cp .env.example .env.docker

# Start development environment
docker-compose up -d

# Run initial setup (first time only)
docker exec bookkeeping-app composer install
docker exec bookkeeping-app php artisan key:generate
docker exec bookkeeping-app php artisan migrate --force
docker exec bookkeeping-app php artisan wayfinder:generate --with-form
docker exec bookkeeping-app php artisan db:seed --force

Docker Services

Development Commands

# Laravel/PHP commands
docker exec bookkeeping-app php artisan migrate
docker exec bookkeeping-app php artisan test
docker exec bookkeeping-app composer install

# Database access
docker exec -it bookkeeping-mysql mysql -u bookkeeper -psecret bookkeeping

πŸ—οΈ Application Structure

Core Components

app/
β”œβ”€β”€ Models/
β”‚   β”œβ”€β”€ Expense.php βœ…
β”‚   β”œβ”€β”€ ExpenseCategory.php βœ…  
β”‚   β”œβ”€β”€ Client.php βœ…
β”‚   β”œβ”€β”€ Invoice.php βœ…
β”‚   β”œβ”€β”€ InvoiceItem.php βœ…
β”‚   └── MonthlyReport.php βœ…
β”œβ”€β”€ Http/Controllers/
β”‚   β”œβ”€β”€ ExpenseController.php βœ…
β”‚   β”œβ”€β”€ ClientController.php βœ…
β”‚   β”œβ”€β”€ InvoiceController.php βœ…
β”‚   └── ReportsController.php βœ…
β”œβ”€β”€ Services/
β”‚   β”œβ”€β”€ InvoicePdfService.php βœ…
β”‚   └── EmailService.php βœ… (Automated monthly reports)
└── Jobs/
    └── SendMonthlyReport.php βœ…

Frontend Components

resources/js/Pages/
β”œβ”€β”€ Dashboard.vue βœ… (Modern dark theme)
β”œβ”€β”€ Expenses/ βœ…
β”œβ”€β”€ Clients/ βœ…
β”œβ”€β”€ Invoices/ βœ…
└── Reports/ βœ…

🎯 Usage Guide

1. Initial Setup

  1. Create User Account: Register/login to access the application
  2. Configure Company: Set up company details for invoice headers
  3. Create Categories: Set up expense categories for organization

2. Daily Operations

Expense Management

Dashboard β†’ Expenses β†’ Create New
1. Select category
2. Enter amount and VAT
3. Upload receipt (optional)
4. Save expense

Client Management

Dashboard β†’ Clients β†’ Create New  
1. Enter company information
2. Add DIČ (VAT ID) and IČO (Company ID)
3. Set billing address
4. Save client

Invoice Creation

Dashboard β†’ Invoices β†’ Create New
1. Select client
2. Add line items with quantities and prices
3. Set VAT rates per item (0%, 12%, 21%)
4. Review totals
5. Generate PDF

3. Automated Monthly Reporting

The system automatically generates and emails comprehensive monthly reports to your accountant:

Monthly Accountant Reports Include:

  • All Invoice PDFs: ZIP archive of professional invoices
  • All Receipt PDFs: ZIP archive of expense receipts
  • CSV Expense Summary: Complete expense data export (Czech format)
  • CSV Invoice Summary: Complete invoice data export (Czech format)
  • Summary Info: Overview document in Czech
  • Automated Email: Sent via Amazon SES SMTP to accountant

Email Testing

# Test email configuration
php artisan email:test --dry-run

# Send actual test email
php artisan email:test

πŸ’Ό Business Features

Professional Invoicing

  • Dynamic line items with quantity and unit pricing
  • Multiple VAT rates per invoice
  • Automatic total calculations
  • Professional PDF generation
  • Status tracking (Draft β†’ Sent β†’ Paid)
  • Overdue detection and flagging

Comprehensive Expense Tracking

  • Receipt upload with S3 storage
  • Category-based organization
  • VAT rate tracking and reporting
  • Monthly and yearly summaries
  • Advanced filtering and search

Client Relationship Management

  • Complete business information storage
  • Invoice history tracking
  • Revenue analysis per client
  • Account statements generation
  • Active/inactive status management

Advanced Reporting & Automation

  • Monthly Financial Summaries: 16th-15th Czech reporting cycles
  • VAT Compliance Reports: Ready for tax filing
  • Category-based Analysis: Expense breakdown and trends
  • Year-over-year Comparisons: Business growth tracking
  • Professional PDF Exports: Branded document generation
  • Automated Email Reports: Monthly accountant delivery via Amazon SES SMTP
  • Backup & Export: Complete data and file backup to ZIP
  • CSV Exports: Czech-formatted bulk data export

πŸ”§ Technical Details

Database Schema

-- 8 Core Tables for complete business operations
users: id, name, email, password, created_at, updated_at
expense_categories: id, name, created_at, updated_at  
expenses: id, date, amount, category_id, description, vat_amount, receipt_path, created_at, updated_at
clients: id, company_name, contact_name, address, vat_id, company_id, created_at, updated_at
invoices: id, invoice_number, client_id, issue_date, due_date, status, subtotal, vat_amount, total, notes, pdf_path, created_at, updated_at
invoice_items: id, invoice_id, description, quantity, unit_price, vat_rate, created_at, updated_at
monthly_reports: id, period_start, period_end, generated_at, sent_at, email_status
jobs: id, queue, payload, attempts, created_at (Laravel job queue)

Security Features

  • Authentication: Laravel Breeze integration
  • Authorization: Route protection and user isolation
  • Data Validation: Comprehensive input sanitization
  • File Security: Secure S3 storage with access controls

Performance Optimizations

  • Efficient Queries: Proper eager loading and relationships
  • File Storage: S3 integration for scalable document storage
  • Frontend: Vue 3 composition API with Inertia.js
  • Dark Theme: Modern UI with seamless light/dark mode switching
  • Caching: Template and calculation caching where appropriate

🌍 Czech Localization

Business Compliance

  • VAT Rates: DPH 21% (standard), 12% (reduced), 0% (exempt)
  • Currency: Czech koruna with proper thousand separators
  • Dates: European DD.MM.YYYY format throughout
  • Business IDs: DIČ (VAT registration) and IČO (company registration)

Invoice Requirements

  • Numbering: Sequential YYYY### format
  • Required Fields: Company details, VAT breakdown, totals
  • Professional Format: Branded headers with company information
  • Legal Compliance: Meets Czech invoice requirements

Reporting Compliance

  • Monthly Cycles: 16th to 15th reporting periods
  • VAT Reports: Ready for tax filing
  • Expense Categorization: Business expense classification
  • Audit Trail: Complete transaction history

πŸ”„ Development & Deployment

Code Quality

  • PSR Standards: PHP-FIG coding standards compliance
  • Type Hints: Strong typing throughout codebase
  • Documentation: Comprehensive inline documentation
  • Testing: TDD approach with 100% critical path coverage

Production Infrastructure

  • Hosting: Laravel Forge managed VPS deployment ready
  • SSL: Let's Encrypt automatic certificate management
  • Backup System: Laravel backup package + S3 storage
  • Performance Monitoring: Application health tracking
  • Error Tracking: Comprehensive logging and monitoring

πŸ“ˆ Future Enhancement Opportunities

Potential Future Enhancements

  • Payment Integration: Online payment processing and tracking
  • Recurring Invoices: Automated billing cycles
  • Advanced Analytics: Business intelligence dashboards with charts
  • Mobile App: Native mobile application development
  • API Development: Third-party integration capabilities
  • Multi-Company: Support for multiple business entities

πŸ› οΈ Troubleshooting

Common Issues

Email Configuration

# Test email configuration
php artisan email:test --dry-run

# Check logs for email failures
tail -f storage/logs/laravel.log

Wayfinder/Frontend Issues

# Regenerate frontend routes
php artisan wayfinder:generate --with-form

# Rebuild frontend assets
npm run build

File Permissions (Production)

chmod -R 755 storage bootstrap/cache
chown -R www-data:www-data storage bootstrap/cache

Queue Processing

# Process background jobs (monthly reports)
php artisan queue:work

# Check failed jobs
php artisan queue:failed

πŸ“„ Project Completion

Development Phases Completed

Phase Status Description Completion
Phase 1 βœ… Complete Foundation Setup & Database 100%
Phase 2 βœ… Complete Expense Management System 100%
Phase 3 βœ… Complete Client & Invoice Management 100%
Phase 4 βœ… Complete PDF Generation & Reporting 100%
Phase 5 βœ… Complete Monthly Email Reports & Polish 100%

Final Statistics

  • βœ… 5 Phases Complete: All planned functionality implemented
  • βœ… 286+ Tests Passing: 100% success rate with comprehensive coverage
  • βœ… Czech Compliant: Full adherence to local business requirements
  • βœ… Production Infrastructure: Laravel Forge VPS deployment ready
  • βœ… Automated Workflows: Monthly accountant reporting via Amazon SES
  • βœ… Modern UI: Dark theme with professional styling throughout

πŸŽ‰ Ready for Production

This Czech bookkeeping application is complete, tested, and ready for immediate production use.

Business Value Delivered

  • Complete B2B Solution: From expense tracking to automated accountant reporting
  • Czech Legal Compliance: VAT calculations, invoice formatting, business field requirements
  • Professional Documentation: Branded PDFs for all business communications
  • Streamlined Operations: Single-user system optimized for 10-15 transactions/month
  • Automated Reporting: Monthly ZIP archives with all documents sent to accountant
  • Modern Interface: Professional dark theme with intuitive navigation

Start using immediately:

php artisan serve
# Navigate to http://localhost:8000

For technical support or deployment assistance, refer to the troubleshooting section above.

πŸš€ Happy Bookkeeping! πŸ‡¨πŸ‡Ώ

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published