Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/caioagiani/task-manager-api

API only in Ruby on Rails
https://github.com/caioagiani/task-manager-api

api json-api mysql ruby-on-rails

Last synced: about 2 months ago
JSON representation

API only in Ruby on Rails

Awesome Lists containing this project

README

        

# Ruby on Rails API only

Commands to download dependencies and start the application:

### v1

1. `sudo -- sh -c -e "echo '127.0.0.1 api.task-manager.test' >> /etc/hosts";`
2. `bundle install`
3. `rails db:create db:migrate`
4. `rails s`

Commands used to create the application:

1. `rails g rspec:install`
2. `rails g devise:install`
3. `rails g devise user`
4. `rspec`
- `spring rspec`
- `spring rspec /.rb --format=d`
5. `rails g controller api/v1/users`
6. `rails c`
- `User.create(email: "[email protected]", password: "123123", password_confirmation: "123123")`
- `User.all`
- `User.count`
7. `rails g migration add_auth_token_to_users auth_token:string`
8. `rails db:test:prepare`
9. `rails g controller api/v1/sessions --no-test-framework`
10. `rails g model task title:string description:text done:boolean deadline:datetime user:references`
11. `rails g controller api/v1/tasks --no-test-framework`

### v2

1. `rails g serializer api/v2/task`

- `spring stop`

## Test

```javascript
caio-agiani in task-manager-api on  master [!] ❯ spring rspec
Running via Spring preloader in process 59317

Randomized with seed 1991
..............................................................

Finished in 1.41 seconds (files took 0.16575 seconds to load)
62 examples, 0 failures

Randomized with seed 1991
```