Giter Club home page Giter Club logo

user_service's Introduction

UserService

The UserService handles storage and management of Users. The required tables are as follows:

  • Users The Users table contains important information about the User such as email, username, and password. The Users table also has a belongs_to relationship with the Gender table.

    The Users table has a unique constraint on both username and email to ensure that we don't have name conflicts and that each user can only make one account. This can be circumvented by creating additional emails to register more accounts, but who really cares tbh.

    Users has_many Permissions.

  • Permissions Permissions should be a list of named permissions that other services will recognize and be able to adapt to.

    Initially, the Permissions table will be pre-loaded with admin which will be assigned to the first User to create an account. the admin User will be able to alter the permissions of other Users.

    Columns: name, the name of the permission description, a detailed description of the permission so developers of other services will be able to use these permissions effectively.

    Permissions has_many Users.

The UserService is also responsible for signing User Tokens that other services can relay to the UserService in order to ensure a User is who they say they are.

Endpoints:

  • POST /users/create The URL used to create Users.
  • GET /users/:user_id The URL to get information about a specific User.
  • POST /users/authenticate The URL that verifies a User is real with a username and password and returns a signed UserToken.
  • GET /users/:user_id?permission=":permission" When provided with a permission in the payload, it provides whether a user has this permission.
  • GET /users/:user_id/permissions Lists all permissions owned by the user
  • GET /permissions A list of all available permissions and their descriptions.
  • POST /permissions/create The URL used to create permissions

To start your Phoenix app:

  • Run setup.sh to create the required postgresql users
  • Install dependencies with mix deps.get
  • Create and migrate your database with mix ecto.create && mix ecto.migrate
  • Start Phoenix endpoint with mix phoenix.server

Now you can visit localhost:4000 from your browser.

Ready to run in production? Please check our deployment guides.

Learn more

user_service's People

Contributors

asonix avatar

Watchers

James Cloos avatar kellboy9 avatar  avatar KAI 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.