Development Setup
Prerequisites
- Docker / Docker Compose
- Node.js >=24.12.0
- pnpm >=10.24.0
- SQLite3
Steps
- Clone the repository:
git clone https://github.com/wsj-br/duplistatus.git
cd duplistatus
- Install dependencies (Debian/Ubuntu):
sudo apt update
sudo apt install sqlite3 git -y
- Remove old Node.js installations (if you already had it installed)
sudo apt-get purge nodejs npm -y
sudo apt-get autoremove -y
sudo rm -rf /usr/local/bin/npm
sudo rm -rf /usr/local/share/man/man1/node*
sudo rm -rf /usr/local/lib/dtrace/node.d
rm -rf ~/.npm
rm -rf ~/.node-gyp
sudo rm -rf /opt/local/bin/node
sudo rm -rf /opt/local/include/node
sudo rm -rf /opt/local/lib/node_modules
sudo rm -rf /usr/local/lib/node*
sudo rm -rf /usr/local/include/node*
sudo rm -rf /usr/local/bin/node*
- Install Node.js and pnpm:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash
source ~/.bashrc
nvm install --lts
nvm use --lts
npm install -g pnpm npm-check-updates doctoc
- Start the development server:
For the default TCP port (8666):
pnpm dev
Available Scripts
The project includes several npm scripts for different development tasks:
Development Scripts
pnpm dev- Start development server on port 8666 (includes pre-checks)pnpm build- Build the application for production (includes pre-checks)pnpm lint- Run ESLint to check code qualitypnpm typecheck- Run TypeScript type checkingscripts/upgrade-dependencies.sh- Upgrade all packages to the latest version, check for vulnerabilities, and automatically fix themscripts/clean-workspace.sh- Clean the workspace
Note: The preinstall script automatically enforces pnpm as the package manager.
Production Scripts
pnpm build-local- Build and prepare for local production (includes pre-checks, copies static files to standalone directory)pnpm start-local- Start production server locally (port 8666, includes pre-checks). Note: Runpnpm build-localfirst.pnpm start- Start production server (port 9666)
Docker Scripts
pnpm docker-up- Start Docker Compose stackpnpm docker-down- Stop Docker Compose stackpnpm docker-clean- Clean Docker environment and cachepnpm docker-devel- Build a development Docker image tagged aswsj-br/duplistatus:devel
Cron Service Scripts
pnpm cron:start- Start cron service in production modepnpm cron:dev- Start cron service in development mode with file watching (port 8667)pnpm cron:start-local- Start cron service locally for testing (port 8667)
Test Scripts
pnpm generate-test-data- Generate test backup data (requires --servers=N parameter)pnpm show-overdue-notifications- Show overdue notification contentspnpm run-overdue-check- Run overdue check at specific date/timepnpm test-cron-port- Test cron service port connectivitypnpm test-overdue-detection- Test overdue backup detection logicpnpm validate-csv-export- Validate CSV export functionalitypnpm set-smtp-test-config- Set SMTP test configuration from environment variables (see Test Scripts)pnpm test-smtp-connections- Test SMTP connection type cross-compatibility (see Test Scripts)pnpm test-entrypoint- Test Docker entrypoint script in local development (see Test Scripts)pnpm take-screenshots- Take screenshots for documentation (see Documentation Tools)