How aibiansari/linkrary works
What this project is (type + purpose)
Linkrary is a Next.js (React + TypeScript) web application that serves as a curated directory of links (tools/resources) organized into categories, with search/filter, favorites/bookmarks, dark mode, and animations.
From the file tree, it is primarily a frontend app (no explicit backend/service layer in-repo). Any “backend-like” capability is delegated to external services (notably EmailJS for contact/feedback).
How to read the architecture from the file structure
Key structural signals:
Next.js App Router structure
• src/app/...
• layout.tsx → global layout (root shell)
• globals.css → global styling entry
• page.tsx → landing page route /
• about/page.tsx → /about
• collection/page.tsx → /collection (likely favorites/bookmarks)
• loading.tsx, not-found.tsx → route-level UX primitives
This strongly indicates Next.js 13+ App Router with route segments and shared layout.
UI components
• src/components/ui/*
• Components like navbar.tsx, Cards.tsx, ScrollX.tsx
• Modals: categoryModal.tsx, filterModal.tsx
• Controls: dropdown.tsx
• Communication: contact.tsx (likely EmailJS integration)
These are your presentation + interaction layer.
State management via React Context
• src/contexts/*
• useCategoryContext.tsx
• useCategoryModalContext.tsx
• useFavoriteCardsContext.tsx
• useFilterButtonContext.tsx
This implies client-side state and cross-component coordination using React Context providers/hooks (favorites, selected category, modal open state, filter state).
Static data as “domain content”
• src/data/*
• Cards.ts → curated resources (likely the “database” equivalent)
This is important: the “data store” is currently static in code, not a DB.
What the README adds (stack + external dependencies)
From README:
• Next.js + React + TypeScript
• TailwindCSS
• Framer Motion (animations)
• Sonner (toasts)
• EmailJS (send feedback emails)
• next-themes (dark mode/theme toggle)
These should appear as supporting libraries attached to the components that use them, and EmailJS should appear as an external integration.
Client (Browser)
• React UI components
• Context state (favorites, filters, modals)
Next.js Runtime (Server / Edge)
• Route handling for /, /about, /collection
External Services
• EmailJS API
• Browser ↔ Next.js runtime: “Request route, receive HTML/JS, hydrate”
• Browser → EmailJS: Often EmailJS runs client-side (depending on usage). If contact.tsx calls EmailJS directly from the browser, show Browser → EmailJS. If it’s proxied via an API route (none shown), then it would be Browser → Next.js API → EmailJS. Based on the tree (no app/api), the most accurate default is Browser → EmailJS.
Goal: Show how the internal modules interact: pages → UI components → contexts → data.
Routes (src/app)
• / (src/app/page.tsx)
• /about (src/app/about/page.tsx)
• /collection (src/app/collection/page.tsx)
• Shared: layout.tsx, loading.tsx, not-found.tsx
UI Layer (src/components/ui)
• navbar.tsx (navigation + theme toggle likely)
• Cards.tsx (renders resource cards)
• ScrollX.tsx (horizontal scroller / carousel behavior)
• categoryModal.tsx, filterModal.tsx (modal UX)
• dropdown.tsx (filter/category selection)
• contact.tsx (feedback form → EmailJS; toasts via Sonner)
State Layer (src/contexts)
• Category selection state
• Category modal open/close state
• Favorites state
• Filter button/filter state
Data Layer (src/data)
• Cards.ts as the “source of truth” for resources
• Categories.tsx for taxonomy
Cross-cutting concerns
• Tailwind: styling across all components (globals.css, tailwind.config.ts)
• Framer Motion: attach to UI components that animate (modals, cards, transitions)
• Sonner: attach to components that raise toasts (likely contact submission + loading states)
• next-themes: attach to layout/navbar/theme provider (where theme is toggled)
• Routes → UI Components (pages compose UI)
• UI Components ↔ Context Hooks (read/write global state)
• UI Components → Data modules (render cards/categories from static lists)
• contact.tsx → EmailJS (external call)
• UI Components → Sonner (toast notifications)
• UI Components → Framer Motion (animations)
• layout.tsx/navbar.tsx → next-themes (theme provider/toggle)
Required elements
• Clear labels: Use file names for internal modules where helpful (e.g., “Cards.ts (dataset)”).
• Rectangles for internal modules
• Clouds for external services (EmailJS)
• App Shell
• src/app/layout.tsx
• src/app/globals.css
• Routes
• HomeRoute (page.tsx)
• AboutRoute
• CollectionRoute
• LoadingUI, NotFoundUI
• UI Components
• Navbar
• CardsList/Cards
• CategoryModal
• FilterModal
• Dropdown
• ScrollX
• ContactForm
• State (Contexts)
• CategoryContext
• CategoryModalContext
• FavoriteCardsContext
• FilterButtonContext
• Data
• CardsDataset
• CategoriesDataset
• IconsMapping
• Libraries
• Framer Motion
• Sonner
• next-themes
• External
• EmailJS API
• DevOps
• GitHub Actions workflow (nextjs.yml)
• Build pipeline (Next.js build + Tailwind/PostCSS)