https://github.com/mhadaily/breweryup-ember
A single page application based on brewerydb with Ember.js
https://github.com/mhadaily/breweryup-ember
brewerydb ember ember-cli ember-data emberjs
Last synced: about 1 month ago
JSON representation
A single page application based on brewerydb with Ember.js
- Host: GitHub
- URL: https://github.com/mhadaily/breweryup-ember
- Owner: mhadaily
- Created: 2017-02-11T20:15:28.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-06-01T16:17:56.000Z (about 9 years ago)
- Last Synced: 2025-02-12T18:52:04.584Z (over 1 year ago)
- Topics: brewerydb, ember, ember-cli, ember-data, emberjs
- Language: JavaScript
- Homepage: https://goo.gl/T21Kfe
- Size: 646 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# brewery-up-ember
This is a single page application based on brewerydb.com api.
[LIVE DEMO ON AMAZON S3](http://brewery-up-ember.s3-website-eu-west-1.amazonaws.com/)
##### Note: Please review MySolution section down below. and check out the server repository.
## Docker
* Run build and up: `docker-compose up`, then you are ready to use `http://localhost:4210`
if watchman is running out of resources trying to track all the files in a large ember app. To increase the fs.inotify.max_user_watches count to something that is more appropriate for an ember app, stop your docker-compose server by hitting ctrl-c (or docker-compose stop server if necessary) then execute the following command:
````commandline
docker run --rm --privileged --entrypoint sysctl breweryupember_dev -w fs.inotify.max_user_watches=524288
````
your app folder is mounted to docker container so you can easily start developing.
Alternatively, if you are willing to run on your local machine just follow the steps below:
## Prerequisites
You will need the following things properly installed on your computer.
* [Git](https://git-scm.com/)
* [Node.js](https://nodejs.org/) (with NPM)
* [Bower](https://bower.io/)
* [Ember CLI](https://ember-cli.com/)
* [PhantomJS](http://phantomjs.org/)
* [watchman](https://facebook.github.io/watchman/docs/install.html)
## Installation
* `git clone git@github.com:mhadaily/breweryUp-Ember.git` this repository
* `cd breweryUp-ember`
* `npm install` or `yarn install`
## Running / Development
* `ember serve`
* Visit your app at [http://localhost:4200](http://localhost:4200).
### Code Generators
Make use of the many generators for code, try `ember help generate` for more details
### Running Tests
* `ember test`
* `ember test --server`
### Building
* `ember build` (development)
* `ember build --environment production` (production)
### Deploying
This application has 3 environment for deployment
1. Development
2. Staging
3. Production
simply run the following command:
```commandline
AWS_ACCESS_KEY_ID=[yours] AWS_SECRET_ACCESS_KEY=[yours] ember deploy production --activate=true
```
you are able to deploy to S3 in Production environment. All build, revision, Gzip and other pipeline for deployment
has been done and will be deployed automatically. ENJOY!
## CORS issue
Answer from BreweryDB:
We don't currently support any type of AJAX calls or JSONP to the API for security reasons. You'd have to expose your API key to the public in your JS and that wouldn't be good. Steve's recommendation to proxy your AJAX calls through your server is the one we also suggest.
### My solution
I have created what I need for my project through API Gateway and Lambda in AWS. Please visit [my server repo](https://github.com/mhadaily/breweryUp-Node-Lambda)
```commandline
endpoints:
GET - https://2wb03ukih6.execute-api.us-west-1.amazonaws.com/v2/beers/{id}
GET - https://2wb03ukih6.execute-api.us-west-1.amazonaws.com/v2/beers/{id}/breweries
GET - https://2wb03ukih6.execute-api.us-west-1.amazonaws.com/v2/beers/{id}/breweries/{brid}
GET - https://2wb03ukih6.execute-api.us-west-1.amazonaws.com/v2/beers/{id}/events
GET - https://2wb03ukih6.execute-api.us-west-1.amazonaws.com/v2/beers/{id}/yeasts
GET - https://2wb03ukih6.execute-api.us-west-1.amazonaws.com/v2/beers/{id}/ingredients
GET - https://2wb03ukih6.execute-api.us-west-1.amazonaws.com/v2/beers
```
## TODO
**RESTSerializer**
The serializer in Ember for Beers is only done which is I need to complete and demonstrate this project.
However, I still need to work on `hasMany` and `belongsTo` for other models.
Although I have partially done that, still need refinement until 100% ready.
For now, I will finish project with simple ajax request for other part as soon as it they need.
## Further Reading / Useful Links
* [ember.js](http://emberjs.com/)
* [ember-cli](https://ember-cli.com/)
* Development Browser Extensions
* [ember inspector for chrome](https://chrome.google.com/webstore/detail/ember-inspector/bmdblncegkenkacieihfhpjfppoconhi)
* [ember inspector for firefox](https://addons.mozilla.org/en-US/firefox/addon/ember-inspector/)