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

docs(Design): Started a design document. Added packages structure #24

Merged
merged 3 commits into from
Jan 11, 2017

Conversation

davidyaha
Copy link
Member

Hey,

Added a simple diagram that shows the package structure as I understand it.
This PR is meant to hold feedback on the project structure.

Some things are left out.. For example the packages relations (what package depends on which package) is left out and should be discussed as well.

As I see it, the dependency tree should look like so:
Client: View -> Client Logic -> Transport
Server: Server Logic -> Transport, Data store

Would love some feedback here.

@TimMikeladze
Copy link
Member

@davidyaha Your understanding of the package structure is correct.

  1. An addition I would make to the server side would be the http servers (express, koa, hapi). We need to provide the necessary middleware to setup the routes or graphql depending on the user's choice of framework. I'm not sure whether these should reside in @accounts/accounts, in the server side transports, or as their own packages.

  2. The diagram is missing the oauth portion. https://github.com/simov/grant is the package I was intending on using. This also means that we need to provide callback routes for the oauth flow as part of the middleware.

@davidyaha
Copy link
Member Author

davidyaha commented Dec 19, 2016

  1. Yeah so I was thinking about it earlier and I think I missed crucial layer which is the actual network transport/protocol to use with REST or GraphQL.
    Theoretically speaking, both can use HTTP or WebSockets or any other cloud based transport like Pusher or any other thing that someone will come up with.
    So basically I propose having something like this on the diagram
------------------------------------------
Data fetching Client (GraphQL, Rest, DDP)
------------------------------------------
Transport (HTTP (express, koa, etc..)/WS)
------------------------------------------
Data fetching API (GraphQL, Rest, DDP)
------------------------------------------
  1. I was thinking oauth would be implemented as part of the client/server logic that would basically be every package used and exposed by the accounts package. Your thoughts?

@TimMikeladze
Copy link
Member

  1. Looks good.
  2. Could you please expound on that? The way I see it is @accounts/accounts provides the logic to for oauth logins (this includes initiating the request and creating/logging in as the user via the provided db package). Each of the server side transports (express, koa, hapi) need to provide callback routes for the oauth flow, this is achieved by the middleware provided from the grant package.

@davidyaha
Copy link
Member Author

@TimMikeladze Update the diagram.
I think we should merge that and the current devel branch and start working on an example. What do you think?

@TimMikeladze
Copy link
Member

@davidyaha Diagram looks good. I have some additional work to do on devel today and then I'll send a PR for review.

@TimMikeladze TimMikeladze merged commit c7929a0 into accounts-js:master Jan 11, 2017
Aetherall pushed a commit that referenced this pull request Mar 11, 2018
Aetherall pushed a commit that referenced this pull request Mar 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants