How baejw0111/re-view works
Project Type and Purpose
• This is a full-stack, serverless review-community web application named “Re|view.”
• Frontend: A React/TypeScript SPA built with Vite, Redux Toolkit & React Query, styled with TailwindCSS, deployed on Vercel.
• Backend: An Express API packaged via Serverless Framework into AWS Lambda functions behind API Gateway, using MongoDB (Mongoose) for data persistence and AWS S3 for image storage.
• External integrations: OAuth providers (Kakao, Google, Naver) for social login; Discord & Puuush webhooks for notifications; CI/CD via GitHub Actions.
File-Structure Highlights
• Top-level “front” and “back” directories isolate client and server code.
• “back/controllers” organizes MVC-style handler modules (Auth, Review, Comment, Like, Notification, Tag, User, SocialAuth).
• “serverless.yml” defines AWS Lambda functions, API Gateway routes, IAM roles, and S3 bucket permissions.
• “back/utils” holds shared logic: ID generation, generic model wrapper, upload helper (S3), and controller utilities.
• “front/src/api” encapsulates HTTP calls to each backend resource.
• “front/src/features” and “front/src/widgets” hold UI components and feature modules (forms, lists, interactions).
• Use a layered view:
a. Clients Layer (User & Browser)
b. Presentation Layer (React SPA served by Vercel CDN)
c. API Layer (AWS API Gateway → Lambda)
d. Application Layer (Express controllers inside Lambda)
e. Data Layer (MongoDB Atlas & AWS S3)
f. External Services (OAuth providers, Webhooks)
g. CI/CD Pipeline (GitHub Actions → Vercel & AWS)
Main Components & Interactions
• User → Browser: Interacts via SPA UI.
• Browser → Vercel CDN: GET static assets (HTML, JS, CSS).
• Browser → API Gateway (HTTPS): RESTful calls (/auth, /reviews, /comments, /like, /notification, /tag, /user).
• API Gateway → AWS Lambda (Express): Invokes controllers to handle requests.
• Auth controllers manage JWT or cookie issuance.
• SocialAuth modules handle OAuth redirects & token exchange with Kakao/Google/Naver.
• Review/Comment/Like controllers read/write to MongoDB.
• Upload controller generates pre-signed S3 URLs and handles image storage.
• Notification controller pushes events to Discord/Puuush webhooks.
• Lambda → MongoDB Atlas: CRUD operations via Mongoose.
• Lambda → AWS S3: Store and retrieve webp images.
• Lambda → External OAuth Providers: Exchange auth codes for tokens.
• CI/CD: GitHub Actions workflows triggered on push → build & deploy “front” to Vercel; build & deploy “back” to AWS via Serverless Framework.
Architectural Patterns & Design Principles
• SPA / API separation.
• Serverless microservices (one Lambda per route or logical group).
• MVC-style controllers inside Lambdas.
• Stateless functions with external persistent storage.
• OAuth 2.0 social login flows.
• Asynchronous notifications via webhooks.