https://github.com/mansoorcode/multi-theme-switcher-mansoorkhan-frontenddeveloper
https://github.com/mansoorcode/multi-theme-switcher-mansoorkhan-frontenddeveloper
Last synced: 7 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/mansoorcode/multi-theme-switcher-mansoorkhan-frontenddeveloper
- Owner: ManSOorcode
- Created: 2025-07-30T21:30:31.000Z (8 months ago)
- Default Branch: master
- Last Pushed: 2025-08-01T20:00:06.000Z (8 months ago)
- Last Synced: 2025-08-01T22:28:27.146Z (8 months ago)
- Language: TypeScript
- Size: 61.5 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# π Multi-Theme Switcher App
A responsive and customizable React + TypeScript web application with a theme switcher. Users can seamlessly switch between **three distinct themes**βeach with unique layouts, typography, colors, and structure.
---
## β¨ Features
- π§ **Theme Switcher Dropdown** in a fixed header (Theme 1 as default)
- π¨ **3 Distinct Themes**:
- **Theme 1**: Light, minimalist layout with sans-serif font
- **Theme 2**: Dark mode with sidebar and bold serif font
- **Theme 3**: Colorful card-based layout with playful fonts (e.g., _Pacifico_)
- π§± Modular components (Buttons, Footer, Sidebar, etc.)
- π Persistent theme using `localStorage`
- π§ Theme state managed via **React Context API**
- π Product data fetched from [Fake Store API](https://fakestoreapi.com/products)
- π± Fully **Responsive UI** for desktop and mobile
- π Smooth **Theme Transition Animations**
- π Basic **Security** practices implemented
- π§ Routing via **React Router** with pages:
- Home (`/`)
- About (`/about`)
- Contact (`/contact`)
- π¦ No heavy UI libraries (e.g., MUI, Ant Design) used
- β‘ Built with **TailwindCSS** for styling
---
## π§Ύ Folder Structure
```
src/
βββ app/ # Pages: Home, About, Contact, Products
β βββ about/
β βββ contact/
β βββ products/
β βββ layout.tsx # Common layout
βββ components/ # Reusable UI Components
β βββ buttons/
β βββ contact/
β βββ Footer.tsx
β βββ Sidebar.tsx
β βββ ThemeSwitcher.tsx
βββ contextapi/ # Theme context
β βββ ThemeContext.tsx
βββ query/ # API integration
β βββ apis/
β βββ QueryProvider.tsx
βββ types/ # TypeScript interfaces/types
βββ utils/ # Helper functions & static data
βββ globals.css # Global styles
βββ next.config.ts # Next.js config
βββ ...
```
---
## π οΈ Tech Stack
- **Next.js** `v15.4.5`
- **React** `v19.1.0`
- **TypeScript** `v5`
- **Tailwind CSS** `v4.1.11`
- **React Query (@tanstack/react-query)** `v5.84.1`
- **PostCSS** `v8.5.6`
- **ESLint** `v9` with `eslint-config-next`
---
## π Getting Started
### 1. Clone the Repository
```bash
git clone https://github.com/ManSOorcode/multi-theme-switcher-mansoorkhan-frontenddeveloper.git
cd multi-theme-switcher-mansoorkhan-frontenddeveloper
```
### 2. Install Dependencies
```bash
npm install
# or
yarn install
```
### 3. Run the Development Server
```bash
npm run dev
# or
yarn dev
```
Open [http://localhost:3000](http://localhost:3000) to view the app.
---
## βοΈ Theme Switching Logic
- `ThemeContext.tsx`: Stores the current theme and updates context.
- `ThemeSwitcher.tsx`: Dropdown to choose from Theme 1, 2, 3.
- Theme info stored in `localStorage` to persist across sessions.
- Each theme modifies:
- Color palette
- Font family
- Layout structure (grid/sidebar/card)
- Spacing and animations
---
## π Security Practices
- Sanitized all external data
- Basic route protection and error boundaries
---
## π API Integration
- Fetches products from [FakeStoreAPI](https://fakestoreapi.com/products)
- API logic encapsulated in `query/apis/QueryProvider.tsx`
---
## πΈ Screenshots

---
## π¨βπ» Author
- **Developer**: Mansoor Khan(https://github.com/ManSOorcode/multi-theme-switcher-mansoorkhan-frontenddeveloper.git)
---
## π License
This project is licensed under the MIT License.