Skip to content

creationsofm7/PaintJOB

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

6 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Paintjob - Automated Painting System

A comprehensive full-stack application for planning and automating wall painting projects with motion path generation.

License Python Next.js


πŸ“– Overview

Paintjob is a production-ready system that combines:

  • Backend API (FastAPI + PostgreSQL) for managing users, projects, rooms, walls, and generating motion paths
  • Frontend Editor (Next.js 15) for visual planning with canvas-based wall and window editing

This repository contains both the backend (paintjob/) and frontend (paintjob-fe/) applications in a monorepo structure.

πŸŽ₯ Video Demonstration

Watch a quick overview of the Paintjob system:

🎬 Watch on YouTube


🚨 Important Legal Notice

This repository is VIEW-ONLY for external contributors.

  • You DO NOT own any code in this repository
  • All contributions become property of the repository owner
  • By contributing, you agree to the Contributor License Agreement (CLA)
  • You MUST read and accept the CLA before contributing

See CONTRIBUTING.md for strict contribution guidelines.


πŸ“š Documentation

Core Documentation

Quick Links


πŸš€ Quick Start

Prerequisites

Required:

  • Python 3.11+
  • Node.js 18+ and pnpm
  • PostgreSQL

Verify installations:

python3 --version    # Should be 3.11+
pnpm --version       # Should be 8.0+
      

πŸ”§ Backend Setup (paintjob/)

The backend is a FastAPI application with PostgreSQL database.

1. Navigate to Backend Directory

cd paintjob

2. Create Python Virtual Environment

# Create virtual environment
python3 -m venv venv

# Activate virtual environment
# On Windows (PowerShell):
.\venv\Scripts\Activate.ps1

# On macOS/Linux:
source venv/bin/activate

3. Install Poetry and Dependencies

# Install poetry if not already installed
pip install poetry

# Install all dependencies using poetry
poetry install

4. Configure Environment Variables

Important: Environment files are already provided in the repository.

Check that .env file exists in the paintjob/ directory with these variables:

Note: Update DATABASE_URL with your actual PostgreSQL credentials.

5. Run Database Migrations

# Apply all migrations to create tables
alembic upgrade head

6. Start the Backend Server

# Run the FastAPI application
python3 main.py

The API will be available at http://localhost:8000

API Endpoints:


🎨 Frontend Setup (paintjob-fe/)

The frontend is a Next.js 15 application with TypeScript and React.

1. Navigate to Frontend Directory

cd paintjob-fe

2. Install Dependencies with pnpm

# Install all dependencies
pnpm install

3. Configure Environment Variables

Important: Environment files are already provided in the repository.

Check that .env.local file exists in the paintjob-fe/ directory:

NEXT_PUBLIC_API_URL=http://localhost:8000/api

4. Start the Development Server

# Run Next.js development server
pnpm dev

The frontend will be available at http://localhost:3000


▢️ Running the Application

Start Backend

cd paintjob
source venv/bin/activate  # or .\venv\Scripts\Activate.ps1 on Windows
python3 main.py

Start Frontend (in a new terminal)

cd paintjob-fe
pnpm dev

Access the Application

  1. Open browser to http://localhost:3000
  2. Create an account or login
  3. Click "Open Editor" to start creating projects

πŸ§ͺ Running Tests

Backend Tests

cd paintjob

# Run all tests
pytest

# Run with verbose output
pytest -v

# Run specific test file
pytest tests/api/test_project_flow.py -v

# Run with coverage
pytest --cov=api --cov-report=html

See TESTING_GUIDE.md for comprehensive testing documentation.

Frontend Tests

cd paintjob-fe
# Tests to be added
pnpm test

πŸ“ Project Structure

