How heng148/portfolio-v2 works
This repository implements a personal portfolio with a private content-management dashboard. Visitors browse a composed portfolio, project details, and contact/footer content; an administrator signs in and edits portfolio sections, while image uploads go through Cloudinary and are recorded in Postgres. The README documents these product capabilities, but many dashboard pages and feature actions were not excerpted, so their internal calls are shown only as unverified dashed links. The graph omits unrelated projects described in the README because they are not present in this tree.
Main entry points: page.tsx Portfolio home · upload/route.ts Upload endpoint · auth.ts Better Auth setup · [publicId]/route.ts Delete upload endpoint
Components 34
Public portfolio
- Portfolio home
src/app/(home)/page.tsx - Hero
src/features/hero/components/hero-section.tsx - About section
src/features/about/components/about-section-client.tsx - Experience section
src/features/experience/components/Experience-client.tsx - Education section
src/features/education/components/education-section.tsx - Project listing
src/features/projects/components/projectSection.tsx - Skills section
src/features/skills/components/skills-section.tsx - Project detail
src/app/projects/[projectId]/page.tsx - Markdown renderer
src/components/markdown-content.tsx - Contact footer
src/components/footer.tsx - File-tree sidebar
src/features/sidebar/components/sidebar-components.tsx - Metadata builder
src/lib/metadata.ts - Image carousel
src/components/Image-Carousel.tsx - Tag list
src/components/tag-list.tsx
Admin content
- Sign-in page
src/app/login/page.tsx - Admin dashboard
src/app/dashboard/page.tsx - Content management
src/app/dashboard - About presentation
src/features/about/components/about-section-client.tsx - Experience actions
src/features/experience/action/experience.ts - Experience card
src/features/experience/components/ExperienceCard.tsx - Project actions
src/features/projects/action/projects.ts - Delete control
src/components/ui/delete.tsx
Auth and media
- Auth API route
src/app/api/auth/[...all]/route.ts - Better Auth setup
src/lib/auth/auth.ts - Action auth guard
src/middleware/auth.middleware.ts - Upload endpoint
src/app/api/upload/route.ts - Delete upload endpoint
src/app/api/upload/[publicId]/route.ts - Cloudinary client
src/lib/cloudinary.ts - Media upload UI
src/components/upload/media-upload.tsx
Persistence
- Neon Postgres access
src/db/index.ts - Drizzle schema
src/db/schema.ts - Media table
src/db/table/upload.table.ts
Other components
- Visitor
- Administrator
Connections 37
- Visitor → Portfolio home: browses
- Portfolio home → Hero: renders
src/app/(home)/page.tsx - Portfolio home → About section: renders
src/app/(home)/page.tsx - Portfolio home → Experience section: renders
src/app/(home)/page.tsx - Portfolio home → Education section: renders
src/app/(home)/page.tsx - Portfolio home → Project listing: renders
src/app/(home)/page.tsx - Portfolio home → Skills section: renders
src/app/(home)/page.tsx - Portfolio home → Metadata builder: builds metadata
src/app/(home)/page.tsx - About section → About presentation: uses
src/features/about/components/about-section-client.tsx - About presentation → Image carousel: renders
src/features/about/components/about-section-client.tsx - About presentation → Tag list: renders
src/features/about/components/about-section-client.tsx - Visitor → Project detail: opens project
- Project detail → Markdown renderer: renders write-up
src/app/projects/[projectId]/page.tsx - Visitor → Contact footer: views contact
- Portfolio home → File-tree sidebar: includes sidebar
src/app/(home)/page.tsx - Administrator → Sign-in page: signs in
- Administrator → Admin dashboard: manages content
- Admin dashboard → Content management: opens sections
- Content management → Experience actions: updates experience
src/app/dashboard/experience/page.tsx - Experience section → Experience card: renders cards
src/features/experience/components/Experience-client.tsx - Content management → Project actions: updates projects
- Content management → Delete control: offers deletion
src/app/dashboard/experience/page.tsx - Sign-in page → Auth API route: authenticates via
- Auth API route → Better Auth setup: dispatches to
- Action auth guard → Better Auth setup: checks session
src/middleware/auth.middleware.ts - Media upload UI → Upload endpoint: uploads media
- Upload endpoint → Better Auth setup: checks session
src/app/api/upload/route.ts - Upload endpoint → Cloudinary client: uploads image
src/app/api/upload/route.ts - Upload endpoint → Neon Postgres access: inserts media
src/app/api/upload/route.ts - Upload endpoint → Media table: writes row
src/app/api/upload/route.ts - Delete upload endpoint → Better Auth setup: checks session
src/app/api/upload/[publicId]/route.ts - Delete upload endpoint → Cloudinary client: deletes image
src/app/api/upload/[publicId]/route.ts - Delete upload endpoint → Neon Postgres access: deletes row
src/app/api/upload/[publicId]/route.ts - Delete upload endpoint → Media table: deletes media
src/app/api/upload/[publicId]/route.ts - Neon Postgres access → Drizzle schema: configures ORM
src/db/index.ts - Drizzle schema → Media table: includes table
src/db/schema.ts - Better Auth setup → Neon Postgres access: uses database
src/lib/auth/auth.ts