How loosechain/zenitsu works
Project type and purpose
• This is a Next.js 13 “app directory” project—a React-based, server‐rendered web application.
• From the file tree and README, its primary purpose is to provide authentication (login), a project‐wizard flow, and a dashboard UI.
File structure
• src/app – the Next.js routing layer:
– app/page.js: landing page
– app/auth/login/page.js: login screen
– app/project-wizard/page.js: wizard flow
– layout.js + globals.css: global layout and styling
• src/components – reusable React components:
– AuthProvider.js: context/provider for auth state
– ProjectWizard.jsx: wizard UI
– dashboard/index.jsx: dashboard view
– ui/*: primitive UI components (Button, Card, Form, etc.)
• src/lib – application logic and utilities:
– auth.js: authentication helpers (login, logout, token storage)
– utils.js: misc utilities
• public – static assets
• Config files – next.config.mjs, tailwind.config.js, postcss.config.js, eslint.config.mjs
README for additional insights
• No explicit backend code or database drivers are present → likely using external APIs or serverless functions behind the scenes.
• Deployment target is Vercel.
Elements
• Clear labels: e.g., “Browser”, “Next.js Server”, “Auth Service”, “Project API”.
– Blue rectangles for in‐process components (pages, services).
– Orange clouds for external services.
Detailed breakdown of components
– Client side:
• Login Page (app/auth/login/page.js) → posts credentials
• Project Wizard (app/project-wizard/page.js) → multi‐step form
• Dashboard UI (components/dashboard/index.jsx) → data visualization
– Server side:
• Routing layer (app/layout.js, app/page.js)
• AuthProvider (components/AuthProvider.js + lib/auth.js)
• Utils layer (lib/utils.js)
– Shared UI library (components/ui/*)
– Config & build: next.config.mjs, tailwind.config.js, postcss.config.js
[Browser]
↓ HTTP GET/POST
[Next.js Server]
┌───────────────────────────────────────────┐
│ Routing (src/app) │
│ • Login Page │
│ • Wizard Page │
│ • Dashboard │
│ Auth Layer (components/AuthProvider.js)│
│ Data Calls (lib/auth.js, lib/utils.js) │
└───────────────────────────────────────────┘
↓→ Auth API (external)
↓→ Data API / DB (external)
↓→ CDN (static assets)