How aryan570/ghiblily works
Project type and purpose
• This is a full-stack, single-page (React/Next.js) portfolio website with a blog feature and a small backend API layer.
• Purpose: serve a Ghibli-inspired portfolio (static & dynamic content), play background audio (Howler.js), animate UI (GSAP), and manage blog posts stored in MongoDB.
File structure
• Top-level config: next.config.ts, eslint.config.mjs, postcss.config.mjs, tsconfig.json – these configure Next.js, linting, CSS, TS.
• src/app: Next.js App Router directory.
• Static pages: layout.tsx, page.tsx, globals.css.
• Dynamic routes under blogs/[slug] & API routes under api/*.
• src/components: React UI components (Banner, Footer, Skills, etc.), plus a CSS module for animations.
• src/lib/mongodb.ts: MongoDB client setup.
• public: static assets (rosso.mp3).
• package.json lists dependencies: next, react, mongodb, howler, gsap, etc.
Insights from README
• Tech stack: Next.js (React + server components), TypeScript, MongoDB, Howler.js (audio), GSAP (animations), Vercel (hosting).
• New blog section for dynamic content.
Main components & interactions
a. Frontend (Next.js)
• Static pages (About, Projects, Skills, Contact, etc.)
• Dynamic blog pages (/blogs/[slug])
• UI animation layer (GSAP)
• Audio player (Howler.js)
b. Backend/API (Next.js API Routes)
• /api/add_blog: write new blog posts
• /api/blog, /api/blog/[slug]: read posts
• /api/blog_metadata: fetch list of posts
• /api/mail: contact form
c. Database
• MongoDB (hosted externally or via Atlas)
• Collections: blogs, metadata, potentially messages.
d. Hosting & CDN
• Vercel (build & serve Next.js, edge caching).
e. External services
• MongoDB Atlas
• (Optional) Email service via /api/mail.
Architectural patterns & design principles
• Server Components vs Client Components (Next.js App Router)
• Layered separation: Presentation (components/pages) → API layer → Persistence (MongoDB)
• Edge/SSR: Next.js pre-renders static pages; API routes run as serverless functions.
• Micro-services style: each API route is its own lambda.
Detail is key
• API endpoints and their function.
• Static asset delivery path (public folder → CDN → Browser).
• Server/client boundaries, and where server components render vs client scripts run.
• Build/deploy on Vercel as a final step: push → CI/CD → Live.