How make-a-wish-sopt/make-a-wish-client works
Project Purpose and Type
• This is a Next.js full-stack application. Its goal is to allow users to create, read, update, and delete “wish” posts while integrating external services like Kakao for social login and handling account (bank) verification.
• The application provides a user-friendly interface for both wish posting (“선물” and “소원”) and managing user profiles (mypage), along with handling media assets.
Main Components in the Architecture
• Frontend (UI and Presentation):
• Pages and Routing: The “src/app” directory contains pages (e.g., home, login, wish detail, present, mypage) and nested routes which leverage Next.js routing capabilities.
• Domain & Components: The “src/domain” folders (for example, wishes, present, login, mypage) encapsulate feature-specific logic. Reusable UI components are located in “src/components” (like Button, Modal, Calendar, etc.) and “src/layouts” for consistent page layout.
• Styling & Configuration: Tailwind CSS and global style files (under src/styles and tailwind.config.js) define the look-and-feel.
• API Layer and Server-Side Logic:
• API Endpoints: There are two places for API logic. One is under “src/api” – traditional API abstraction files for auth, cakes, files, etc. The other is using Next.js serverless routes in “src/app/api” (for cookies, Kakao login/logout, paycode, etc.).
• External Integration: Routes for Kakao login indicate that authentication and authorization are handled by external OAuth services. Additionally, bank account verification may be integrated here.
• Infrastructure and Assets:
• Configuration: Files like next.config.mjs, package.json, eslint, prettier settings, and TypeScript configuration (tsconfig.json) indicate build, code style, and development properties.
• Testing: The “src/__test__” directory along with Jest configuration files (jest.config.ts, jest.setup.ts) show that unit and integration tests are part of the project.
Relationships and Data Flow
• User interactions with frontend pages (rendered by components and domain layers) trigger actions that ultimately make HTTP requests to the Next.js API endpoints.
• API endpoints process business logic (e.g., wish CRUD operations, Kakao OAuth flows, and account verification) and then communicate with any external services (Kakao OAuth, bank APIs, etc.).
• The static assets (from the public folder) and dynamic content rendered by React components ensure a responsive UI.
• Shared utilities (under src/utils, src/hooks, src/validation) support common functionality and input validation, providing a cohesive interaction between different layers.
Architectural Patterns & Design Principles
• Separation of concerns is observed by dividing the project into “presentation” (app, components, layouts), “business logic” (domain folders and services), and “API/data” (src/api, app/api routes).
• Modular design is leveraged so that specific features (e.g., wishes, present, mypage) are encapsulated in their own folder, enabling easier scalability and maintenance.
• Use of Next.js serverless functions (route.ts, page.tsx) minimizes the backend footprint while keeping the user experience unified within one codebase.