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:
16
CHANGELOG.md
16
CHANGELOG.md
@@ -8,20 +8,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
## [Unreleased]
|
||||
|
||||
### 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)
|
||||
- `housekeeping/` - Database backup and maintenance scripts
|
||||
- **Docker Configuration**: Updated Dockerfile and docker-compose files for monorepo build process
|
||||
- **Build Process**: Updated to use workspace-aware npm commands
|
||||
- **Docker Configuration**: Updated Dockerfile and docker-compose files for new directory structure
|
||||
- **Documentation**: Updated README.md and CLAUDE.md to reflect new structure
|
||||
|
||||
### Migration Notes
|
||||
- All application code moved to `web-app/` workspace using `git mv` to preserve history
|
||||
- All database backup scripts moved to `housekeeping/` workspace
|
||||
- Docker builds now install dependencies at root level and build from `web-app/` workspace
|
||||
- All application code moved to `web-app/` directory using `git mv` to preserve history
|
||||
- All database backup scripts moved to `housekeeping/` directory
|
||||
- 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/`
|
||||
- `.gitignore` updated to handle `node_modules` at any workspace level
|
||||
- Root `package.json` now manages workspaces and delegates commands to appropriate workspace
|
||||
- `.gitignore` updated to handle `node_modules` at any directory level
|
||||
- No workspace management - each project is completely independent
|
||||
|
||||
## [2.17.0] - 2025-12-21
|
||||
|
||||
|
||||
29
CLAUDE.md
29
CLAUDE.md
@@ -2,31 +2,30 @@
|
||||
|
||||
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:
|
||||
- **web-app**: Next.js 14 utility bills tracking application
|
||||
- **housekeeping**: Database backup and maintenance scripts
|
||||
This is a multi-project repository containing:
|
||||
- **web-app/**: Next.js 14 utility bills tracking application
|
||||
- **housekeeping/**: Database backup and maintenance scripts
|
||||
|
||||
Each project is self-contained with its own dependencies.
|
||||
|
||||
## Development Commands
|
||||
|
||||
From the monorepo root:
|
||||
- `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)
|
||||
All commands should be run from within the respective project directory.
|
||||
|
||||
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 build` - Build production version
|
||||
- `npm start` - Start production server
|
||||
- `npm run prettier` - Format code
|
||||
- `npm run seed` - Seed database with initial data
|
||||
|
||||
From the housekeeping workspace (`cd housekeeping`):
|
||||
- `npm run backup:standalone` - Run standalone database backup
|
||||
- `npm run backup:swarm` - Run swarm database backup
|
||||
- `npm run dump:standalone` - Run standalone database dump
|
||||
**Housekeeping** (`cd housekeeping`):
|
||||
- `./db-backup--standalone.sh` - Run standalone database backup
|
||||
- `./db-backup--swarm.sh` - Run swarm database backup
|
||||
- `./db-dump--standalone.sh` - Run standalone database dump
|
||||
- See housekeeping/README.md for more details
|
||||
|
||||
## Deployment Commands
|
||||
|
||||
22
README.md
22
README.md
@@ -19,24 +19,24 @@ All the actions user `withUser` to fetch user ID, which is then used in all the
|
||||
|
||||
# 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
|
||||
- **housekeeping**: Database backup and maintenance scripts
|
||||
- **web-app/**: Next.js application for tracking utility bills
|
||||
- **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
|
||||
# Run dev server
|
||||
# Web app
|
||||
cd web-app
|
||||
npm install
|
||||
npm run dev
|
||||
|
||||
# Build the web app
|
||||
npm run build
|
||||
|
||||
# Run database backup (standalone)
|
||||
npm run backup:standalone --workspace=housekeeping
|
||||
# Housekeeping scripts
|
||||
cd housekeeping
|
||||
./db-backup--standalone.sh
|
||||
```
|
||||
|
||||
# Database Backup & Restore
|
||||
|
||||
39
evidencija-rezija.code-workspace
Normal file
39
evidencija-rezija.code-workspace
Normal 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"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -12,14 +12,7 @@ Database backup and maintenance scripts for the Evidencija Režija application.
|
||||
|
||||
## Usage
|
||||
|
||||
From the monorepo root:
|
||||
|
||||
```bash
|
||||
npm run backup:standalone --workspace=housekeeping
|
||||
npm run backup:swarm --workspace=housekeeping
|
||||
```
|
||||
|
||||
Or directly from the housekeeping directory:
|
||||
From the housekeeping directory:
|
||||
|
||||
```bash
|
||||
cd housekeeping
|
||||
|
||||
8757
package-lock.json
generated
8757
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
17
package.json
17
package.json
@@ -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"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user