Skip to content

sekeco/invoice

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🧾 Invoice Management Application

A modern, full-stack invoice management application built with Laravel API backend and Nuxt.js frontend, containerized with Docker for seamless development.

πŸš€ Tech Stack

  • πŸ”§ Laravel 11 - API backend with PHP 8.4
  • 🎨 Nuxt.js 4 - Modern Vue.js frontend
  • 🐳 Docker - Containerized development environment
  • πŸ“Š MySQL 8.0 - Database
  • ⚑ Automated Scripts - Helper tools for development

πŸ“‚ Project Structure

invoice/
β”œβ”€β”€ πŸ”§ Development Scripts
β”‚   β”œβ”€β”€ dev.sh                 # Main development helper
β”‚   β”œβ”€β”€ setup.sh              # Complete project setup
β”‚   └── env-setup.sh          # Environment setup
β”œβ”€β”€ 🐳 Docker Configuration
β”‚   β”œβ”€β”€ docker-compose.yml    # Full stack
β”‚   └── docker-compose.dev.yml # Backend only
β”œβ”€β”€ πŸ”§ api/ (Laravel)
β”‚   β”œβ”€β”€ app/                  # Application logic
β”‚   β”œβ”€β”€ database/             # Migrations, seeders
β”‚   └── routes/               # API routes
└── 🎨 app/ (Nuxt.js)
    β”œβ”€β”€ app/                  # Vue components, pages
    β”œβ”€β”€ nuxt.config.ts        # Nuxt configuration
    └── package.json          # Frontend dependencies

⚑ Quick Start

πŸ†• First Time Setup

# Clone repository
git clone <repository-url>
cd invoice

# Complete automated setup
./setup.sh

# OR manual setup
./env-setup.sh              # Setup environment
./dev.sh backend            # Start backend services
./dev.sh frontend           # Start frontend (new terminal)

πŸ“… Daily Development (Recommended)

Hybrid Mode: Local Frontend + Docker Backend

# Terminal 1: Start backend services (API + MySQL)
./dev.sh backend

# Terminal 2: Start frontend with hot reload
./dev.sh frontend

Why this setup?

  • βœ… Hot module replacement for frontend
  • βœ… Faster frontend rebuilds
  • βœ… Better debugging experience
  • βœ… Native IDE integration

🐳 Alternative: Full Docker Mode

# Start everything in Docker
./dev.sh full

🌐 Service URLs

Service URL Description
Frontend http://localhost:3000 Nuxt.js app
API http://localhost:8080 Laravel API
Database localhost:3306 MySQL

πŸ› οΈ Development Commands

Main Helper Script (./dev.sh)

Command Description
./dev.sh backend Start API + MySQL only
./dev.sh frontend Start Nuxt locally with HMR
./dev.sh full Start everything in Docker
./dev.sh stop Stop backend services
./dev.sh logs Show all logs
./dev.sh status Show service status

Laravel Commands

./dev.sh laravel migrate                    # Run migrations
./dev.sh laravel migrate:fresh --seed       # Fresh database with seeds
./dev.sh laravel tinker                     # Laravel REPL
./dev.sh laravel make:controller UserController
./dev.sh laravel make:model Invoice -m      # Create model with migration

NPM Scripts (Alternative)

npm run dev           # Start backend only
npm run dev:frontend  # Start frontend only
npm run dev:full      # Full Docker stack
npm run setup         # Complete setup with migrations
npm run stop          # Stop services

πŸ”§ Development Workflow

Typical Development Day

# 1. Start your day
./dev.sh backend

# 2. Start frontend (in another terminal)
./dev.sh frontend

# 3. Develop your features...

# 4. End of day
./dev.sh stop

Database Operations

# Reset database
./dev.sh laravel migrate:fresh --seed

# Create migration
./dev.sh laravel make:migration create_invoices_table

# Create model
./dev.sh laravel make:model Invoice -m

# Check migration status
./dev.sh laravel migrate:status

πŸ” Troubleshooting

Common Issues

Port conflicts:

# Check what's using ports
lsof -i :8080
lsof -i :3000

# Kill process if needed
kill -9 <PID>

MySQL connection issues:

# Check if local MySQL is running
brew services list | grep mysql

# Stop local MySQL if running
brew services stop mysql

Frontend won't start:

# Clear Nuxt cache
cd app && rm -rf .nuxt .output

# Reinstall dependencies
cd app && rm -rf node_modules && npm install

Docker issues:

# Clean up Docker
docker system prune -f

# Rebuild containers
./dev.sh stop
docker-compose -f docker-compose.dev.yml build --no-cache
./dev.sh backend

🎯 Architecture Benefits

Development Modes

πŸš€ Recommended: Hybrid Development

  • Backend: Docker containers (API + MySQL)
  • Frontend: Local development (npm run dev)
  • Benefits: Hot reload, fast builds, easy debugging

🐳 Full Docker Development

  • All services: Running in Docker containers
  • Benefits: Production-like environment, consistency

Key Features

  • βœ… Single source of truth - Centralized environment config
  • βœ… Automated setup - One-command project initialization
  • βœ… Hot reload support - Fast frontend development
  • βœ… Volume persistence - Database data preservation
  • βœ… Helper scripts - Simplified common tasks

🀝 Contributing

  1. Use the development helper script: ./dev.sh
  2. Follow the recommended hybrid development workflow
  3. Test both frontend modes before submitting
  4. Ensure all migrations work correctly

πŸ“š Resources


πŸŽ‰ Happy coding!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •