How dev-sahad/portfolio-v1 works
1. Overall shape
- This is a Next.js App Router application with two major surfaces: a public portfolio site and a protected admin console.
- The repo is structured as a single deployable web app, not a separate frontend/backend split.
2. Public site
- src/app/page.tsx is the main landing page, composed from reusable sections in src/components/sections.
- The public experience is built from Hero, About, PortfolioShowcase, and contact-related sections, so the site is primarily content-driven and presentation-focused.
3. Portfolio content flow
- Portfolio data appears to be fetched through src/hooks/usePortfolio.ts and src/lib/portfolioService.ts.
- Public listing/detail views live under src/app/portfolio/[id]/page.tsx, indicating dynamic routes for individual projects.
- PortfolioCard and PortfolioShowcase are the presentation layer for this data.
4. Comments/contact flow
- Contact interaction is split into a form and comments area under src/components/sections/contact.
- src/hooks/useComments.ts and src/lib/commentService.ts suggest comments are persisted in the backend and read back into the UI.
- This same data source is also visible in the admin side, which implies a shared moderation/content workflow.
5. Admin subsystem
- The entire admin area is isolated under src/app/admin.
- It includes dedicated pages for dashboard, login, projects, tech, comments, and certificates.
- src/app/admin/Sidebar.tsx indicates a persistent admin navigation shell around those management views.
6. Admin CRUD boundaries
- src/app/admin/projects/[id]/page.tsx and src/app/admin/projects/AddProjectModal.tsx show project management supports both creation and item-level editing.
- Separate admin pages for tech, certificates, and comments imply each content type is managed independently rather than through one generic CMS screen.
7. Backend/data layer
- src/lib/supabase.ts and src/lib/supabaseServer.ts show the app uses Supabase as its data/auth backend, with both client and server access paths.
- backup.sql suggests the underlying data model is backed by a relational schema, likely for Supabase/Postgres.
- The architecture therefore centers on the browser and Next.js server components talking directly to Supabase rather than a custom API server.
8. Authentication and route protection
- src/app/admin/login/page.tsx is the admin entry point for authentication.
- middleware.ts likely enforces access control for protected admin routes and handles redirects for unauthenticated users.
- src/components/RefreshRedirect.tsx suggests there is additional session/redirect handling after auth state changes.
9. Shared UI and layout
- src/app/layout.tsx, src/components/LayoutWrapper.tsx, and src/components/ui/Navbar.tsx provide the common shell for the public-facing app.
- src/app/globals.css plus Tailwind/PostCSS config imply the UI is styled through utility-first CSS with global overrides where needed.
10. Experience/animation layer
- AnimatedBackground, WelcomeScreen, and the band components indicate a strong visual/interactive layer on top of the content site.
- public/assets/kartu.glb is a 3D asset, so the public experience includes nontrivial graphics/animation content, not just static pages.
11. Deployment/runtime
- netlify.toml shows the app is configured for Netlify deployment.
- next.config.ts and the presence of middleware.ts indicate the app relies on Next.js runtime features such as routing, server-side rendering, and edge-aware request handling.
12. Architecture summary for diagramming
- Think of this repo as a Next.js presentation app backed by Supabase:
- Public visitors consume portfolio/content pages and submit contact/comments.
- Admin users authenticate, then manage projects, tech stack entries, certificates, and comments.
- Next.js provides routing/layout/protection; Supabase stores content and auth state; static assets and animated components handle the visual experience.
Main entry points: page.tsx Home page · supabaseServer.ts Supabase server · Sidebar.tsx Admin shell · PortfolioShowcase.tsx Portfolio showcase
Components 33
Public site
Visitor-facing portfolio pages and content sections
- Home page · Main public entry page composed from content sections
src/app/page.tsx - Hero · Top-of-page introduction and call to action
src/components/sections/Hero.tsx - About · Profile and background content
src/components/sections/About.tsx - Portfolio showcase · Featured portfolio listing and entry point to projects
src/components/sections/PortfolioShowcase.tsx - Portfolio card · Presentation unit for an individual portfolio item
src/components/sections/PortfolioCard.tsx - Contact area · Public contact and comments entry area
src/components/sections/contact/ContactSection.tsx - Contact form · Collects visitor messages and submissions
src/components/sections/contact/ContactForm.tsx - Comments panel · Displays and manages public comments
src/components/sections/contact/CommentsSection.tsx - Project page · Dynamic portfolio detail view for a single project
src/app/portfolio/[id]/page.tsx - Animated background · Interactive visual layer for the public site
src/components/AnimatedBackground.tsx - Welcome screen · Intro/overlay experience for the portfolio site
src/components/WelcomeScreen.tsx - Band visuals · Animated text and band-style presentation layer
src/components/band/App.js - Portfolio route · Public dynamic project route set
src/app/portfolio/[id]/page.tsx
Admin console
Protected content management area
- Admin shell · Persistent sidebar and layout for admin screens
src/app/admin/Sidebar.tsx - Admin login · Entry point for administrator sign-in
src/app/admin/login/page.tsx - Dashboard · Overview landing page for the admin area
src/app/admin/dashboard/page.tsx - Projects · Project management list and CRUD surface
src/app/admin/projects/page.tsx - Project editor · Item-level project editing and update view
src/app/admin/projects/[id]/page.tsx - Add project · Creation flow for new projects
src/app/admin/projects/AddProjectModal.tsx - Tech · Management view for technology entries
src/app/admin/tech/page.tsx - Certificates · Management view for certificate entries
src/app/admin/certificates/page.tsx - Comments · Moderation and review surface for comments
src/app/admin/comments/page.tsx
Shared app
Layouts, reusable UI, hooks, and services
- App layout · Root application shell and global providers
src/app/layout.tsx - Portfolio hook · Client-side portfolio data loading and state
src/hooks/usePortfolio.ts - Portfolio service · Portfolio data access layer backed by Supabase
src/lib/portfolioService.ts - Comments hook · Client-side comments loading and mutation state
src/hooks/useComments.ts - Comment service · Comments persistence and retrieval layer
src/lib/commentService.ts - Global styles · App-wide styling foundation
src/app/globals.css
Backend/runtime
Auth, data access, routing protection, and deployment runtime
- Supabase client · Browser-side Supabase access
src/lib/supabase.ts - Supabase server · Server-side Supabase access for Next.js runtime
src/lib/supabaseServer.ts - Route middleware · Protects admin routes and handles redirects
middleware.ts - Redirect helper · Session refresh and navigation helper after auth changes
src/components/RefreshRedirect.tsx - Netlify deploy · Target hosting and runtime configuration
netlify.toml
Connections 36
- App layout → Home page: wraps · Root layout renders the main public application surface
- Home page → Hero: composes · Landing page includes the hero section
- Home page → About: composes · Landing page includes the about section
- Home page → Portfolio showcase: composes · Landing page includes portfolio highlights
- Home page → Contact area: composes · Landing page includes the contact area
- Portfolio showcase → Portfolio card: renders · Showcase uses cards to present individual projects
- Portfolio showcase → Portfolio hook: loads · Showcase gets portfolio data through the hook
- Portfolio hook → Portfolio service: delegates · Hook delegates portfolio reads to the service layer
- Portfolio service → Supabase client: queries · Client-side portfolio access uses Supabase
- Project page → Portfolio service: fetches · Dynamic project page reads portfolio content
- Contact area → Contact form: contains · Contact area includes the submission form
- Contact area → Comments panel: contains · Contact area includes the public comments view
- Comments panel → Comments hook: loads · Comments UI relies on the comments hook
- Contact form → Comments hook: submits · Form flow shares the comments data path
- Comments hook → Comment service: delegates · Hook delegates comment persistence to the service layer
- Comment service → Supabase client: writes · Client-side comments access uses Supabase
- Admin shell → Dashboard: navigates · Sidebar organizes access to admin screens
- Admin shell → Projects: navigates · Sidebar links to project management
- Admin shell → Tech: navigates · Sidebar links to tech management
- Admin shell → Certificates: navigates · Sidebar links to certificate management
- Admin shell → Comments: navigates · Sidebar links to comment moderation
- Admin login → Route middleware: protected by · Middleware guards access to admin routes
- Dashboard → Supabase server: reads · Admin views use server-side Supabase access
- Projects → Supabase server: reads · Project management uses server-side data access
- Project editor → Supabase server: updates · Project editor persists changes through server access
- Add project → Projects: creates · Creation modal feeds the projects management flow
- Tech → Supabase server: updates · Tech management uses server-side data access
- Certificates → Supabase server: updates · Certificates management uses server-side data access
- Comments → Supabase server: moderates · Comment moderation uses server-side data access
- Redirect helper → Admin login: redirects · Auth state changes can send users through login flow
- App layout → Global styles: styles · Root layout applies global styles
- Home page → Animated background: decorates · Public experience includes animated visuals
- Home page → Welcome screen: introduces · Public experience includes an intro layer
- Home page → Band visuals: animates · Public experience includes band-style motion/text
- Route middleware → Supabase server: authenticates · Route protection depends on server-side session handling
- Netlify deploy → Route middleware: hosts · Deployment runs the Next.js middleware/runtime