Giter Club home page Giter Club logo

ionic-with-login-signup's Introduction

Ionic starter with login and registration

This Ionic app contains the user login, signup and an additional route called articles which can only be accessed if you are logged into the app.

Installation

npm install

Change the URL of your backend inside file src/app/services/api.service.ts. The bankend of this app was created in rails, you can access the backend code here. But you should be able to use this app with any backend with little bit of tweeks.

ionic serve

App Structure

Pages

  • All pages in this app are inside directory src/app/pages.

  • Pages folder contains 3 folders, articles, authentication, home. Rather than creating every page in a single directory I like to create them modular so they are easy to work with in my opinion.

  • As you would have guessed by name home is the landing page of the app, authentication contains pages related to login and sign up and articles contains pages related to displaying the list of articles and individual articles which I will be adding soon.

Services

  • All services live inside directory src/app/services.

  • Service alert.service, constains the code to display the alerts, rather than using the same code over and over again at different places, this is a DRY approach to keep alert in one service and call it where required.

  • Service api.service, communicates with the backend and sends the response back to the page, this service also contacts the URL that you can use to assign your backend api url.

  • Service auth-guard.service, this service is responsible to grant access to the pages which only logged in user can access.

  • Service auth-interceptor.service, this service intercepts the http request and appends the authenticaton token to it so the backend can use this token for authentication.

  • Service authentication.service, this service can be used to pull the user object that is saved in local storage. This service also stores the user object in local storage when someone login or register.

ionic-with-login-signup's People

Contributors

classicvalues avatar shairyar avatar dependabot[bot] avatar imgbotapp avatar mend-bolt-for-github[bot] avatar

Stargazers

 avatar

Watchers

 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.