How mohdahsanrazakhan/lawcodes works
Project type and purpose
• This is a React single‐page application (SPA) scaffolded with Vite.
• It’s primarily a content site/blog that fetches posts via the Google Blogger API, serves static JSON “laws” data, and offers client‐side features like bookmarks, history, theme toggling, and full-text search.
File structure
• Root files:
• index.html → SPA entry point
• generate-sitemap.js → custom script to regenerate sitemap.xml
• postcss.config.mjs, tailwind.config.js → CSS pipeline
• vite.config.js → build/dev server config
• public/ → purely static assets (favicon, site.webmanifest, robots.txt, prebuilt sitemap.xml)
• src/
• main.jsx & App.jsx → application bootstrap & router setup
• api/blogger.js → API client for Google Blogger
• data/*.json → static JSON datasets for law lookup
• utils/ → bookmark/history management (localStorage), search logic
• context/ThemeContext.jsx → global light/dark mode state
• components/ → reusable UI widgets (Navbar, Footer, Spinner, ThemeToggle, SearchLaw, etc.)
• pages/ → route targets (BlogPosts, Detail, Bookmark, History, About, Terms, etc.)
README for additional insights
• Confirms minimal React + Vite setup with hot-module replacement
• Suggests optional ESLint/TypeScript enhancements