<commit_before># usersnack
A simple web app that lets you order pizzas, written with [Flask](http://flask.pocoo.org/) and [Angular CLI](https://github.com/angular/angular-cli), using [MongoDB](https://www.mongodb.com/) for persistence.
## Prerequisites
* Python 3.6
* pip 9.0.1
* MongoDB 3.2
* Node 6.9.0
* NPM 3

## Instructions

Virtualenv
```bash
pip install -r api/requirements.txt
```

Repair broken data.json
```bash
cd scripts
python json_parser.py
```
### Persistence with [MongoDB](https://www.mongodb.com/)
Start MongoDB daemon
```bash
mongod --config mongod.conf
```

Generate database and insert pizzas and extras into collections
```bash
cd scripts
python init_db.py
```

Connect to MongoDB shell for debugging reasons
```bash
mongo usersnack
show collections
db.pizzas.find()
db.extras.find()
db.orders.find()
```

### API with [Flask](http://flask.pocoo.org/)
Start the API (on a Windows based machine)
```bash
. venv/Scripts/activate
export FLASK_APP=api/app.py
export FLASK_DEBUG=1
flask run
```

The API base path is [http://localhost:5000/api/v1/](http://localhost:5000/api/v1/) with CORS enabled

Hit `ctrl + c` to stop
```bash
deactivate
```

### UI with [Angular CLI](https://github.com/angular/angular-cli)
```bash
cd ui
ng serve
```

The Angular UI is hosted on [http://localhost:4200](http://localhost:4200)

Hit `ctrl + c` to stop

### TODOs
* Setup mail server
* Import UI library e.g. [https://almsaeedstudio.com/preview](https://almsaeedstudio.com/preview)
* Refactor hacky css
* Revise responsive layout
* Test on Linux
* Test with multiple browsers<commit_msg>revised and corrected for a fresh clone<commit_after># usersnack
A simple web app that lets you order pizzas, written with [Flask](http://flask.pocoo.org/) and [Angular CLI](https://github.com/angular/angular-cli), using [MongoDB](https://www.mongodb.com/) for persistence.
## Prerequisites
* Python 3.6
* pip 9.0.1
* MongoDB 3.2
* Node 6.9.0
* NPM 3

## Instructions

Clone repo
```bash
git clone <EMAIL>:sluger/usersnack.git
```

Create virtualenv
```bash
cd usersnack
virtualenv venv
```

Activate virtualenv
```bash
. venv/Scripts/activate
```

Install requirements
```bash
pip install -r api/requirements.txt
```

Repair broken data.json
```bash
cd scripts
python json_parser.py
```

### Persistence with [MongoDB](https://www.mongodb.com/)
Start MongoDB daemon
```bash
mongod --config mongod.conf
```

Generate database and insert pizzas and extras into collections
```bash
cd scripts
python init_db.py
```

Connect to MongoDB shell for debugging reasons
```bash
mongo usersnack
show collections
db.pizzas.find()
db.extras.find()
```

### API with [Flask](http://flask.pocoo.org/)
Start the API (e.g. on a Windows based machine within the usersnack dir)
```bash
export FLASK_APP=api/app.py
export FLASK_DEBUG=1
flask run
```

The API base path is [http://localhost:5000/api/v1/](http://localhost:5000/api/v1/) with CORS enabled

To stop the API, hit `ctrl + c`
```bash
deactivate
```

### UI with [Angular CLI](https://github.com/angular/angular-cli)
```bash
cd ui
npm install
ng serve
```

The Angular UI is hosted on [http://localhost:4200](http://localhost:4200)

To stop the web server, hit `ctrl + c`

### TODOs
* Setup mail server
* Import UI library e.g. [https://almsaeedstudio.com/preview](https://almsaeedstudio.com/preview)
* Refactor hacky css
* Revise responsive layout
* Test on Linux
* Test with multiple browsers
{'fraction_non_alphanumeric': 0.1421897810218978, 'fraction_numerical': 0.017518248175182483, 'mean_word_length': 4.561688311688312, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 12, 'lorem ipsum': 0, 'www.': 4, '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': '2156783', 'n_tokens_mistral': 1271, 'n_tokens_neox': 1152, 'n_words': 361}