Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Demo scenario: User Profile Component #1480

Closed
4 tasks done
dhmlau opened this issue Jun 26, 2018 · 7 comments
Closed
4 tasks done

Demo scenario: User Profile Component #1480

dhmlau opened this issue Jun 26, 2018 · 7 comments

Comments

@dhmlau
Copy link
Member

dhmlau commented Jun 26, 2018

Description / Steps to reproduce / Feature proposal

As part of the e-commerce store demo scenario in #1476, this task is to create the user profile component. User profile data is persisted in a database.

Acceptance Criteria

  • Create a new GitHub repo to host the demo app, scaffold the app using lb4 app and configure Travis CI builds. This should be a standalone pull request to make review easier.
  • Define user profile model with the following properties:
    • id (the primary key, required)
    • email (required)
    • password (required, stored as a value hashed via bcrypt),
    • firstname (optional)
    • surname (optional)
  • Use Cloudant as the datasource, use a Docker image to run a Cloudant instance. Configure Travis CI to start a Cloudant docker instance for tests.
  • Create User Profile controller that exposes REST APIs with two endpoints:
    • Create (register) a new user. The values provided for user properties must be validated.
    • Get user profile for a given user id. Password must be excluded from the response body.

The implementation should include a test suite following the best practices outlined in https://loopback.io/doc/en/lb4/Testing-your-application.html.

Out of scope

  • Authentication and authorization.
@bajtos
Copy link
Member

bajtos commented Jul 30, 2018

I have added more content to the issue description and removed questions/discussion points.

Questions / To be discussed:

  1. Database: what kind of database do we use? Cloudant (so that we can move into the deployment story smoothly)? -- Use Cloudant
  2. LB4 app or not: are we going to create an LB4 app for user profile? Is the User Profile component exposing REST APIs? -- User Profile Controller
  3. What are the authentication and authorization requirements here? -- Needs discussion here.

@shimks
Copy link
Contributor

shimks commented Jul 31, 2018

There are couple of questions that have arisen during the estimation meeting.

  1. Is the User model (+ datasource, etc.) going to be packaged into a component? Is this going to be separate from the application? If this is going to be a standalone module, will it be intended for users to use later? Will it be separate lerna repo?
  2. Why is authentication and authorization out of scope for this task? Authentication/authorization is a necessity for an ecommerce application.
  3. Would component extensibility be fleshed out with this task, or would it have been done already?
    @bajtos @raymondfeng @dhmlau

@dhmlau
Copy link
Member Author

dhmlau commented Jul 31, 2018

From my understanding of what @raymondfeng and @bajtos trying to achieve in this demo scenario is to create a single LB application that exposes various endpoints. See comments from @bajtos in here.

  1. Is the User model (+ datasource, etc.) going to be packaged into a component? Is this going to be separate from the application? If this is going to be a standalone module, will it be intended for users to use later? Will it be separate lerna repo?

there won't be "Component" (in LB terminology), and no standalone module. User model and User controller will be part of the LB application.

  1. Why is authentication and authorization out of scope for this task? Authentication/authorization is a necessity for an ecommerce application.

To get us started, there will be no authentication/authorization. We haven't flushed out the authentication/authorization story yet.

  1. Would component extensibility be fleshed out with this task, or would it have been done already?

Same comment as #1.

@virkt25
Copy link
Contributor

virkt25 commented Jul 31, 2018

A Component isn't the same as a microservice, we should probably call (User, Cart)Components something else to avoid the confusion with LB4 concept of a Component. That said, I think it would be neat to demonstrate that if possible in our examples -- but something we can refactor post-GA

@bajtos
Copy link
Member

bajtos commented Aug 1, 2018

Sorry for the confusion. In general, we need to keep these demo stories as simple as possible and only with the scope of what's possible in 4.0 GA.

Is the User model (+ datasource, etc.) going to be packaged into a component? Is this going to be separate from the application? If this is going to be a standalone module, will it be intended for users to use later? Will it be separate lerna repo?

As others already commented, we are not going to build any components (loopback extensions). "User component" means "the part of the demo app that provides User-related REST API"

Why is authentication and authorization out of scope for this task? Authentication/authorization is a necessity for an ecommerce application.

Both authentication and authorization are out of scope of 4.0 GA.

Would component extensibility be fleshed out with this task, or would it have been done already?

Component extensibility is out of scope of 4.0 GA.

@virkt25
Copy link
Contributor

virkt25 commented Aug 1, 2018

Thanks for the clarification on the task @bajtos

@virkt25
Copy link
Contributor

virkt25 commented Aug 2, 2018

On Travis it might be easier to use CouchDB / MongoDB (more popular if not looking at cloud deployment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants