Privacy-Focused-Web-Analytics-Dashboard

Project Structure

← Back to README Documentation Index Developer Guide Integration Guide

This document outlines the organized structure of the Privacy-Focused Web Analytics Dashboard project.

Directory Layout

project-root/
├── config/                          # Build configuration (Vite)
│   ├── vite.config.ts               # Vite client build configuration
│   └── vite.config.server.ts        # Vite server build configuration
│
├── docs/                            # Documentation
│   ├── FUSION_STARTER.md            # Fusion Starter template documentation
│   └── PROJECT_STRUCTURE.md         # This file
│
├── client/                          # React SPA Frontend
│   ├── pages/                       # Route components
│   │   ├── Index.tsx               # Landing page
│   │   ├── Dashboard.tsx           # Analytics dashboard
│   │   └── NotFound.tsx            # 404 page
│   ├── components/
│   │   ├── ui/                     # Pre-built UI components (Radix UI + Tailwind)
│   │   └── dashboard/              # Dashboard-specific components
│   │       ├── MetricCard.tsx
│   │       ├── PageViewsChart.tsx
│   │       ├── TopPagesChart.tsx
│   │       ├── DeviceDistributionChart.tsx
│   │       └── ReferrerChart.tsx
│   ├── hooks/                      # Custom React hooks
│   │   ├── use-mobile.tsx
│   │   ├── use-toast.ts
│   │   └── useTheme.ts
│   ├── lib/                        # Utility functions
│   │   └── utils.ts
│   ├── App.tsx                     # App entry point with routing
│   └── global.css                  # Global styles and Tailwind theme
│
├── server/                          # Express API Backend
│   ├── index.ts                    # Main server setup
│   ├── node-build.ts               # Node build entry point
│   └── routes/                     # API route handlers
│       └── demo.ts
│
├── shared/                          # Shared Types (Client & Server)
│   └── api.ts                      # API type definitions
│
├── public/                          # Static assets
│   ├── favicon.ico
│   ├── placeholder.svg
│   └── robots.txt
│
├── netlify/                         # Netlify serverless functions
│   └── functions/
│       └── api.ts
│
├── .builder/                        # Builder.io project metadata
│   └── plans/
│       └── zen-tower-streams.md    # Implementation plan
│
├── index.html                       # HTML entry point
├── package.json                     # Project dependencies and scripts
├── pnpm-lock.yaml                   # Lock file for pnpm
├── tsconfig.json                    # TypeScript configuration
├── tailwind.config.ts               # Tailwind CSS theme (auto-discovered by PostCSS)
├── postcss.config.js                # PostCSS configuration
├── components.json                  # Shadcn/ui components configuration
├── netlify.toml                     # Netlify deployment configuration
└── .gitignore                       # Git ignore rules

Key Directories

/config

Vite build configuration files. These are explicitly passed to Vite via the --config flag:

Root Level - Configuration Files

The following configuration files remain at the project root because they require auto-discovery by build tools:

/client

React Single Page Application (SPA) with TypeScript.

/server

Express.js backend API server.

/shared

TypeScript interfaces and types shared between client and server.

/docs

Project documentation.

Build & Development

Scripts

pnpm dev              # Start development server (client + server on port 8080)
pnpm build            # Build both client and server for production
pnpm build:client     # Build client SPA only
pnpm build:server     # Build server for Node.js execution
pnpm start            # Run production server build
pnpm test             # Run tests with Vitest
pnpm format.fix       # Format code with Prettier
pnpm typecheck        # Validate TypeScript types

Configuration Paths

Tech Stack

Deployment

Netlify

The project is configured for Netlify deployment:

See /config/netlify.toml for build and deployment settings.

Code Organization Principles

  1. Separation of Concerns: Configuration separated from code
  2. Clean Root: Only essential files in the project root
  3. Component Modularity: Dashboard-specific components in dedicated folder
  4. Type Safety: Shared types ensure consistency between client/server
  5. Path Aliases: Use @/ for client imports and @shared/ for shared types