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

Super template doesn't skip setup or store user persistantly #21

Closed
Martinspire opened this issue Nov 28, 2017 · 5 comments
Closed

Super template doesn't skip setup or store user persistantly #21

Martinspire opened this issue Nov 28, 2017 · 5 comments

Comments

@Martinspire
Copy link

Martinspire commented Nov 28, 2017

So here I thought to use the super template and kickstart my application. I saw that it had Users which is nice, but apart from login/signup it doesn't feature remembering the login so whenever you reopen the app, it doesn't show you the welcome/login but keeps you signed in. So an important part seems missing to me: persistent storage of the user.

I like the rest of the code and how it explains various features, but I had hoped it would show me a bit more. Now of course the whole system is already weird because you need an API (which never is documented what in this example should be supported or even a basic mock will do). You are kind of teaching users how to use your framework and it might have given different expectations. I also wonder why you add many pages but don't make them available via navigation to easily browse them. If it had some button to press to popup the rest of the pages, it would make so much more sense and then can also be used better as a demonstration.

The rest of the template looks nice so its just some constructive feedback ;)

@Martinspire Martinspire changed the title Super template doesn't validate or store user Super template doesn't skip setup or store user persistantly Nov 28, 2017
@jgw96
Copy link
Contributor

jgw96 commented Dec 6, 2017

Hey @Martinspire , thanks for the feedback! Just have a question:

On this I like the rest of the code and how it explains various features, but I had hoped it would show me a bit more. Now, of course, the whole system is already weird because you need an API (which never is documented what in this example should be supported or even a basic mock will do). Are you looking for recommendations on what real backend solution you should use? Currently, the API provider is basically a mock of what interacting with a backend would look like, but it does not mention any actual backend providers you could use.

@Martinspire
Copy link
Author

Martinspire commented Dec 7, 2017

@jgw96 The problem is that I'm not looking to mock backend, I'm looking to use data in my app itself.

Basically where you store data that you already retrieved but want to use multiple times in various locations of your app. I've found in the meantime you can use Providers for this, just make sure you are only import them in the app.module.ts file once and grab their instance by injecting it via the constructor

public myData;

constructor(public someDataProvider: SomeDataProvider) {
    // some logic
}

someFunction(){
    this.myData = someDataProvider.getMyData();
}

And then keep using that someDataProvider to store your data.

For this Super Template example, I would suggest after getting the User, to store this in a UserProvider and set some "haveLoggedIn" value. And another for skipping the login (which allows you to skip the welcome but not the login page). And if both are set, it should go to home page.

I'm fine with how the backend is working, but I would like it if there was some more going on with the result and the way a normal user interacts with a new user experience.

Also perhaps it might be wise to accept any user input to the backend and instead of doing some error handling, continue to the home page. Because now it doesn't really look like a demo unless you have a backend (because you cannot login). Providing some extra help to show that we're ignoring the API result, would make that clear enough.

Right now the current example doesn't really do well as a "fully featured" example. It requires too much work to get it going to get an idea of what can be achieved. For me it gave the impression that it was going to be a nice demo, but running into problems soon put an end to that. Now fixing them was not hard, but it should not be required to have a backend for a demo, even though it is pretty basic backend.

Alternatively, something I've done in the past, let it ask a simple JSON file that acts as the backend. It doesn't matter if it goes to localhost:8100/assets/login/response.json and accepts that as your "backend". It would still have it work like it should without having to use a local server

@marutifh
Copy link

I would like to add a point here, If this template uses Ionic native HTTP client & WKWebView then it will be too good as we are in a phase to migrate every application to have these.

@MInesGomes
Copy link

Is this starter working for iv4?
I get this ...

$ ionic start superApp super
✔ Preparing directory ./superApp - done!
⠋ Looking up starter
[ERROR] Unable to find starter template for super

    If this is not a typo, please make sure it is a valid starter template within the starters repo: 
    https://github.com/ionic-team/starters

@mhartington
Copy link
Member

Closing this as part of a repo clean up.

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

6 participants