A repository for the pidi.email app. A fast local first web based email client. Made as a Graduation project at SSPŠ.
  • TypeScript 62.5%
  • Rust 32.4%
  • HTML 2.4%
  • CSS 2.1%
  • Dockerfile 0.4%
  • Other 0.1%
Find a file
2026-11-13 15:39:37 +01:00
.assets feat: attachemnt & email rendering impovments (#34) 2026-01-31 16:17:10 +01:00
assets feat: add assets - project report and pitch (#1) 2026-11-13 15:39:37 +01:00
ci fix: ci crash (#41) 2026-02-08 21:08:57 +01:00
public feat: added delete inbox option (#28) 2026-01-25 13:25:48 +01:00
src fix: PWA and posthog (#51) 2026-05-17 16:17:58 +02:00
.gitignore feat: add posthog for analytics (#47) 2026-02-15 22:41:31 +01:00
AGENTS.md feat: email sending and drafts (#37) 2026-02-08 14:26:26 +01:00
biome.json fix: add a biome exeption for backedn bindings 2026-01-10 09:41:29 +01:00
bun.lock feat: add posthog for analytics (#47) 2026-02-15 22:41:31 +01:00
components.json feat: desing mock 2025-11-09 13:09:16 +01:00
lefthook.yml fix: lefthook 2026-01-15 08:14:47 +01:00
LICENSE license 2025-06-01 23:22:46 +06:00
next.config.ts fix: PWA and posthog (#51) 2026-05-17 16:17:58 +02:00
open-next.config.ts feat: CI 2025-12-08 11:16:18 +01:00
package.json feat: add posthog for analytics (#47) 2026-02-15 22:41:31 +01:00
postcss.config.mjs feat: desing mock 2025-11-09 13:09:16 +01:00
README.md feat: add assets - project report and pitch (#1) 2026-11-13 15:39:37 +01:00
tsconfig.json feat: commit bindings so i dont have to build them 2025-12-14 12:59:19 +01:00
wrangler.jsonc fix: PWA and posthog (#51) 2026-05-17 16:17:58 +02:00

Pidi Email

A high-performance, local-first email client built with Next.js, React Router, and a Rust backend.

Final Report Presentation Markdown Logo

🚀 Quick Start

Prerequisites

  • Bun: For frontend and coordination
  • Rust: For the backend service
  • Docker: For the PostgreSQL database
  • Nix (Optional): For a reproducible development environment

Installation

bun install

Development

  1. Start the database:
    cd src/backend
    docker-compose up -d
    
  2. Run the backend:
    bun run backend:dev
    
  3. Run the frontend:
    bun dev
    

🏗️ Architecture

Pidi Email uses a "Local-First" architecture designed for speed and offline capability:

  1. Next.js Shell: Next.js 15 acts as the entry point and delivery mechanism, redirecting all application routes to a single-page /shell.
  2. React Router SPA: The entire UI logic lives inside the shell, handled by React Router 7 for instant client-side navigation.
  3. Dexie.js (IndexedDB): Email metadata and bodies are stored locally in the browser's IndexedDB, allowing for near-instant search and offline access.
  4. Rust Backend: A high-concurrency Axum server handles synchronization with email providers (Gmail), authentication, and attachment proxying.

🎨 Features

  • 📧 Local-First Sync: Blazing fast email interactions by reading from local IndexedDB.
  • 📎 Attachment Support: Integrated attachment synchronization and secure download proxy.
  • 🔑 OAuth2 Integration: Secure Google/Gmail authentication with automatic token management.
  • ⚡ Real-time Updates: WebSocket integration for live sync progress and new message notifications.
  • 🌙 Modern UI: Built with Tailwind CSS 4 and shadcn/ui components.
  • 🛠️ Type Safety: Automatic TypeScript binding generation from Rust structs.

🛠️ Tech Stack

  • Frontend: Next.js 15, React Router 7, Dexie.js, TanStack Query, Tailwind CSS 4
  • Backend: Rust (Axum, SQLx), PostgreSQL, Google Gmail API
  • Deployment: Configured for Cloudflare Workers via OpenNext

📁 Key Files

  • src/frontend/app.tsx - Main React Router application logic
  • src/backend/src/main.rs - Axum server and route registration
  • src/backend/src/providers/google/populate_db.rs - Gmail sync engine
  • src/backend/src/routes/attachments.rs - Attachment download handler
  • src/lib/db.ts - Dexie.js database schema and initialization
  • src/backend/bindings/ - Auto-generated TypeScript types from Rust

🔧 Useful Commands

  • bun run gen:types-dev: Regenerate TypeScript bindings from Rust models (requires Nix).
  • bun run backend:check: Run Rust type checking and linting.
  • bun run format: Format the frontend code using Biome.