To cite the contents of this repository, please cite both the paper Microgrid Planner: An Open-Source Software Platform and its corresponding GitHub repository.
The goal of this software is to deploy analytical methods for microgrid planning.
├── backend <- Backend application (see README in backend for more info)
├── frontend <- Frontend application (see README in fronted for more info)
├── config.ini.template <- Global config file template for shared settings between backend and frontend (copy to config.ini and update parameter values)
├── database-authentication.env.template <- MySQL configuration file template for authentication database (copy to database-authentication.env and update parameter values)
├── docker-compose.yaml.template <- Configuration file for Docker multi-container application services (copy to docker-compose.yaml)
├── generate_secret_key.py <- Script to generate a secret key for config.ini
├── LICENSE <- License terms
└── README <- Documentation
-
Setup a Python 3.11 environment for the backend and the frontend
- On Windows
- Make sure to check "Add Python to environment variables" under advanced options in setup
- On Windows
-
Install mysql, add it to
${PATH}
and ensure it is running in the background- On Mac OS
- install homebrew
- run
brew install pkg-config
- run
brew install mysql
- run
brew install mysql-client
- run
echo 'export PATH="/usr/local/opt/mysql-client/bin:$PATH"' >> ~/.zshrc
- run
export LDFLAGS="-L/usr/local/opt/mysql-client/lib"
- run
export CPPFLAGS="-I/usr/local/opt/mysql-client/include"
- On Windows (with local admin)
- Install MySQL Server for Windows (choose
mysql-installer-community-8.0.360.msi
) - Run the installer and step through the installation options. Choose
Server only
as the setup type. - Once the install is complete, you'll need to configure the server. Use the default options and click
next
. - Choose
Use Strong Password Encryption for Authentication
for the authentication method - Create the root password and save it. It will be used in the
database-*.env
files. - Keep the default
Windows Service
options and clicknext
. - Under
Apply Configuration
clickExecute
. - Continue through the next steps using the default options
- The server should now be running. If you need to start the server again, go to
Services
>MySQL80
and clickstart
. - For troubleshooting, read the MySQL documentation for installing via the Windows installer.
- Install MySQL Server for Windows (choose
- On Windows (without local admin)
- Install MySQL Server .zip version 8 (select
Windows (x86, 64-bit), ZIP Archive
). - Extract the files and move the folder to your programs folder (ex:
C:\Program Files\MySQL\mysql8install
) - Inside the
MySQL
folder, create two empty directories:logs
andmysqldata
. - Inside the
mysql
install folder that containsbin
,docs
,include
, etc., create a new file calledmy.ini
. - Open
my.ini
in an editor and paste the following, correcting the paths to yourmysqlinstall
,mysqldata
, andmysql
logs folders:[mysqld] basedir = "C:/MYSQL/mysql8install" datadir = "C:/MYSQL/mysqldata" tmpdir = "C:/MYSQL/logs" log-error = "C:/MYSQL/mysql-server-1.log"
- Open a terminal and navigate to your
MySql/mysql8install/bin
folder. - Run
mysqld --initialize-insecure
to initialize the data. This will create a data folder under/mysql8install
. Running it as insecure will enable running the database without a password. - In the same directory, run
mysqld --console
to start the MySQL server. Leave this terminal window open. Closing it will stop the server. - For troubleshooting, read the MySQL documentation for installing via archive.
- Install MySQL Server .zip version 8 (select
- On Mac OS
- Create configuration files, per instructions below
config.ini
- Generate
SECRET_KEY
by runningpython3 generate_secret_key.py
- Note: password values in
backend/data/mysql/*data*.sql
are stored in plain text and are automatically hashed with this secret key when the authentication database is created
- Generate
database-authentication.env
MYSQL_ROOT_PASSWORD
may be set when setting up the MYSQL database in step 2 aboveMYSQL_USER
,MYSQL_PASSWORD
andMYSQL_DATABASE
can be set to any valuesMYSQL_PORT
should be set to3306
MYSQL_HOST
should be set to127.0.0.1
orlocalhost
or when running Docker tomysql
- Review
README
files in bothfrontend
andbackend
folders and follow instructions.
- Run
docker-compose up
(by default, Docker will run the docker-compose.yaml file)