An open API service indexing awesome lists of open source software.

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

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

theme_one_home
theme_two_home
theme_three_home

---

## πŸ‘¨β€πŸ’» Author

- **Developer**: Mansoor Khan(https://github.com/ManSOorcode/multi-theme-switcher-mansoorkhan-frontenddeveloper.git)

---

## πŸ“„ License

This project is licensed under the MIT License.