GithubHelp home page GithubHelp logo

staffomatic_user_management's Introduction

Staffomatic User Management

This is our Lekker Rails-API ๐Ÿš€

Rspec

Get it up and running

start up docker

$ docker-compose up
Building api
Step 1/10 : FROM ruby:2.6.6-alpine
...
server --help` for more startup options
api_1    | Puma starting in single mode...
api_1    | * Puma version: 5.2.0 (ruby 2.6.6-p146) ("Fettisdagsbulle")
api_1    | *  Min threads: 5
api_1    | *  Max threads: 5
api_1    | *  Environment: development
api_1    | *          PID: 1
api_1    | * Listening on http://0.0.0.0:3189
api_1    | Use Ctrl-C to stop

use --build api if you changed e.g. Gemfile

$ docker-compose up --build api

Check if app is running, expect a ActiveRecord::NoDatabaseError:

$ open http://localhost:3189
# or
$ curl http://localhost:3189

Follow the logs

$ tail -f log/development.log
# or for specs:
$ tail -f log/test.log

Prepare database

$ docker-compose run api bundle exec rake db:prepare
  Creating staffomatic_user_management_api_run ... done
  Created database 'staffomatic_user_management_development'
  Created database 'staffomatic_user_management_test'

Run specs

$ docker-compose run api bundle exec rspec

if you see a migration error, you might need to run:

$ docker-compose run -e RAILS_ENV=test api bundle exec rake db:prepare

Cleanup Docker

Stop the container(s):

$ docker-compose down

Delete all containers:

$ docker rm -f $(docker ps -a -q)

Delete all volumes:

$ docker volume rm staffomatic_user_management_db_data
# OR remove all
$ docker volume rm $(docker volume ls -q)

API Documentation

Signup User

(POST /signup)
$ curl --request POST --header "Content-Type: application/json" \
          http://localhost:3189/signup --data \
          '{"data": {"attributes": {"email": "[email protected]", "password": "welcome", "password_confirmation": "welcome"}}}'

Authenticate User

(POST /authentications)
$ curl --request POST --header "Content-Type: application/json" \
          http://localhost:3189/authentications --data \
          '{"authentication": {"email": "[email protected]", "password": "welcome"}}'

List Users

(GET /users)
$ curl --header \
        "Authentication: Bearer JWT_TOKEN" \
        --header "Content-Type: application/json" \
        http://localhost:3189/users

staffomatic_user_management's People

Contributors

cameronstaljaard avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.