A web application to help users calculate the optimal size and number of solar panels based on daily energy consumption and location.
Solar Sizer Calculator is an intuitive tool designed to help homeowners and solar enthusiasts determine the optimal size and number of solar panels required based on their daily energy consumption and location. By entering essential data such as energy usage, solar panel wattage, and average sunlight hours, users can quickly estimate their solar requirements and make informed decisions about their solar energy investments. The application aims to promote sustainable energy solutions and empower users to optimize their solar power systems efficiently.
- Daily Energy Consumption: Users input the average daily energy usage in kilowatt-hours (kWh), derived from a list of household appliances.
- Appliance Details: For each appliance, users provide:
- Power Rating: The wattage of the appliance (e.g., 1500W).
- Usage Hours: The average daily hours the appliance is used.
- Number of Units: The quantity of that appliance in the household.
- Category: Classification of the appliance (e.g., heating, cooling, lighting, etc.).
- Solar Panel Output: The wattage of a single solar panel (e.g., 300W).
- Average Sunlight Hours: The average number of peak sunlight hours per day in the user’s location.
- The application retrieves the appliance data and user inputs.
- It calculates the daily energy consumption based on the appliance details.
- It determines the solar panel output using the provided data.
- It calculates the number of panels needed by dividing the daily energy consumption by the panel output.
- Users can configure their energy cost rating (e.g., $0.12 per kWh), currency preferences, dark mode toggle, and location settings.
- The app uses the location to obtain peak sunlight hours through a third-party API, ensuring accurate solar panel power production calculations.
- The results are presented clearly, showing:
- The total wattage required.
- The number of solar panels needed.
- Additional information such as total system size, potential energy production, and estimated cost savings based on the configured energy cost rating.
- Backend: Laravel
- Frontend: Vue.js 3
- State Management: Pinia
- Styling: Tailwind CSS
- Database: MySQL
- Build Tool: Vite
- HTTP Client: Axios
- Version Control: Git, GitHub
- PHP >= 8.2
- Composer
- Node.js and npm
- MySQL
- Clone the repository:
git clone https://github.com/medelm1/solar-sizer-calculator
cd solar-sizer-calculator
- Install Backend Dependencies:
composer install
-Make sure the 'fileinfo' extension is enabled in your php.ini file:
php --ini (This shows the filepath to the .ini file.)
-Within the .ini file, look for the line ';extension=fileinfo' and delete the semicoln. The save the file and restart your terminal. -Verify installation of the 'fileinfo' extension:
php -m
-fileinfo should be listed in the output.
- Set Up Environment:
Copy
.env.example
to.env
and update the database configuration and other necessary settings.
cp .env.example .env
- Generate Application Key:
php artisan key:generate
- Run Migrations:
php artisan migrate
-Make sure the 'pdo_mysql' extension is enabled in your php.ini file:
php --ini (This shows the filepath to the .ini file.)
-Within the .ini file, look for the line ';pdo_mysql' and delete the semicoln. The save the file and restart your terminal. -Verify installation of the 'pdo_mysql' extension:
php -m
-fileinfo should be listed in the output.
- Seed the Database
php artisan db:seed --class=DatabaseSeeder
- Install Frontend Dependencies:
npm install
- Run the Development Server:
npm run dev
- Start the Backend Server:
php artisan serve
Now your application should be running at http://localhost:8000
.
Contributions are welcome! If you would like to contribute to the project, please follow these steps:
-
Fork the repository.
-
Create a new branch for your feature or bug fix:
git checkout -b feature/my-feature
- Make your changes and commit them:
git commit -m "Add my feature"
- Push to the branch:
git push origin feature/my-feature
- Open a Pull Request and describe your changes.
Thank you for contributing!