/token-auth

Demo app ng-token-auth with devise_token_auth

Primary LanguageRuby

Blog

Implementation with a token based auth

Access directly on heroku instance

url: http://univ-mon.herokuapp.com/#/login
username/password: ankit@a.com/P@ssword OR dan@a.com/P@ssw0rd

Screen 1 Alt text

Screen 2 Alt text

Screen 3 Alt text

Tech Stack

  • AngularJS
  • Rails
  • ng-token-auth
  • devise_token_auth

Setup

Application comes in two parts

  • Client: Angular JS application
  • Server: Rails API

Installation

You have to install both the apps manually .

#Installing Client app
$ cd client
$ npm install && bower install 
```
````ruby
#Installing Server app
$ cd server
$ bundle install
$ bundle exec rake db:create && bundle exec rake db:migrate && bundle exec rake db:seed
```
<h4> Running application locally</h4>
Application root has a [Procfile](https://github.com/ankit8898/kt.it/blob/master/Procfile)  that runs both client and server locally . Run application via [foreman](https://github.com/ddollar/foreman)

```
$ foreman start
$ 11:13:17 client.1 | started with pid 4560
$ 11:13:17 server.1 | started with pid 4561

```

## Testing

We use rspec for testing :heart:

```
$ bundle exec rspec 
.............

Finished in 1.41 seconds (files took 2.5 seconds to load)
26 examples, 0 failures

```