Perga Web
The browser client for Perga. Plan your days and manage notes with your own Perga API server.
Overview
Perga Web uses React and Vite. Set API_BASE_URL to connect it to your API server.
Screenshots

Demo
Try Perga without installing it at demo.getperga.me.
Features
- Daily planning
- Monthly and custom agendas
- Notes with folders, pinned notes, import, export, and full-text search
- User authentication, including Google sign-in
- Responsive design with mobile support
- PWA support
- Dark theme
Tech Stack
- React 19.0
- TypeScript (~5.7.2)
- Vite 6.3
- Tailwind CSS 4.1
- Tiptap 3.20
- React Router 7.4
- Axios 1.8
- Prettier 3.3
- ESLint 9.21
Requirements
- Node.js 24.22.3 (see
.nvmrc) - npm 8+
Environment variables
Create a .env file from the example and adjust values as needed:
cp .env.example .env
Available variables:
API_BASE_URL— Base URL of Perga API (example:http://127.0.0.1:8000/api/v1)IS_SIGNUP_DISABLED— Set totrueto hide SignupGOOGLE_CLIENT_ID— Enables Google sign-in; must match the API'sGOOGLE_CLIENT_IDCSP_MODE— Docker runtime only:report-only(default),enforce, oroff.CSP_POLICY— Custom CSP for Docker; leave empty for the default policy.
Content Security Policy
The Docker runtime defaults to report-only: violations appear in the browser
console without blocking resources. Check sign-in, editing, attachments and
PWA updates, then set CSP_MODE=enforce and recreate Web. Use CSP_MODE=off
if your proxy manages CSP.
CSP_POLICY replaces the generated policy, including its API and Google
sign-in sources. Keep the sources your installation needs. Use a single line
without double quotes, backslashes, dollar signs or control characters;
invalid settings prevent startup. These options do not configure Vite dev.
Installation
- Clone the repository:
git clone https://github.com/getperga/perga-web.gitcd perga-web
- Install dependencies:
npm install
- Configure environment:
cp .env.example .env# then edit .env
Development
Start the Vite development server (defaults to http://localhost:5173):
npm run dev
Code quality and formatting (ESLint & Prettier):
npm run lint # check linting
npm run format # write formatting
npm run format:check # check formatting only
Build & Preview
Build production assets (TypeScript build + Vite build):
npm run build
Preview the production build locally:
npm run preview
The build output is written to the dist/ directory.
Docker
The app can be built and served by nginx using Docker Compose. The runtime uses the pinned nginx 1.31.9 Alpine slim image.
# Build and start
docker compose up -d
# Stop
docker compose down
Defaults:
- Container serves on port 80 via nginx
- Host is mapped to http://localhost:3000 (compose maps
3000:80) API_BASE_URLis passed as a build ARG and from.env(compose usesenv_file: .env)
Health endpoint (inside container): GET /health/ → 200 ok
Project Structure
perga-web/
├── src/ # Source code
│ ├── api/ # API clients & types
│ ├── assets/ # Static assets
│ ├── common/ # Shared UI/components/utils
│ ├── contexts/ # React contexts
│ ├── sections/ # Main application sections
│ │ ├── auth/ # Authentication components
│ │ ├── planner/ # Planning functionality
│ │ ├── notes/ # Notes functionality
│ │ └── settings/ # User settings
│ ├── App.tsx # Main application component
│ └── main.tsx # Application entry point
├── public/ # Public assets
├── .env.example # Example environment variables
├── docker-compose.yml # Docker Compose configuration
├── Dockerfile # Multi-stage build (Node 24) + nginx runner
├── nginx/nginx.conf # nginx config for SPA
├── index.html # HTML entry point
├── package.json # Scripts and dependencies
├── tsconfig.json # TypeScript project references
└── vite.config.ts # Vite configuration and path aliases
Testing
The project uses Vitest for unit and component testing.
Run all tests:
npm run test
Run tests in watch mode:
npm run test:watch
Run tests with coverage:
npm run test:coverage
Notes Section
Use Notes to organize and search your writing:
- Folders: Group notes in folders and subfolders.
- Pinned notes: Use the note menu or editor toolbar to pin a note. Find pinned notes in the right panel on desktop, or tap the pin button on mobile.
- Import/Export: Import and export Markdown and HTML; export PDF.
- Search: Search across note titles and contents.
Pinned notes show the most recently updated first, with their folder paths. Notes in Trash are hidden from the list and cannot be pinned or unpinned. Use Restore to return a note to the root Notes folder; pinned notes reappear in the list.
Opening a note from a link
Link to a note with <webBaseUrl>/notes/<id>/, for example
https://app.getperga.me/notes/38479/. After sign-in, Web opens the note and
changes the URL to /notes/. Back returns to the previous page.
Invalid or unavailable notes show an error without changing the selection.
For self-hosted installations, replace the base URL with your own.
Moving and duplicating content in the editor
Use Shift+Option+↑/↓ on macOS or Shift+Alt+↑/↓ on Windows and Linux to move the current block or selected blocks. In a list, this moves list items. Paragraphs move as a whole, including wrapped lines and soft line breaks.
Use Cmd+D on macOS to duplicate the current block, list item, or selection below the original. The cursor or selection moves to the copy.
Path Aliases
@→src@api→src/api@assets→src/assets@common→src/common@contexts→src/contexts@sections→src/sections@auth→src/sections/auth@planner→src/sections/planner@notes→src/sections/notes@settings→src/sections/settings
CI
GitHub Actions workflow: .github/workflows/ci.yml
Badge:
Troubleshooting
- CORS errors: check
API_BASE_URLand add the Web origin to the API'sCORS_ORIGINS. - Signup hidden: set
IS_SIGNUP_DISABLED=false(or omit) to show the Signup link. - Blank page: check that nginx serves
index.htmlfor app routes (try_filesinnginx.conf).
License
Released under the MIT License.