How bysxx/fullstack-intern-test works
1. This repository is a Next.js 15 App Router template, not a feature-complete product. The architecture is centered on src/app for routing and composition, with shared client-side building blocks elsewhere in src/.
2. The top-level application boundary is src/app/layout.tsx, which likely wraps every route with global structure, metadata, styles, and the app provider layer. src/app/template.tsx is present as a route-level wrapper for per-navigation remounting behavior, which is a distinct App Router concept.
3. The only concrete route in the tree is src/app/(main)/page.tsx, meaning the current app has a main route group but no visible feature subdomains yet. The (main) segment is a route grouping boundary rather than a URL segment, used to organize pages without changing paths.
4. src/app/provider.tsx is the app-wide client-provider entry point. Based on the README, this is where React Query and other client-side context providers are expected to be mounted, separating framework-level server layout from browser-only state and caching concerns.
5. Error and fallback handling is explicit: src/app/not-found.tsx defines the 404 boundary, while UI loading states are represented by shared components such as src/components/ui/loading.tsx, loading-spinner.tsx, and table/skeleton.tsx. That suggests the app treats loading and missing routes as first-class UI states.
6. Shared presentational components live under src/components/ui. These are reusable, mostly framework-agnostic UI primitives and composite controls: accordion, action button, footer, icon, sub-header, notification toggle, and table skeletons. This layer is the main reusable view boundary for the app.
7. There is a client-only boundary in src/components/client-only.tsx, which indicates some UI or hooks are intended to run only in the browser. That is important in a Next.js app because it separates server-rendered content from components that rely on DOM APIs, browser storage, or client state.
8. Local interactive state is split between hooks and a store layer. src/hooks/useCustomHook.ts and src/hooks/useNotification.ts encapsulate reusable behavior, while src/stores/useStore.ts provides global client state via Zustand. This creates a clear separation between logic reuse and shared mutable state.
9. src/utils/notification.ts is a small utility boundary that likely supports notification-related UI or state transitions. Combined with notification-toggle.tsx and useNotification.ts, it suggests notification handling is a small internal subsystem, even though no backend or external notification service is present in the tree.
10. Shared typing lives in src/types/auth.ts, but there are no actual auth routes or auth actions in the checked-in file tree. That implies the template was prepared for future feature expansion, and types are already carved out for domain-specific contracts.
11. Styling is centralized in src/styles/global.css, with Tailwind configured through tailwind.config.js and postcss.config.js. The styling architecture is utility-first, with a global stylesheet for resets/base tokens and Tailwind for component-level styling.
12. The repo has no backend service, database client, or API layer in the current tree. So the current architecture is a frontend-only template with client-state, UI primitives, and App Router scaffolding, ready to be extended into a full-stack app later.
13. In diagram terms, the main flow is: browser request enters the Next.js App Router, layout.tsx and provider.tsx establish global shell and client contexts, route pages like (main)/page.tsx render content, and shared UI/hooks/store/utils provide the interactive behavior layer beneath the page surface.
14. The main architectural boundaries to draw are: routing/app shell, client-provider layer, shared UI components, reusable hooks, global store, utilities, and styling. The current repository is intentionally thin in domain logic, which makes these boundaries the primary structure rather than feature subsystems.
Main entry points: page.tsx Main page · layout.tsx Root layout · loading.tsx Loading state · provider.tsx Providers
Components 21
App router
Next.js App Router shell, routing, and route boundaries.
- Root layout · Global app wrapper for routes, metadata, and structure.
src/app/layout.tsx - Route template · Per-navigation remount wrapper used by the App Router.
src/app/template.tsx - Main page · The only concrete route in the app tree.
src/app/(main)/page.tsx - 404 page · Route boundary for missing pages.
src/app/not-found.tsx
Client layer
Browser-only providers, hooks, and shared state.
- Providers · App-wide client context entry for browser state and caching.
src/app/provider.tsx - Client only · Wrapper for components that must render on the client.
src/components/client-only.tsx - useNotification · Reusable notification behavior hook.
src/hooks/useNotification.ts - Custom hook · Shared reusable hook placeholder.
src/hooks/useCustomHook.ts - App store · Global client state container.
src/stores/useStore.ts
Shared UI
Reusable presentation components and loading states.
- Accordion · Reusable interactive disclosure component.
src/components/ui/accordion.tsx - Action button · Primary interactive button component.
src/components/ui/action-button.tsx - Footer · Shared bottom-of-page presentation component.
src/components/ui/footer.tsx - Icon · Shared icon rendering component.
src/components/ui/icon.tsx - Sub header · Shared section header component.
src/components/ui/sub-header.tsx - Notif toggle · UI control for notification state.
src/components/ui/notification-toggle.tsx - Loading state · Shared loading placeholder component.
src/components/ui/loading.tsx - Spinner · Reusable loading indicator.
src/components/ui/loading-spinner.tsx - Table skeleton · Skeleton placeholder for table-like loading states.
src/components/ui/table/skeleton.tsx
Foundation
Global styles and reusable domain types/utilities.
- Notification util · Notification-related helper functions.
src/utils/notification.ts - Auth types · Shared type definitions for future auth contracts.
src/types/auth.ts - Global CSS · App-wide stylesheet and base styling layer.
src/styles/global.css
Connections 22
- Root layout → Providers: wraps · Root layout mounts app-wide client providers.
- Root layout → Route template: wraps · Root layout participates in App Router composition.
- Root layout → Main page: renders · Layout frames the main route content.
- Root layout → 404 page: frames · Layout surrounds the 404 boundary.
- Providers → App store: supplies · Providers make global client state available.
- Providers → useNotification: enables · Provider layer supports notification-related client behavior.
- Main page → Client only: uses · Page can isolate browser-only content behind a client boundary.
- Main page → Sub header: composes · Page uses shared UI building blocks.
- Main page → Footer: composes · Page uses shared UI building blocks.
- Main page → Action button: composes · Page uses shared UI building blocks.
- Main page → Notif toggle: composes · Page uses shared UI building blocks.
- Main page → Accordion: composes · Page uses shared UI building blocks.
- Main page → Loading state: shows · Page can surface loading states.
- Loading state → Spinner: uses · Loading component can include the spinner indicator.
- Loading state → Table skeleton: uses · Loading component can include table skeleton states.
- Notif toggle → useNotification: uses · UI toggle is backed by reusable hook behavior.
- useNotification → Notification util: uses · Hook delegates shared notification helpers.
- Custom hook → App store: reads · Reusable logic can connect to shared state.
- Client only → Icon: can wrap · Browser-only boundary can guard interactive primitives.
- 404 page → Loading state: shares · Fallback states share the same feedback vocabulary.
- Root layout → Global CSS: imports · Root shell loads global styling.
- Root layout → Auth types: references · App-level composition may rely on shared domain types.