How ah-ae/what-are-you-reading works
High-Level Architecture Components
a) Frontend Layer:
• Next.js App Router Architecture (indicated by the app directory structure)
• Client-side Components (UI components in app/ui)
• Server Components (pages and layouts)
• State Management (using atoms as seen in app/store)
b) Backend Layer:
• API Routes (seen in route.ts files)
• Authentication System (app/(auth) directory)
• Database Layer (Prisma ORM, indicated by prisma directory)
c) External Services:
• Kakao OAuth Integration (visible in app/(auth)/kakao)
Component Organization
[Client Layer]
• Public Routes
• Authentication Routes (/login, /signup)
• Kakao OAuth Routes
• Protected Routes
• Bookshelf Routes (/mine, /yours)
• Book Management (/books/add)
• Settings (/settings)
[Application Layer]
• State Management (Recoil atoms)
• Server Actions (*.actions.ts)
• Middleware (middleware.ts)
[Data Layer]
• Prisma ORM
• Database (defined in schema.prisma)
Key Interactions to Highlight
• Authentication flow with Kakao OAuth
• Data flow between client components and server actions
• Database interactions through Prisma
• State management flow with Recoil atoms
Component Details
Specific elements:
• UI Components (app/ui/*)
• Shared Layouts (app/layout.tsx)
• Authentication Guards (middleware.ts)
• Database Schema (prisma/schema.prisma)
• State Management (app/store/atoms.ts)
Additional Notes
• The separation between client and server components
• The role of server actions in data mutations
• The integration with external authentication
• The modular structure of the UI components
• The relationship between routes and their corresponding actions
Remember to:
• Use consistent symbols throughout
• Flow of data between components
• Which parts are server-side vs client-side
This architecture represents a modern Next.js application with a focus on server components, type safety (TypeScript), and a clear separation of concerns between UI, business logic, and data access layers.