paintjob/                         # Root monorepo
β”œβ”€β”€ README.md                     # This file
β”œβ”€β”€ CLA.md                        # Contributor License Agreement
β”œβ”€β”€ CONTRIBUTING.md               # Contribution guidelines
β”œβ”€β”€ TESTING_GUIDE.md             # Testing documentation
β”‚
β”œβ”€β”€ paintjob/                     # Backend FastAPI application
β”‚   β”œβ”€β”€ main.py                   # Application entry point
β”‚   β”œβ”€β”€ pyproject.toml            # Poetry dependencies
β”‚   β”œβ”€β”€ alembic.ini              # Database migration config
β”‚   β”œβ”€β”€ API_DOCUMENTATION.md     # Complete API reference
β”‚   β”œβ”€β”€ alembic/                 # Database migrations
β”‚   β”‚   └── versions/            # Migration files
β”‚   β”œβ”€β”€ api/                     # Application code
β”‚   β”‚   β”œβ”€β”€ auth.py              # JWT authentication
β”‚   β”‚   β”œβ”€β”€ database.py          # Database configuration
β”‚   β”‚   β”œβ”€β”€ models/              # SQLAlchemy models
β”‚   β”‚   β”œβ”€β”€ repos/               # Repository pattern
β”‚   β”‚   β”œβ”€β”€ routers/             # API endpoints
β”‚   β”‚   β”œβ”€β”€ schemas/             # Pydantic schemas
β”‚   β”‚   β”œβ”€β”€ services/            # Business logic
β”‚   β”‚   └── utils/               # Utilities
β”‚   └── tests/                   # Test suite
β”‚       β”œβ”€β”€ api/                 # API integration tests
β”‚       └── conftest.py          # Test fixtures
β”‚
└── paintjob-fe/                 # Frontend Next.js application
    β”œβ”€β”€ README.md                # Frontend documentation
    β”œβ”€β”€ package.json             # Node dependencies
    β”œβ”€β”€ next.config.ts           # Next.js configuration
    β”œβ”€β”€ src/
    β”‚   β”œβ”€β”€ app/                 # Next.js App Router
    β”‚   β”‚   β”œβ”€β”€ page.tsx         # Home page
    β”‚   β”‚   └── editor/          # Editor page
    β”‚   β”œβ”€β”€ components/          # React components
    β”‚   β”‚   β”œβ”€β”€ canvas/          # Konva canvas components
    β”‚   β”‚   β”œβ”€β”€ panels/          # Side panels
    β”‚   β”‚   β”œβ”€β”€ toolbar/         # Top toolbar
    β”‚   β”‚   └── ui/              # shadcn/ui components
    β”‚   β”œβ”€β”€ hooks/               # Custom React hooks
    β”‚   β”œβ”€β”€ lib/                 # Utilities and state
    β”‚   β”‚   β”œβ”€β”€ geometry/        # Geometric calculations
    β”‚   β”‚   β”œβ”€β”€ schema/          # Zod schemas
    β”‚   β”‚   └── state/           # Zustand store
    β”‚   β”œβ”€β”€ models/              # TypeScript types
    β”‚   └── services/            # API client services
    └── public/                  # Static assets

πŸ”‘ Environment Variables

Backend (paintjob/.env)

# Database
DATABASE_URL=postgresql+asyncpg://user:password@localhost:5432/paintjob

# JWT Authentication
SECRET_KEY=your-secret-key-here
ALGORITHM=HS256
ACCESS_TOKEN_EXPIRE_MINUTES=720

# Optional: For production
CORS_ORIGINS=http://localhost:3000

Frontend (paintjob-fe/.env.local)

# API Configuration
NEXT_PUBLIC_API_URL=http://localhost:8000/api

# Optional: For production
NEXT_PUBLIC_ENV=development

Note: These environment files are already included in the repository. Update values as needed for your setup.


πŸ—οΈ Tech Stack

Backend

  • FastAPI - Modern async web framework
  • SQLAlchemy - ORM with async support
  • PostgreSQL - Relational database
  • Alembic - Database migrations
  • Pydantic - Data validation
  • JWT - Token-based authentication
  • Poetry - Dependency management
  • Pytest - Testing framework

Frontend

  • Next.js 15 - React framework (App Router)
  • TypeScript - Type safety
  • React Konva - Canvas rendering
  • Zustand - State management
  • Zod - Schema validation
  • shadcn/ui - UI components (Radix UI)
  • Tailwind CSS - Styling
  • pnpm - Package manager

🌟 Key Features

Backend API

  • βœ… User authentication with JWT tokens
  • βœ… Project and room management
  • βœ… Wall geometry and obstacle tracking
  • βœ… Motion path generation for automated painting
  • βœ… RESTful API with comprehensive validation
  • βœ… Cascade deletion for hierarchical data
  • βœ… Full test coverage

