This is a monorepo project using npm workspaces, structured with three main packages:
open-notes/
├── packages/
│ ├── client/ # React + Vite + Electron Renderer
│ ├── electron/ # Electron Main Process
│ └── server/ # Backend Server
├── package.json # Root workspace configuration
└── ... config files
The frontend application built with React, TypeScript, and Vite.
- React 18 with TypeScript
- Vite for fast development and building
- Electron integration for desktop app
Commands:
npm run dev -w packages/client # Start dev server
npm run build -w packages/client # Build for production
npm run lint -w packages/client # Run ESLint
npm run preview -w packages/client # Preview buildThe Electron main process and preload scripts.
- Electron main process entry point
- IPC communication bridge via preload
- Native desktop app features
Commands:
npm run build -w packages/electron # Compile TypeScriptBackend server (Node.js + Express or similar).
- Backend API
- Database integration
- Business logic
Commands:
npm run dev -w packages/server # Start development server
npm run build -w packages/server # Build for productionnpm installThis will install all dependencies for all workspaces.
npm run devThis runs the client workspace in development mode with Vite.
npm run buildThis builds the client and Electron app for distribution.
npm run lintThis runs ESLint on the client workspace.
This project uses npm workspaces to manage multiple packages. Benefits include:
- Shared dependencies at the root level
- Easy cross-workspace references
- Simplified dependency management
- TypeScript (shared across all workspaces)
Each workspace has its own package.json with specific dependencies.
Root-level scripts can be run from the project root:
npm run dev # Dev build for client (with hot reload)
npm run build # Production build (client + electron-builder)
npm run build:all # Build all packages in parallel (client, electron, server)
npm run lint # Lint all code
npm run preview # Preview built appnpm run dev - Starts the client in development mode with Vite's hot module reloading
- Runs:
npm run dev -w packages/client
npm run build - Full production build with electron packaging
- Compiles TypeScript files
- Builds electron process (
packages/electron) - Bundles client with Vite
- Packages with electron-builder
- Runs:
tsc && npm run build -w packages/electron && vite build && electron-builder
npm run build:all - Builds all packages concurrently (useful for CI/CD)
- Uses
concurrentlyto run builds in parallel - Builds client, electron, and server packages simultaneously
npm run lint - Runs ESLint on the client workspace
- Checks TypeScript and TSX files
npm run preview - Preview the built application
- Shows the production build locally before distribution
- tsconfig.json - Root TypeScript configuration (includes all packages)
- electron-builder.json5 - Electron builder configuration (in client package)
- .eslintrc.cjs - ESLint configuration
- .gitignore - Git ignore rules
- Update workspace package names and descriptions
- Configure the server with your preferred backend framework
- Set up environment variables for each package
- Configure CI/CD pipelines
- Add additional workspaces as needed