GithubHelp home page GithubHelp logo

marcleblanc / profile_service Goto Github PK

View Code? Open in Web Editor NEW

This project forked from gctools-outilsgc/profile_service

0.0 0.0 0.0 1.29 MB

Profile microservice built in Apollo and Prisma

License: GNU Affero General Public License v3.0

Dockerfile 1.80% Shell 3.32% JavaScript 94.88%

profile_service's Introduction

profile_service

Installation

This app/solution can be run in 2 different environments.

Configuration

To configure this application there are 2 files that require mondifcation.

  1. ./src/config.js

    This file contains the majority of the variables that define the diference between your production, development, and test environments that are not secrets.

  2. ./.env

    This file contains the secrets required for the application and can be set eitehr through ENV variables or through this file.

  • MQ_USER = Username for RabbitMQ instance set in ./src/config.js
  • MQ_PASS = Password for RabbitMQ instance

Development

To setup this application in development run the following commands:

  • sudo docker-compose -f docker-compose-dev.yml up
  • sudo npm install
  • npm start dev

The profile as a service playground endpoint can now be reached at http://localhost:4000/playground and the graphql endpoint at http://localhost:4000/graphql The prisma service can be reached at http://localhost:4466/profile

Production

To setup this application for production:

  • sudo docker-compose up --build -d

The profile as a service playground endpoint can now be reached at http://localhost:4000/playground and the graphql endpoint at http://localhost:4000/graphql

Tests

To run tests from the root of the project:

  • sudo docker-compose -f docker-compose-test.yml up -d
  • npm test

Validation

Validation is implemented for some fields.

Fields with <-- have a specific validation.

profile
{
    gcID,
    name,
    email, <--
    avatar,
    mobilePhone, <--
    officePhone, <--
    address:
    {
        streetAddress,
        city,
        province, 
        country, 
        postalcode
    }
    titleEn,
    titleFr,
    supervisor,
    org 
}

Profile

When initializing a 'Profile' only gcID, name and email are mandatory fields.

Email Address

Email address must be formated as: [email protected]

example: [email protected]

Mobile/Office Phone Number

Available format:

  • ##########
  • ###-###-####
  • ###.###.####
  • (###) ###-####
  • (###)###-####
  • +###########
  • ###-#######

Address

When specifying an address all fields are mandatory except in cases when an address already exists on a profile and it is only being modified.

profile_service's People

Contributors

bryan-robitaille avatar ethanwallace avatar guillaumelebel avatar lucbelliveau avatar steph4104 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.