> ## Documentation Index
> Fetch the complete documentation index at: https://docs.briankimemia.is-a.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# 🌞 M-Solutions Solar Calculator

> A sophisticated solar system sizing calculator that helps users determine their solar power requirements with precision and ease.

# 🌞 M-Solutions Solar Calculator

A sophisticated solar system sizing calculator that helps users determine their solar power requirements with precision and ease.

![Solar Calculator Preview](https://images.unsplash.com/photo-1486312338219-ce68d2c6f44d)

<Tip>
  💡 **Pro Tip:** Leverage this calculator to optimize your solar setup based on your unique energy consumption and local sunlight conditions.
</Tip>

***

## 📊 System Architecture

```mermaid theme={null}
graph TD
    A[User Input] --> B[Calculator Logic]
    B --> C[Results]
    C --> D[Visualization]
    C --> E[PDF Report]
    
    subgraph "User Input Components"
        A1[Personal Info] --> A
        A2[Energy Requirements] --> A
        A3[System Preferences] --> A
    end
    
    subgraph "Calculation Engine"
        B1[Solar Panel Sizing] --> B
        B2[Battery Bank Sizing] --> B
        B3[Inverter Sizing] --> B
    end
```

## 🗂️ Project Structure

```bash theme={null}
src/
├── components/           # UI Components
│   ├── SolarCalculator/    # Main calculator components
│   │   ├── index.tsx         # Main component
│   │   ├── InputForm.tsx     # User input form
│   │   ├── Results.tsx       # Results display
│   │   └── Visualization.tsx # Charts and graphs
│   └── ui/               # shadcn/ui components
├── utils/               # Utility functions
│   ├── pdfGenerator.ts    # PDF report generation
│   └── calculations.ts    # Solar calculations
├── types/               # TypeScript definitions
└── hooks/               # Custom React hooks
```

## 🧮 Calculation Logic

### Constants

* **Panel Power Rating:** 550W (0.55kW)

* **Safety Factor:** 1.3 (30% overhead for inverter sizing)

### Battery Specifications

**Lead-acid Batteries:**

* Depth of Discharge (DoD): 50%

* Efficiency: 80%

**Lithium-ion Batteries:**

* Depth of Discharge (DoD): 80%

* Efficiency: 95%

### Calculation Formulas

#### **Solar Panel Sizing**

```bash theme={null}
Daily Energy Required (kWh) ÷ Peak Sun Hours = Required Solar Panel Capacity (kW)
Number of Panels = Ceiling(Required Capacity ÷ Panel Power Rating)
```

#### **Battery Bank Sizing**

```bash theme={null}
Battery Bank Capacity = Daily Consumption × Autonomy Days
Adjusted Battery Capacity = (Battery Bank Capacity × 1000) ÷ (Battery Voltage × DoD × Efficiency)
Number of Batteries = Ceiling(Adjusted Capacity ÷ Individual Battery Capacity)
```

#### **Inverter Sizing**

```bash theme={null}
Inverter Size = (Peak Load × Safety Factor) ÷ 1000
```

## 🚀 Getting Started

### Clone the repository

```bash theme={null}
git clone <repository-url>
```

### Install dependencies

```bash theme={null}
npm install
```

### Start the development server

```bash theme={null}
npm run dev
```

<Tip> 💡 **Quick Tip:** Customize your environment settings for the best performance in your local setup. </Tip>

## 📱 Features

* **Responsive Design:** Seamlessly works on desktops, tablets, and mobiles.

* **Real-time Calculations:** Instant feedback as you adjust your inputs.

* **Interactive Charts:** Visualize system performance with dynamic graphs.

* **PDF Reports:** Download detailed reports of your solar system specs.

* **Smart Defaults:** Pre-configured values for common solar setups.

## 🔄 Input Variables

| Variable              | Description                        | Impact on Calculation                |
| --------------------- | ---------------------------------- | ------------------------------------ |
| **Daily Consumption** | Total energy used per day (kWh)    | Determines overall system size       |
| **Peak Load**         | Maximum power draw at once (kW)    | Affects inverter sizing              |
| **Autonomy Days**     | Backup power duration (days)       | Influences battery capacity          |
| **Sunlight Hours**    | Average daily sun exposure (hours) | Determines solar panel quantity      |
| **Battery Type**      | Lead-acid or Lithium-ion           | Affects efficiency and capacity      |
| **System Voltage**    | 12V, 24V, or 48V                   | Impacts overall system configuration |

## 🛠️ Technical Stack

* **Frontend:** React + TypeScript

* **Styling:** Tailwind CSS + shadcn/ui

* **Charts:** Recharts

* **PDF Generation:** jsPDF

* **State Management:** React Query

* **Build Tool:** Vite

## 📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

## 🤝 Contributing

Contributions are welcome! Please review our contributing guidelines before submitting pull requests.

<Warning> ⚠️ **Important:** Ensure you enter accurate data to obtain reliable solar sizing calculations. </Warning>

Made with ☀️ and 🌱 by BrianKN019

## 📧 Contact

For questions or feedback, reach out:

📨 Email: [projects@briankimemia.is-a.dev](mailto:projects@briankimemia.is-a.dev)
🌐 Portfolio: [Brian Kimemia](https://briankimemia.is-a.dev/)
**GitHub:** [BrianKN019](https://github.com/BrianKN019)

***

**Thank you for exploring this project! Let’s innovate and build secure AWS solutions together. 🚀**
