How kemezz/nadoharu-standalone works
Project type and purpose
• This is a full-stack social-network micro-blogging application built with Next.js (“app” directory) and TypeScript.
• It provides user authentication (login/register), post timelines, chat, notifications, user profiles, and friend requests.
• The backend logic (server-side actions, API routes) and the frontend views (React/TSX pages) live in the same Next.js codebase.
• Prisma is used as the ORM to persist data in a relational database; Iron Session handles session management.
File structure
• Top-level “app” directory follows Next.js’s App Router: nested folders for each route (auth/, tabs/, chat/, posts/, users/, me/).
• “components” holds reusable UI pieces, organized by domain (chat, post, comment, friendship, profile) and shared UI controls.
• “libs” contains shared utilities: db.ts (Prisma client), session.ts (Iron Session config), atoms/constants/utils.
• “prisma” directory defines the schema and migration history.
• Configuration files: next.config.ts, tsconfig.json, tailwind.config.ts, postcss.config.mjs.
• Middleware.ts likely enforces authentication checks or global request handling.
Key insights from README
• Next.js + Iron Session + Tailwind + Prisma deployed on Vercel.
• The app is the standalone web version of the NDHR social micro-blog, so real-time-ish chat, notifications, and timeline features are critical.
a. Main components
• Client (Browser/mobile web view)
• Next.js Server (Vercel Edge + Node Serverless Functions)
• Authentication Module (Iron Session middleware, auth server-actions)
• Business Logic Layer (server-actions & utilities in libs/)
• Prisma ORM Layer
• Relational Database (PostgreSQL or MySQL)
• Static Assets & CDN (public/, fonts, Vercel CDN)
• Optional External Services (OAuth providers, push notifications)
b. Relationships & interactions
• Client sends HTTP(S) requests to Next.js (SSR pages, API routes, server-actions).
• Next.js applies Middleware → session validation → routes to page or server-action.
• Server-action calls Business Logic → Prisma ORM → Database.
• Responses (HTML, JSON or redirects) return to Client.
• Static files and images served via CDN.
c. Architectural patterns / principles
• Monolithic full-stack architecture with a unified codebase.
• App Router pattern providing file-based routing, server and client components.
• Separation of concerns: UI components vs. domain logic vs. data persistence.
• Middleware pipeline for authentication/session.
• Reusable domain components (chat bubble, post timeline) to enforce UI consistency.
d. Relevant technologies
• Next.js (App Router, Server Components, Server Actions)
• React / JSX / TSX
• Iron Session for cookie-based sessions
• Prisma for DB access
• Tailwind CSS for styling
• Vercel for hosting (Serverless functions + CDN)
• Postgres (or another SQL DB) managed via Prisma
Detail
• Every major route group as a sub-module: Auth, Tabs, Chat, Posts, Users, Me.
• How shared components are imported by pages and how domain logic flows through server-actions.
• Don’t just lump “Next.js”—break it into Router, Middleware, Server-Actions, API-like handlers.
• Call out Prisma migrations as part of the deployment pipeline.
• Vercel hosting and CDN as the deployment layer.