Frontend Editor

  • βœ… Canvas-based visual editor (Konva.js)
  • βœ… Drag-and-drop interface
  • βœ… Project/room/wall hierarchy
  • βœ… Real-time dimension editing with sliders
  • βœ… Window and door placement
  • βœ… Grid and snap functionality
  • βœ… Undo/redo history
  • βœ… Import/export JSON scenes
  • βœ… Zoom and pan controls

πŸ“„ API Endpoints Overview

See API_DOCUMENTATION.md for complete reference.

Authentication

  • POST /api/users/ - Create user account
  • POST /api/users/login - Login and get JWT token
  • GET /api/users/me - Get current user profile

Projects

  • POST /api/projects/ - Create project
  • GET /api/projects/ - List user's projects
  • GET /api/projects/{id}/with-rooms - Get project with rooms
  • PUT /api/projects/{id} - Update project
  • DELETE /api/projects/{id} - Delete project (cascades)

Rooms & Walls

  • POST /api/rooms/ - Create room
  • POST /api/walls/ - Create wall
  • GET /api/rooms/{id}/walls - Get walls for room
  • PUT /api/walls/{id} - Update wall geometry

Motion Paths

  • POST /api/paths/generate-motion-path - Generate painting path
  • POST /api/paths/preview-path - Preview path statistics

πŸ› οΈ Development Commands

Backend

cd paintjob

# Install dependencies
poetry install

# Run development server
python3 main.py

# Run tests
pytest -v

# Create new migration
alembic revision --autogenerate -m "description"

# Apply migrations
alembic upgrade head

# Rollback migration
alembic downgrade -1

Frontend

cd paintjob-fe

# Install dependencies
pnpm install

# Run development server
pnpm dev

# Build for production
pnpm build

# Run production build
pnpm start

# Lint code
pnpm lint

πŸ› Troubleshooting

Backend Issues

Database connection fails:

# Check PostgreSQL is running
psql -U postgres -c "SELECT 1;"

# Verify DATABASE_URL in .env
cat paintjob/.env | grep DATABASE_URL

Poetry installation issues:

# Clear poetry cache
poetry cache clear --all pypi

# Reinstall dependencies
rm poetry.lock
poetry install

Migration errors:

# Reset database (⚠️ destroys all data)
alembic downgrade base
alembic upgrade head

Frontend Issues

Port 3000 already in use:

# Run on different port
pnpm dev -- -p 3001

pnpm not found:

# Install pnpm globally
npm install -g pnpm

Module not found errors:

# Clear cache and reinstall
rm -rf node_modules pnpm-lock.yaml
pnpm install

πŸ“ž Support

For issues or questions:

  1. Check the documentation in /docs
  2. Review API_DOCUMENTATION.md
  3. Check TESTING_GUIDE.md
  4. Contact the repository owner

βš–οΈ License

Proprietary - All Rights Reserved

This software is proprietary and confidential. Unauthorized copying, distribution, or use is strictly prohibited.

By accessing this repository:

  • You agree to the terms in CLA.md
  • You understand this is VIEW-ONLY access
  • You acknowledge all contributions become property of the owner
  • You agree to follow CONTRIBUTING.md guidelines

🀝 Contributing

READ THIS BEFORE CONTRIBUTING:

This repository has STRICT contribution rules:

  1. Read and accept CLA.md first
  2. Follow CONTRIBUTING.md guidelines
  3. All contributions are VIEW-ONLY
  4. You do NOT own any code you contribute

Summary:

  • Fork and create pull requests only
  • No direct commits to main
  • All PRs require review and approval
  • Contributors grant full rights to repository owner

See CONTRIBUTING.md for complete guidelines.


🎯 Roadmap

  • Add frontend tests (Jest + React Testing Library)
  • Implement motion path visualization
  • Add real-time collaboration
  • Mobile app (React Native)
  • Docker containerization
  • CI/CD pipeline
  • Production deployment guides

πŸ“ Changelog

See git commit history for detailed changes.

Version 1.0.0 (October 2025)

  • Initial release
  • Complete backend API
  • Frontend editor
  • Database migrations
  • Comprehensive test suite

Made with ❀️ by the Paintjob Team

Last Updated: October 5, 2025

About

The Full Stack Overkill Paint Job Project - Enjoy

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors