<commit_before>hectorcorrea.com
================
This is the source code of the site that powers my personal site at http://hectorcorrea.com.

This branch (go_version) is my work in progress as I transition the code from
Node.js/Express.js/MongoDB to Go/MySQL and **it is not in production yet**

Notice I am pretty new to Go and this might not follow Go recommended
practices but I am using it as my sandbox.

How to run the site
------------

```
git clone <this repo>
cd hectorcorrea.com
git fetch
git checkout go_version

# Create the MySQL database
mysql -u root < misc/createdb.sql

# Compile and run it
go build  
go get github.com/go-sql-driver/mysql
./hectorcorrea.com
# browse to localhost:9001
```


Structure of the source code
----------------------------
* **main.go** launches the web server
* **web/** routes requests to the proper models.
* **models/** connect to the database.
* **views/** contains the views.

Please ignore the `*.js` files, they are left overs as I transition
the code from Node.js to Go.


The database
--------------
The code will connect to a MySQL database with the parameters indicated in the
following environment variables. If you don't set these environment variables
the code will assume the value indicated inside the parenthesis.

* DB_USER (root)
* DB_PASSWORD ()
* DB_NAME (blogdb)

You can see where these values are used in `models/db.go`

Questions, comments, thoughts?
------------------------------
This is a very rough work in progress as I learn and play with Go.

Feel free to contact me with questions or comments about this project.
<commit_msg>Added a few steps for new users<commit_after>hectorcorrea.com
================
This is the source code of the site that powers my personal site at http://hectorcorrea.com.

This branch (go_version) is my work in progress as I transition the code from
Node.js/Express.js/MongoDB to Go/MySQL and **it is not in production yet**

Notice I am pretty new to Go and this might not follow Go recommended
practices but I am using it as my sandbox.

How to run the site
------------

```
# Get the code
git clone <this repo>
cd hectorcorrea.com
git checkout go_version

# Create the MySQL database
mysql -u root < misc/createdb.sql

# Compile and run it
go build  
go get github.com/go-sql-driver/mysql
./hectorcorrea.com
# browse to localhost:9001
```

Once the site is running
--------
Browse to http://localhost:9001/auth/login to login. Use user `user1` password
`<PASSWORD>`

Then go to http://localhost:9001/blog and click `new` to add a new blog.



Structure of the source code
----------------------------
* **main.go** launches the web server
* **web/** routes requests to the proper models.
* **models/** connect to the database.
* **views/** contains the views.

Please ignore the `*.js` files, they are left overs as I transition
the code from Node.js to Go.


The database
--------------
The code will connect to a MySQL database with the parameters indicated in the
following environment variables. If you don't set these environment variables
the code will assume the value indicated inside the parenthesis.

* DB_USER (root)
* DB_PASSWORD ()
* DB_NAME (blogdb)

You can see where these values are used in `models/db.go`

Questions, comments, thoughts?
------------------------------
This is a very rough work in progress as I learn and play with Go.

Feel free to contact me with questions or comments about this project.

{'fraction_non_alphanumeric': 0.125764192139738, 'fraction_numerical': 0.004949053857350801, 'mean_word_length': 3.164848484848485, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1904611', 'n_tokens_mistral': 971, 'n_tokens_neox': 930, 'n_words': 484}