Umami Project Structure

A simple, fast, privacy-focused alternative to Google Analytics. Umami is built as a clean, unified Next.js application that demonstrates how to build a high-quality product with a streamlined tech stack.

Updated 2025-12-30

#umami #analytics #nextjs #prisma #postgresql #mysql #open-source
PNGPDF

Project Directory

umami/
src/
The Next.js source code
app/
Next.js App Router
components/
React components
queries/
Database queries
tracker/
The client-side tracking script
prisma/
Database schema (Postgres & MySQL)
db/
SQL migration files
public/
Static assets
next.config.ts
package.json

Repository Info

Tech Stack

  • Framework-Next.js
  • Language-TypeScript
  • Database-PostgreSQL / MySQL with Prisma
  • Styling-Tailwind CSS
  • Tracking-Custom lightweight JS tracker

Architecture Notes

Umami is a masterclass in simplicity. Unlike PostHog which uses ClickHouse, Umami stays within the bounds of traditional relational databases (PostgreSQL or MySQL) to keep self-hosting accessible. It uses a unified Next.js codebase for both the API and the dashboard, which simplifies deployment significantly. Its custom tracking script is designed to be extremely small and performant, ensuring it doesn't impact end-user site speed.

Key Directories

  • src/app/-Houses the modern Next.js App Router logic and UI scenes
  • src/queries/-A clean abstraction layer for all database interactions via Prisma
  • src/tracker/-The highly optimized tracking script that collects site data
  • prisma/-Defines the core data model for websites, sessions, and events

Why This Structure?

Umami is a perfect reference for anyone building a 'single-app' SaaS. It shows how to achieve high production value and significant scale without the complexity of a monorepo or microservices. It's a gold standard for clean, maintainable Next.js code.

Share this template

Related Templates

© 2025 FolderStructure.dev