| layout | default |
|---|---|
| title | Getting Started |
| description | Complete guide to installing, configuring, and running Note Sync Now |
| permalink | /docs/en/getting-started/ |
| lang | en |
This guide will walk you through installing, configuring, and running Note Sync Now on your local machine.
Before you begin, ensure you have the following installed:
| Requirement | Version | Installation |
|---|---|---|
| Node.js | 18+ (20 LTS recommended) | nodejs.org |
| npm | 9+ | Included with Node.js |
| Git | Any | git-scm.com |
Optional for production-like environment:
- Redis 7+ (redis.io)
node --version # Should show v18+ or v20+
npm --version # Should show 9+
git --version # Any versiongit clone https://github.com/LessUp/brave-sync-notes.git
cd brave-sync-notescd apps/api
npm ci
node index.jsYou should see:
Server listening on port 3002
Storage: sqlite (fallback: memory)
Health check available at http://localhost:3002/health
cd apps/web
npm ci
npm run devYou should see:
VITE v5.x.x ready in xxx ms
โ Local: http://localhost:5173/
โ Network: use --host to expose
โ press h + enter to show help
Navigate to http://localhost:5173 in your browser.
Create a .env file in apps/api/:
# Server Configuration
PORT=3002
NODE_ENV=development
# CORS (for development, client runs on port 5173)
CORS_ORIGIN=http://localhost:5173
# Storage Configuration
PRIMARY_STORAGE=sqlite
FALLBACK_STORAGE=memory
SQLITE_DB_PATH=./data/sync.db
# Room Configuration
ROOM_TTL_MS=3600000
MAX_MEMORY_ROOMS=10000
# Redis Configuration (optional)
# REDIS_HOST=localhost
# REDIS_PORT=6379
# REDIS_PASSWORD=
# REDIS_DB=0| Storage | Use Case | Configuration |
|---|---|---|
| Memory | Development, testing | PRIMARY_STORAGE=memory |
| SQLite | Single-server deployment | PRIMARY_STORAGE=sqlite |
| Redis | Multi-server, production | PRIMARY_STORAGE=redis |
Create a .env file in apps/web/:
# For development, this is optional (defaults to localhost:3002)
# VITE_SOCKET_URL=http://localhost:3002brave-sync-notes/
โโโ apps/
โ โโโ web/ # React + Vite frontend
โ โ โโโ src/
โ โ โ โโโ components/ # React UI components
โ โ โ โโโ hooks/ # Custom React hooks (useSocket, etc.)
โ โ โ โโโ store/ # Zustand state management
โ โ โ โโโ utils/ # Utilities (crypto, conflict, storage)
โ โ โโโ public/ # Static assets
โ โ โโโ tests/ # Test files
โ โ โโโ index.html # HTML entry point
โ โ โโโ package.json # Client dependencies
โ โ โโโ vite.config.js # Vite configuration
โ โโโ api/ # Express + Socket.IO backend
โ โโโ src/
โ โ โโโ persistence/ # Storage adapters (Redis, SQLite, Memory)
โ โโโ tests/ # Test files
โ โโโ index.js # Server entry point
โ โโโ package.json # Server dependencies
โ โโโ .env.example # Environment template
โโโ docs/ # Documentation (this site)
โโโ changelog/ # Version history
โโโ .github/workflows/ # CI/CD automation
cd brave-sync-notes/server
# Run all tests
npm test
# Run with coverage
npm test -- --coverage
# Run property-based tests
npm run test:property
# Watch mode
npm test -- --watchcd brave-sync-notes/client
# Run all tests
npm test -- --run
# Run in watch mode
npm test
# Run with UI
npm test -- --ui- Open the application at
http://localhost:5173 - You will see a 12-word mnemonic (e.g., "abandon ability able about...")
- Save this mnemonic securely - it's your only recovery method
- Click "Create Room" or "Join"
- Open a new browser window or incognito mode
- Navigate to the same URL
- Enter the same 12-word mnemonic
- Click "Join Room"
- Type in one browser
- Watch the content appear in the other browser in real-time
- Try disconnecting and reconnecting - your content persists
# Error: Port 3002 (or 5173) is already in use
# Solution 1: Kill the process using the port
lsof -ti:3002 | xargs kill -9
# Solution 2: Use a different port
PORT=3003 node index.js # Server
npm run dev -- --port=5174 # Client# Error: Access-Control-Allow-Origin header
# Solution: Ensure CORS_ORIGIN matches your client URL
# In server/.env:
CORS_ORIGIN=http://localhost:5173# Clear npm cache
npm cache clean --force
# Delete node_modules and reinstall
rm -rf node_modules package-lock.json
npm ci# Use nvm to switch Node versions
nvm install 20
nvm use 20- Check the Architecture Guide for system understanding
- Review Security & Synchronization for encryption details
- Visit GitHub Issues for known problems
- Architecture Overview - Understand how the system works
- Security & Synchronization - Learn about encryption and sync
- Deployment Guide - Deploy to production
- Modify the theme: Edit
apps/web/src/styles/ - Add features: Extend
apps/api/src/ - Change storage: Configure different persistence adapters
- Read the Contributing Guide
- Check out open GitHub Issues
- Join GitHub Discussions
| Resource | Description |
|---|---|
| React Documentation | Learn React |
| Vite Documentation | Build tool used for client |
| Socket.IO | Real-time communication library |
| Zustand | State management |
| Keep a Changelog | Changelog format |
Last updated: 2026-04-16