> For the complete documentation index, see [llms.txt](https://docs.lineverge.com/automail/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.lineverge.com/automail/installation/dev.md).

# Dev

{% hint style="info" %}
Local Automail instances run on a development server that comes with Automail.

The recommended local database is **MySQL**. If not yet installed on your laptop, download the **MySQL Community Server** and **MySQL Workbench** MSI installers from the [official MySQL website](https://www.mysql.com/downloads/) and proceed with the installation.

For MacOS, you can install the local MySQL server by running `brew install mysql`.&#x20;
{% endhint %}

1. Clone the [forked repository](/automail/installation.md) locally within your Lineverge/Automail Forks folder.

```git
git clone https://github.com/Lineverge/[forked repo name].git
```

2. Create a local MySQL database by using an SQL editor in MySQL workbench.

```sql
CREATE SCHEMA `[forked repo name]` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_bin ;
FLUSH PRIVILEGES;
CREATE USER 'automail'@'localhost' IDENTIFIED BY 'Test12345'; -- If user automail does not yet exist
FLUSH PRIVILEGES;
GRANT ALL ON [forked repo name].* TO 'automail'@'localhost';
```

3. Create and activate a new Python virtual environment **automail** dedicated to your instance and outside of your repository.

```batch
cd C:\Users\user\Documents\Lineverge\Virtual Environments
virtualenv automail
automail\Scripts\activate
```

4. Navigate to the repository root folder and install the requirements.

```batch
cd C:\Users\user\Documents\Lineverge\Automail Forks\[forked repo name]
pip install -r software\requirements.txt
```

5. Add the client logo into the folder *software\project\static\images\company\logo.png* with the dimensions 320x320.
6. Navigate C:\Users\user\Documents\Lineverge\Automail Forks\\\[forked repo name]\software\project and create your [settings.py](/automail/configurations/settings.md) file following the instructions.
7. Migrate the initial data model and then run the local test server to confirm the installation was successful.

```batch
python software\project\automail.py migrate
python software\project\automail.py runserver
```

All your instance-specific configurations must be within the software\\**project** folder. Any changes outside the project folder will be overwritten the next time the fork gets synced with the Automail main repository.

Local changes within the project folder should be first tested extensively locally and then versioned with comprehensive comments using Git.&#x20;

Example:

```batch
git add .
git commit -am "adding piechart to show order quantity grouped by brands"
git push
```

{% hint style="danger" %}
In the case of a containerized PROD, every push to the main branch will automatically deploy the committed local changes to the production site.&#x20;
{% endhint %}
