This guide will help you get the Open Notes application up and running locally.
Before you start, ensure you have the following installed:
- Node.js (v18 or higher)
- Download from nodejs.org
- Verify installation:
node --version
- npm (v9 or higher, usually comes with Node.js)
- Verify installation:
npm --version
- Verify installation:
- Git (for cloning the repository)
git clone <repository-url>
cd open-notesThe project uses npm workspaces to manage multiple packages (client, server, electron).
npm installThis will automatically install dependencies for all workspaces:
packages/client— Vite React frontendpackages/server— Fastify backend serverpackages/electron— Electron main process
The postinstall hook automatically runs:
npm run check-licensesThis generates:
THIRD_PARTY_LICENSES.md— Full license documentationpackages/client/public/libraries.json— License data for the about dialog
npm run devThis will:
- Start the Vite React client on
http://localhost:5174(or next available port) - Start the Fastify server on
http://127.0.0.1:3000 - Start the Electron main process
- Watch for file changes and hot-reload
The application should open automatically in an Electron window.
| Command | Description |
|---|---|
npm run dev |
Start development server with hot reload |
npm run build |
Build the client for production |
npm run build:all |
Build client, electron, and server |
npm run lint |
Run ESLint checks |
npm run preview |
Preview the production build locally |
npm run format |
Format code with Prettier and organize imports |
npm run format:check |
Check if files are properly formatted |
npm run check-licenses |
Audit dependencies and generate license reports |
Since this is a monorepo with npm workspaces, you can run commands in specific workspaces:
npm run dev -w packages/client
npm run build -w packages/client
npm run lint -w packages/clientnpm run build -w packages/servernpm run dev -w packages/electron
npm run build -w packages/electronopen-notes/
├── packages/
│ ├── client/ # Vite React frontend
│ │ ├── src/
│ │ │ ├── App.tsx # Main app component
│ │ │ ├── main.tsx # Entry point
│ │ │ ├── api.ts # API client
│ │ │ ├── components/ # React components
│ │ │ └── lib/ # Utilities and types
│ │ ├── public/ # Static assets
│ │ │ └── libraries.json # Auto-generated license data
│ │ └── vite.config.ts # Vite configuration
│ ├── server/ # Fastify backend
│ │ └── src/
│ │ └── index.ts # Server entry point
│ └── electron/ # Electron desktop app
│ ├── main.ts # Electron main process
│ └── preload.ts # Preload script for IPC
├── scripts/
│ └── check-licenses.cjs # License compliance checker
├── .prettierrc.json # Prettier code formatting config
├── .editorconfig # EditorConfig for consistent formatting
├── package.json # Root package.json with workspaces
├── THIRD_PARTY_LICENSES.md # Generated license documentation
├── LICENSE # MIT License
└── README.md # Project overview
Modern ESLint 9 flat configuration (packages/client/):
- Uses the new flat config format (replaces
.eslintrc.cjs) - TypeScript support with
typescript-eslintv8 - React Hooks rules with
eslint-plugin-react-hooksv5 - React Refresh validation
- Configured to ignore dist folders and node_modules
Code formatting configuration:
- 2-space indentation
- Semicolons enabled (
semi: true) - Single quotes disabled (uses double quotes)
- Import organization enabled via
prettier-plugin-organize-imports
Editor configuration for consistent formatting across different editors:
- UTF-8 charset
- LF line endings
- 2-space indentation for code files
TypeScript configuration in packages/client/:
- Path alias:
@→./src - Target: ES2020
- Module: ESNext
- Vite — Fast build tool and dev server
- React 18 — UI library
- TypeScript — Type safety
- Tailwind CSS — Utility-first styling
- Plate.js — Rich text editor
- Radix UI — Accessible component primitives
- Lucide React — Icon library
- Fastify — Fast web framework
- TypeScript — Type safety
- Electron — Cross-platform desktop framework
- electron-builder — Build and package Electron apps
- ESLint 9 — Code quality checks with flat config
- Prettier — Code formatter with import organization
- TypeScript — Type checking
- Prettier — Code formatter with import organization
- ESLint — Code quality checks
- TypeScript — Type checking
npm run formatThis will:
- Format all code files with Prettier
- Organize and remove unused imports
- Fix code style issues
npm run check-licensesThis will:
- Scan all dependencies in all workspaces
- Validate licenses against approved list
- Generate or update
THIRD_PARTY_LICENSES.md - Update
packages/client/public/libraries.json
npm run lintCheck for code quality issues without fixing them.
If you see "Port 5173/5174 is in use" or "Port 3000 is in use":
For the client (Vite): Vite automatically tries the next available port. Check the output for the actual URL.
For the server (Fastify):
Change the port in packages/server/src/index.ts or kill the process using the port:
# Find process using port 3000
lsof -i :3000
# Or on Windows:
netstat -ano | findstr :3000Clear npm cache and reinstall:
npm cache clean --force
rm -rf node_modules package-lock.json
npm installEnsure you're using the correct Node.js version:
node --version # Should be v18+
npm --version # Should be v9+If issues persist, try:
npm run format # Format code
npm run lint # Check for errors
npm run build # Rebuildnpm run build:allThis generates:
packages/client/dist/— Optimized React apppackages/electron/dist-electron/— Electron bundlespackages/server/dist/— Server bundle (if applicable)
The build process includes electron-builder which generates:
- Windows installers
- macOS DMG/APP
- Linux packages
Check packages/client/electron-builder.json5 for packaging configuration.
- Vite Documentation: https://vite.dev/
- React Documentation: https://react.dev/
- Plate.js Documentation: https://platejs.org/
- Fastify Documentation: https://www.fastify.io/
- Electron Documentation: https://www.electronjs.org/docs
- Tailwind CSS Documentation: https://tailwindcss.com/docs
- ✅ Install dependencies:
npm install - ✅ Start development:
npm run dev - ✅ Open the app in the Electron window
- ✅ Edit code and watch it reload
- ✅ Read README.md for project philosophy and goals
If you encounter issues:
- Check this HOWTO.md file first
- Review error messages carefully
- Check the terminal output for clues
- Ensure all prerequisites are met
- Try cleaning and reinstalling:
npm install
Happy coding! 🚀