refactor: simplify to independent multi-project structure

Removed npm workspace configuration in favor of simple multi-project repository.
Each project (web-app, housekeeping) is now completely self-contained.

## Changes
- Removed root package.json and package-lock.json
- Added VS Code workspace file for better project organization
- Updated documentation to reflect independent project structure
- Each project manages its own dependencies without workspace linking

## Structure
- web-app/: Self-contained Next.js application
- housekeeping/: Self-contained DB maintenance scripts
- No workspace management or dependency sharing
- Monorepo is purely for Git organization

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
Knee Cola
2025-12-25 12:25:46 +01:00
parent 8685ac36b8
commit 362a49e3cd
7 changed files with 73 additions and 8816 deletions

View File

@@ -8,20 +8,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased] ## [Unreleased]
### Changed ### Changed
- **Monorepo Architecture**: Converted repository to monorepo structure with npm workspaces - **Repository Structure**: Converted to multi-project monorepo
- `web-app/` - Main Next.js application (formerly root directory) - `web-app/` - Main Next.js application (formerly root directory)
- `housekeeping/` - Database backup and maintenance scripts - `housekeeping/` - Database backup and maintenance scripts
- **Docker Configuration**: Updated Dockerfile and docker-compose files for monorepo build process - **Docker Configuration**: Updated Dockerfile and docker-compose files for new directory structure
- **Build Process**: Updated to use workspace-aware npm commands
- **Documentation**: Updated README.md and CLAUDE.md to reflect new structure - **Documentation**: Updated README.md and CLAUDE.md to reflect new structure
### Migration Notes ### Migration Notes
- All application code moved to `web-app/` workspace using `git mv` to preserve history - All application code moved to `web-app/` directory using `git mv` to preserve history
- All database backup scripts moved to `housekeeping/` workspace - All database backup scripts moved to `housekeeping/` directory
- Docker builds now install dependencies at root level and build from `web-app/` workspace - Each project is self-contained with its own package.json and dependencies
- Docker builds install dependencies from `web-app/` directory
- Volume mounts in docker-compose updated to reference `web-app/etc/hosts/` - Volume mounts in docker-compose updated to reference `web-app/etc/hosts/`
- `.gitignore` updated to handle `node_modules` at any workspace level - `.gitignore` updated to handle `node_modules` at any directory level
- Root `package.json` now manages workspaces and delegates commands to appropriate workspace - No workspace management - each project is completely independent
## [2.17.0] - 2025-12-21 ## [2.17.0] - 2025-12-21

View File

@@ -2,31 +2,30 @@
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
## Monorepo Structure ## Repository Structure
This is a monorepo with the following workspaces: This is a multi-project repository containing:
- **web-app**: Next.js 14 utility bills tracking application - **web-app/**: Next.js 14 utility bills tracking application
- **housekeeping**: Database backup and maintenance scripts - **housekeeping/**: Database backup and maintenance scripts
Each project is self-contained with its own dependencies.
## Development Commands ## Development Commands
From the monorepo root: All commands should be run from within the respective project directory.
- `npm run dev` - Start development server (runs web-app workspace)
- `npm run build` - Build production version (builds web-app workspace)
- `npm start` - Start production server (runs web-app workspace)
- `npm run prettier` - Format code with Prettier (entire monorepo)
- `npm run prettier:check` - Check code formatting (entire monorepo)
From the web-app workspace (`cd web-app`): **Web App** (`cd web-app`):
- `npm install` - Install dependencies
- `npm run dev` - Start development server - `npm run dev` - Start development server
- `npm run build` - Build production version - `npm run build` - Build production version
- `npm start` - Start production server - `npm start` - Start production server
- `npm run prettier` - Format code
- `npm run seed` - Seed database with initial data - `npm run seed` - Seed database with initial data
From the housekeeping workspace (`cd housekeeping`): **Housekeeping** (`cd housekeeping`):
- `npm run backup:standalone` - Run standalone database backup - `./db-backup--standalone.sh` - Run standalone database backup
- `npm run backup:swarm` - Run swarm database backup - `./db-backup--swarm.sh` - Run swarm database backup
- `npm run dump:standalone` - Run standalone database dump - `./db-dump--standalone.sh` - Run standalone database dump
- See housekeeping/README.md for more details - See housekeeping/README.md for more details
## Deployment Commands ## Deployment Commands

View File

@@ -19,24 +19,24 @@ All the actions user `withUser` to fetch user ID, which is then used in all the
# Monorepo Structure # Monorepo Structure
This project is organized as a monorepo with multiple workspaces: This repository contains multiple independent projects:
- **web-app**: The main Next.js application for tracking utility bills - **web-app/**: Next.js application for tracking utility bills
- **housekeeping**: Database backup and maintenance scripts - **housekeeping/**: Database backup and maintenance scripts
## Working with Workspaces Each project is self-contained with its own dependencies and package.json.
From the monorepo root: ## Working with Projects
```bash ```bash
# Run dev server # Web app
cd web-app
npm install
npm run dev npm run dev
# Build the web app # Housekeeping scripts
npm run build cd housekeeping
./db-backup--standalone.sh
# Run database backup (standalone)
npm run backup:standalone --workspace=housekeeping
``` ```
# Database Backup & Restore # Database Backup & Restore

View File

@@ -0,0 +1,39 @@
{
"folders": [
{
"name": "🌐 web-app",
"path": "web-app"
},
{
"name": "🔧 housekeeping",
"path": "housekeeping"
},
{
"name": "📦 root",
"path": "."
}
],
"settings": {
"files.exclude": {
"**/node_modules": true,
"**/.next": true,
"**/.git": false
},
"search.exclude": {
"**/node_modules": true,
"**/.next": true,
"**/package-lock.json": true
},
"typescript.tsdk": "web-app/node_modules/typescript/lib",
"eslint.workingDirectories": [
"web-app"
]
},
"extensions": {
"recommendations": [
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"bradlc.vscode-tailwindcss"
]
}
}

View File

@@ -12,14 +12,7 @@ Database backup and maintenance scripts for the Evidencija Režija application.
## Usage ## Usage
From the monorepo root: From the housekeeping directory:
```bash
npm run backup:standalone --workspace=housekeeping
npm run backup:swarm --workspace=housekeeping
```
Or directly from the housekeeping directory:
```bash ```bash
cd housekeeping cd housekeeping

8757
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,17 +0,0 @@
{
"name": "evidencija-rezija-monorepo",
"private": true,
"version": "2.20.0",
"workspaces": [
"web-app",
"housekeeping"
],
"scripts": {
"dev": "npm run dev --workspace=web-app",
"build": "npm run build --workspace=web-app",
"start": "npm run start --workspace=web-app"
},
"engines": {
"node": ">=18.17.0"
}
}