This starter template provides a simple login and registration system using Angular and a fake API from https://reqres.in. The fake API allows you to test the functionality of the login and registration system without the need for a real API.
To get started with this template, follow these steps:
git clone https://github.com/blaiseAI/ionic-starter-with-login-signup.git
npm install
ng serve
- Navigate to http://localhost:8100/ in your browser to see the login and registration pages.
This starter template includes the following features:
- Login and registration using fake API from https://reqres.in
- JWT token authentication
- Using Capacitor preferences to store JWT securely
- Guarded routes to protect unauthorized access
- Onboarding intro slider for first-time users
- Automatic login with saved JWT token
- Email & Password validation for signup form
- Responsive design with Ionic components
- Routing to navigate between login, registration, and protected pages.
This starter template uses the following technologies:
- Ionic Framework
- Angular
- RxJS
- TypeScript
- Fake API from https://reqres.in
The login functionality is implemented using the /api/login endpoint from the Reqres API. To log in, use the following credentials:
Email: eve.holt@reqres.in
Password: cityslicka
The signup functionality is implemented using the /api/register endpoint from the Reqres API. To sign up, use any valid email address and a password of your choice.
Endpoint: /api/login
Request:
{
"email": "eve.holt@reqres.in",
"password": "cityslicka"
}
Response:
{
"token": "QpwL5tke4Pnpja7X4"
}
Endpoint: /api/register
Request:
{
"email": "john.doe@example.com",
"password": "password"
}
Response:
{
"id": 4,
"token": "QpwL5tke4Pnpja7X4"
}
Once you have explored the functionality of this starter template and are ready to move on to building your own application, there are several next steps you can take:
- Add own Authentication API
- Replace the fake API from reqres.in with your own custom backend API in the
AuthenticationService
- Replace the fake API from reqres.in with your own custom backend API in the
- Add additional ionic pages
Note: The credentials used in the example requests for the fake API from reqres.in are pre-defined and hardcoded, and therefore not validated in any way. This is because reqres.in is a mock API used for testing and development purposes, and is not intended for production use. In a real-world application, user credentials would need to be validated on both the client-side and server-side to ensure the security of user data.
Contributions are welcome! To contribute, simply fork this repository, make your changes, and submit a pull request.
This starter template is licensed under the MIT license.