https://github.com/code-matt/raingular2
Boilerplate -- Angular2(2.0.0,CLI) frontend served from Rails5(5.0.0) backend in api_only mode with JWT authentication.
https://github.com/code-matt/raingular2
Last synced: 8 months ago
JSON representation
Boilerplate -- Angular2(2.0.0,CLI) frontend served from Rails5(5.0.0) backend in api_only mode with JWT authentication.
- Host: GitHub
- URL: https://github.com/code-matt/raingular2
- Owner: code-matt
- Created: 2016-08-11T16:57:17.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2016-09-17T19:54:46.000Z (over 9 years ago)
- Last Synced: 2025-07-31T02:15:31.448Z (10 months ago)
- Language: Ruby
- Homepage:
- Size: 66.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Raingular2
Boilerplate with Angular2(2.0.0,CLI) frontend with a Rails5(5.0.0) Backend in api_only mode.
Has basic signup/login forms and a protected route with username/password authentication provided by JWTs.
Rails serves the index.html and Angular's router takes over after that.
## Installation
Change the project name. I suggest doing find and replace 'Raingular2'
This project is setup for Postgres
```
cd
bundle install
rails db:create
rails db:migrate
rails db:seed
cd client
npm install
ng build
rails s
```
Right now you have to run ```ng build``` in the client directory while
the server is still running to see any changes you make. Still trying
to figure out how to bring live reload back.
## "Rails Resolver"
This is my best attempt so far for making Rails's routes.rb talk with angular's
router when people go to URL's directly. Mashed together from a few different sources online.
```
client/src/app/resolver/rails.component.ts
this.router.navigate(['index'])
```
Replace 'index' with whatever component you want to be loaded
for visits to the root address.
##JWT auth dependencies
Rails:
* https://github.com/nsarno/knock
* https://github.com/codahale/bcrypt-ruby
Angular:
* https://github.com/auth0/angular2-jwt
##Contribute!
* Fork it
* Create your feature branch (git checkout -b my-new-feature)
* Commit your changes (git commit -am 'Add some feature')
* Push to the branch (git push origin my-new-feature)
* Create a new Pull Request