<commit_before># login-prototype

Demoing Google+ login. Implementation is based off of the [gplus-quickstart-go](https://github.com/googleplus/gplus-quickstart-go) project, adapted to Polymer. 

This prototype also supports username creation, and stores the data into a simple Postgresql database which records a user's email and username.

A simple, custom signin button was created since the `google-signin` web component does not allow for offline access (since it isn't capable of providing a code). It's a bit buggy at the moment, so hopefully the official `google-signin` component will have that feature included in the future.

### Setup

Follow Step 1 of the [gplus-quickstart-go tutorial](https://developers.google.com/+/web/samples/go) to set up the Google+ API.

After that, you should create a config file named `config.gcfg` based off of the included `example.gcfg` file, which contains your Client ID and Client Secret, and database login information. This config file will be specific to you and should remain private as exposing the Client Secret or database login credentials can create security issues.

After that, it should be as simple as running:

```bash
go run *.go
```

within the `server/` folder. The site will then be accessible via `http://localhost:8000`.<commit_msg>Add database setup details to login prototype README<commit_after># login-prototype

Demoing Google+ login. Implementation is based off of the [gplus-quickstart-go](https://github.com/googleplus/gplus-quickstart-go) project, adapted to Polymer. 

This prototype also supports username creation, and stores the data into a simple Postgresql database which records a user's email and username.

A simple, custom signin button was created since the `google-signin` web component does not allow for offline access (since it isn't capable of providing a code). It's a bit buggy at the moment, so hopefully the official `google-signin` component will have that feature included in the future.

### Setup

Follow Step 1 of the [gplus-quickstart-go tutorial](https://developers.google.com/+/web/samples/go) to set up the Google+ API.

Then, set up a Postgresql database. It should be accessible via the command line by running a command such as:

```bash
psql -h host -d database -U user
```

The database should be password protected for security reasons. Once that is in place, you should initialize the database with the `dbinit.sql` file by running the following command in the database:

```bash
\copy dbinit.sql
```

You'll also need to create a `config.gcfg` file, based off of the given `example.gcfg` file. This is necessary so as not to expose critical security information such as the database's password on GitHub.

After that, it should be as simple as running:

```bash
go run *.go
```

within the `server/` folder. The site will then be accessible via `http://localhost:8000`.

To later destroy the database, use the `dbdrop.sql` file, and run the following command in the database:

```bash
\copy dbdrop.sql
```
{'fraction_non_alphanumeric': 0.07488402915838303, 'fraction_numerical': 0.0033134526176275677, 'mean_word_length': 4.559852670349908, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, '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': '957521', 'n_tokens_mistral': 814, 'n_tokens_neox': 764, 'n_words': 423}