# Sermon Notes

A program to take notes during a sermon.  The web app was built with PHP and Symfony.

## ATTN: !!!!BREAKING CHANGE!!!! v1.0 -> v1.1

This was my first publicly available docker container so I did not realize what some decisions would do. If you are upgrading from v1 you first need to save your database OR you will lose all your current notes!! Follow the steps below to do that

1. You need to make sure that you have a running SSH server on your host computer
2. Make a directory in your `sermon-notes` folder for your database (e.g. `data`)
3. On your host computer, `docker exec -it sermon-notes bash`
4. `scp .env {user}@{IP}:{path}`
5. Authenticate with the password
6. `cd var/`
7. `scp data.db {user}@{IP}:{path}/data`
8. This will copy the file to the host computer
9. After this then you run the `docker run...` command in Step 3 of the `Installation` instructions below

## Installation

1. Make a directory in your desired docker storage folder (e.g. `~/docker/sermon-notes`), then `cd` into it.
2. Create a file called `.env` in that folder, no need to add anything to it right now.
3. Download your preferred compose file (`wget -O compose.yml {link}`)
    1. [`compose.sqlite.yml`](https://gitea.rkprather.com/ryan/sermon-notes/raw/branch/main/docker/compose.sqlite.yml) - compose file for if you are planning to use SQLite
    2. [`compose.mysql.yml`](https://gitea.rkprather.com/ryan/sermon-notes/raw/branch/main/docker/compose.mysql.yml) - compose file with an integrated MYSQL database image
    3. [`compose.mariadb.yml`](https://gitea.rkprather.com/ryan/sermon-notes/raw/branch/main/docker/compose.mariadb.yml) - compose file with an integrate MariaDB database image
    4. [`compose.pgsql.yml`](https://gitea.rkprather.com/ryan/sermon-notes/raw/branch/main/docker/compose.pgsql.yml) - compose file with an integrate Postgres database image
    5. [`compose.shared-db.yml`](https://gitea.rkprather.com/ryan/sermon-notes/raw/branch/main/docker/compose.shared-db.yml) - compose file with no database image because you are planning on using an existing database container or bare metal server
4. Pull the image `docker pull gitea.rkprather.com/ryan/sermon-notes:latest`
5. **NOTE: IF UPGRADING SKIP THIS STEP!!!** - Run the setup script, this will setup your .env file so that when you start the container everything will be where it is supposed to be.
    - `docker run --rm -it -v ${PWD}/.env:/var/www/html/.env gitea.rkprather.com/ryan/sermon-notes:latest php /var/www/html/setup.php --{database-type} {--shared}`
    - `{database-type}` = `sqlite`, `mysql`, `mariadb`, or `pgsql`
    - If you intend on this being connected to a shared database make sure that you specify `--shared`.
6. Start the container with compose `docker compose up -d`
7. **NOTE: IF UPGRADING SKIP THIS STEP!!!** Run `docker exec -it sermon-notes php /var/www/html/install.php`. This will run the `php composer` to populate the database with all the desired reference material.
    - NOTE: You will see deprecation warnings, you can ignore these
8. Once complete you have a running system that you can navigate to in your browser with `http://{ip}:{port}`|`http://{hostname}:{port}`.  Then you just need to register for an account.  The first account that is created is made an admin so that you can access the `Reference Editor` and update any reference material if necessary.

## Operation

This is the home page you're first presented with.

![Home](/assets/images/Home.png)

Create an account with "Register".

![Register](/assets/images/Registration.png)

Once you create an account you'll need to login

![Login](/assets/images/Login.png)

Once you get logged in you'll be presented with the main home page

![HomePage](/assets/images/HomePage.png)

If you are accessing on a regular iPad the menu should be collapsed, if not, you may need to do that.  I built this with a iPad 9th Gen in mind so visibility on another device may vary.

![Header](/assets/images/Header.png)

Across the top you will see a "plus" and "minus" buttons that will increase and decrease the size of font for the reference content.  The 3rd button is to open the Reference opener box.  On the right side you will see the "table" that will open the sermon details portion.  The next button is a preview button to preview the notes you have typed.  The final dropdown is to quickly apply a template for you to start taking notes.

![SermonData](/assets/images/SermonData.png)

These fields are meant to hide because you only need to fill them out once and they are the specifics of the sermon itself (e.g. title, date, speaker, series, and passage)

![Template](/assets/images/Template.png)

The notes you take are done in [Markdown](/docs/markdown-cheat-sheet.md).  In the above example, there is an introduction and 3 bullet points.  Each has a sub-bullet unordered list.  Review the Markdown link above for more tips on how to write Markdown.

When you are done with your Notes it will look something like the following.

![Example](/assets/images/MarkdownExample.png)

The tool is built that it will auto-save every 10 seconds and have a 5 second timeout should you be in a place where you don't have good internet service.  When the tool starts to save you will see an orange checkmark appear next to the "Notes" header above where your typing.  When it is done saving it will turn green and fade away.

I built this tool because I needed a way to take notes and have reference material open next to me.  So I built a reference opener to do just that

![ReferenceOpener](/assets/images/ReferenceOpener.png)

I have added many reference options (Bible, various creeds, Belgic Confession, Heidelberg Catechism, Canons of Dort, Westminster Confession of Faith, Westminster Larger Catechism, or Westminster Short Catechism).  I plan to add others in the future.  Simply select the type then filter to the book/chapter/week of the referenced work and hit "Search".  This will open the reference on the left side of the page.

![References](/assets/images/References.png)

You can switch between the references by clicking the button on the left side.  You can double-tap one of the buttons to remove that reference from the list.

Once a note has been saved, it can be retrieved in two different ways.  You can open the open page (by clicking on the Menu (hamburger) then "Open Notes")

![OpenNotes](/assets/images/OpenNotes.png)

or if the note was recently made you will see the most recent 4 notes listed under the menu

![RecentNotes](/assets/images/RecentNotes.png)

By clicking either of the title links it will open the note and display it for you to edit or read.  I can add "Notes" as future reference content.

