How jubayer608/artifacts-tracker-client-a11 works
1. This repository is the frontend client for “Historical Artifacts Tracker.” The tree contains a React application plus Firebase hosting/config files, but no backend source code. The README describes a separate backend stack (Express, MongoDB, Firebase Admin, JWT) that this client is expected to talk to.
2. The app is built with React 19 + React Router v7 and bootstrapped through src/main.jsx, src/App.jsx, and src/router/router.jsx. Routing is the central composition layer: it decides which page module renders, and it likely wraps the app in shared providers and layout components.
3. There is a clear app shell / layout boundary in src/RootLayout/RootLayout.jsx, plus shared route-level concerns in src/routes/TitleManager.jsx and src/routes/NotFound.jsx. This suggests every page is rendered inside a consistent frame with document-title management and a fallback 404 route.
4. Authentication is a major subsystem. src/firebase/firebase.init.js initializes Firebase Auth, and src/contexts/AuthContext/AuthProvider.jsx + AuthContext.jsx expose auth state to the tree. src/routes/PrivateRoute.jsx enforces access to protected pages, and the README notes an HTTP-only JWT flow for secure access to private data/actions.
5. The protected user areas are clustered under src/pages/ArtifactCrud and include add/update/manage/liked artifacts. These pages represent the main “user-owned content” workflow: create artifact entries, edit them, and view liked or personal artifacts. This is the primary write-side of the app’s data model.
6. The public discovery side lives under src/pages/Home, src/pages/Search, src/pages/ArtifactDetails, src/pages/Collections, src/pages/Compare, src/pages/Comparison, and src/pages/Timeline. Together these modules cover browsing, filtering, detail views, collections, comparisons, and timeline-style exploration of artifacts.
7. The Home page is highly sectionalized rather than monolithic. It is composed from many small feature sections such as banner/slider, featured artifacts, reviews/testimonials, stats, newsletter, spotlight, recent items, and about content. This implies the landing experience is assembled from independent content blocks rather than a single feed.
8. Reusable presentation primitives live in src/pages/Shared and src/components. Notable shared components include NavBar, Footer, ArtifactCard, SocialLogin, ThemeToggle, LoadingSpinner, and AdvancedSearch. These are the cross-cutting UI building blocks used across multiple routes and feature pages.
9. Theme management is another app-wide concern. src/contexts/ThemeContext.jsx and its provider manage light/dark or theme-state behavior, and ThemeToggle is the user-facing control. This context likely wraps the entire app so theme state persists across routes.
10. The app’s external integrations are centered on Firebase and a separate backend API. Firebase handles authentication and hosting; the README says the backend uses JWT and Firebase Admin for token verification, so the client likely authenticates with Firebase, obtains/uses a token, then calls protected artifact endpoints.
11. Static assets are organized in src/assets by feature area (banner, login, register), which reinforces the page-centric structure. Styling is handled with Tailwind CSS v4 plus DaisyUI, with additional animation support from Framer Motion and carousel behavior from Swiper.
12. Build and deployment are front-end focused: Vite is the dev/build tool, firebase.json and .firebaserc indicate deployment to Firebase Hosting, and .firebase/ contains generated hosting cache/state. eslint.config.js and tailwind.config.js provide code-quality and styling configuration boundaries.
13. For an architecture diagram, the main flows are: user enters app → router selects page → root layout/shared shell renders → auth/theme contexts provide global state → page modules fetch or mutate artifact data → private routes gate protected CRUD and liked-artifact screens → Firebase Hosting serves the built SPA.
Main entry points: router.jsx Router · ArtifactCard.jsx Artifact card · App.jsx App · Shared Page shared
Components 31
App shell
Bootstrap, routing, layout, and route guards.
- Entry · Application entry point that mounts the React tree.
src/main.jsx - App · Top-level app composition and global wiring.
src/App.jsx - Router · Route table and page selection logic.
src/router/router.jsx - Root layout · Shared app shell around routed pages.
src/RootLayout/RootLayout.jsx - Private route · Protects authenticated routes and private screens.
src/routes/PrivateRoute.jsx - Title manager · Manages document title or other route-level metadata.
src/routes/TitleManager.jsx - Not found · 404 route fallback for unmatched paths.
src/routes/NotFound.jsx
Identity
Authentication, theme state, and Firebase integration.
- Firebase init · Initializes Firebase authentication client state.
src/firebase/firebase.init.js - Auth provider · Provides authentication state and actions to the app.
src/contexts/AuthContext/AuthProvider.jsx - Auth context · Shared auth context definition and access hook.
src/contexts/AuthContext/AuthContext.jsx - Theme provider · Provides theme state across the UI.
src/contexts/ThemeContext/ThemeProvider.jsx - Theme context · Theme context definition and access hook.
src/contexts/ThemeContext/ThemeContext.jsx
Pages
Primary user-facing route modules for browsing and CRUD.
- Home · Public landing page assembled from many content sections.
src/pages/Home/Home.jsx - Search · Search and filtering experience for artifacts.
src/pages/Search/Search.jsx - Details · Artifact detail view and related interactions.
src/pages/ArtifactDetails/ArtifactDetails.jsx - Collections · Collection-oriented artifact browsing.
src/pages/Collections/CollectionsPage.jsx - Compare · Side-by-side artifact comparison screen.
src/pages/Compare/CompareArtifacts.jsx - Timeline · Chronological artifact exploration view.
src/pages/Timeline/ArtifactTimeline.jsx - Artifact CRUD · Protected create, update, and user-owned artifact screens.
src/pages/ArtifactCrud
Shared UI
Reusable UI primitives used across routes and sections.
- Shared UI · Cross-cutting UI primitives used across routes.
src/components - Page shared · Shared route-level UI used by page modules.
src/pages/Shared - NavBar · Primary site navigation.
src/pages/Shared/NavBar.jsx - Footer · Global footer displayed across the app shell.
src/pages/Shared/Footer.jsx - Artifact card · Reusable artifact summary card.
src/pages/Shared/ArtifactCard.jsx - Social login · Authentication UI for social sign-in.
src/pages/Shared/SocialLogin.jsx - Theme toggle · User-facing theme switch control.
src/components/ThemeToggle.jsx - Advanced search · Enhanced search/filtering component.
src/components/AdvancedSearch.jsx - Spinner · Shared loading indicator.
src/components/LoadingSpinner.jsx
Build & deploy
Frontend build and Firebase Hosting configuration.
- Vite build · Frontend dev and build tooling.
vite.config.js - Hosting config · Firebase Hosting configuration and deployment state.
firebase.json - Project config · Firebase project targeting configuration.
.firebaserc
Connections 30
- Entry → App: boots · Entry mounts the application root.
- App → Router: renders · App delegates screen selection to the router.
- Router → Root layout: wraps · Most routes render inside the shared layout.
- Router → Title manager: route metadata · Routes coordinate title updates.
- Router → Not found: fallback · Unmatched paths go to the 404 screen.
- Router → Private route: guards · Protected routes are wrapped in the auth gate.
- Root layout → NavBar: includes · The shell uses global navigation.
- Root layout → Footer: includes · The shell uses the shared footer.
- App → Auth provider: provides auth · Auth context is available across the tree.
- App → Theme provider: provides theme · Theme state is available across the tree.
- Auth provider → Firebase init: uses · Auth provider depends on Firebase auth initialization.
- Auth provider → Auth context: exports · Context implementation is exposed to consumers.
- Theme provider → Theme context: exports · Theme context implementation is exposed to consumers.
- Theme provider → Theme toggle: drives · Theme toggle controls provider state.
- Home → Artifact card: uses · Landing sections surface artifacts via cards.
- Home → Spinner: uses · Home sections may show loading state.
- Search → Advanced search: uses · Search page relies on advanced search controls.
- Details → Artifact card: relates · Detail screens connect to artifact summaries and related items.
- Collections → Artifact card: uses · Collections present artifacts in card form.
- Compare → Artifact card: compares · Comparison views likely reuse artifact summaries.
- Artifact CRUD → Artifact card: edits · CRUD views operate on artifact entities.
- Artifact CRUD → Social login: auth entry · Protected flows can connect to login options.
- Shared UI → Spinner: contains · Shared UI includes loading indicators.
- Shared UI → Advanced search: contains · Shared UI includes advanced search controls.
- Page shared → NavBar: contains · Shared page chrome includes navigation.
- Page shared → Footer: contains · Shared page chrome includes footer.
- Page shared → Social login: contains · Shared page chrome includes social auth UI.
- Entry → Vite build: built by · The app is bundled with Vite.
- Vite build → Hosting config: deploys to · Built assets are hosted on Firebase Hosting.
- Hosting config → Project config: configured by · Hosting targets are linked to the Firebase project config.