136 lines
3.6 KiB
Markdown
136 lines
3.6 KiB
Markdown
|
|
## This project is a toy project for training and quality assurance purposes
|
||
|
|
|
||
|
|
# REACT NATIVE MOBILE TASK
|
||
|
|
|
||
|
|
### NOTE: USE EXPO
|
||
|
|
|
||
|
|
1. Initialize an app. Connect the app with splash screen and icon. Configure app to use any one of the custom font globally.
|
||
|
|
|
||
|
|
2. Implement authentication screens(login, signup, forgot password, validate password reset confirmation code and reset password) and connect to the REST API. Domain for this is https://reacttask.mkdlabs.com
|
||
|
|
|
||
|
|
- Do not use any UI library. Do form state management without any library.
|
||
|
|
|
||
|
|
- Login screen takes email and password. Do all the basic validation on client side and display proper error message if theres error from the API. Display the error message either in toast, custom dialog or native alert. API endpoint is https://reacttask.mkdlabs.com/v2/api/lambda/login. Request body are email, password. Look at the request below.
|
||
|
|
|
||
|
|
- Register screen takes email, password, first_name, last_name(and code for this VOYD app). Validation similar to Login screen should be applied. API endpoint is https://reacttask.mkdlabs.com/lambda/api/register. Call register api first for email, role and password. Then call https://reacttask.mkdlabs.com/v2/api/lambda/profile to save first_name and last_name and code.
|
||
|
|
|
||
|
|
- Forgot password screen should ask for email. Read the forgot api below.
|
||
|
|
|
||
|
|
- On validate reset password code make a 6 digit otp input field. Look at reset password below.
|
||
|
|
|
||
|
|
3. Create the Home screen
|
||
|
|
|
||
|
|
4. Implement the UI of dashboard and connect the drawer on the left side.
|
||
|
|
|
||
|
|
5. Persist the token that we receive after successfully authenticating using AsyncStorage. You can persist other data using Redux or make custom useContext, useReducer and AsyncStorage mechanism.
|
||
|
|
6. Make an additional screen with QR code scanner - it should be able to scan a QR code and and redirect to the page.
|
||
|
|
|
||
|
|
## Login
|
||
|
|
|
||
|
|
```
|
||
|
|
https://reacttask.mkdlabs.com/v2/api/lambda/login
|
||
|
|
Method POST
|
||
|
|
content-type application/json
|
||
|
|
x-project cmVhY3R0YXNrOjVmY2h4bjVtOGhibzZqY3hpcTN4ZGRvZm9kb2Fjc2t5ZQ==
|
||
|
|
body
|
||
|
|
{
|
||
|
|
"email": "adminreacttask@manaknight.com",
|
||
|
|
"password": "a123456",
|
||
|
|
"role": "admin"
|
||
|
|
}
|
||
|
|
Response
|
||
|
|
{
|
||
|
|
"error": false,
|
||
|
|
"role": "admin",
|
||
|
|
"token": "",
|
||
|
|
"expire_at": 3600,
|
||
|
|
"user_id": 1
|
||
|
|
}
|
||
|
|
```
|
||
|
|
|
||
|
|
## Register
|
||
|
|
|
||
|
|
```
|
||
|
|
https://reacttask.mkdlabs.com/v2/api/lambda/register
|
||
|
|
Method POST
|
||
|
|
content-type application/json
|
||
|
|
x-project cmVhY3R0YXNrOmQ5aGVkeWN5djZwN3p3OHhpMzR0OWJtdHNqc2lneTV0Nw==
|
||
|
|
body
|
||
|
|
{
|
||
|
|
"email": "member@manaknight.com",
|
||
|
|
"password": "a123456",
|
||
|
|
"role": "member",
|
||
|
|
"is_refresh": false
|
||
|
|
}
|
||
|
|
Response
|
||
|
|
{
|
||
|
|
"error": false,
|
||
|
|
"role": "admin",
|
||
|
|
"token": "",
|
||
|
|
"expire_at": 3600,
|
||
|
|
"user_id": 1
|
||
|
|
}
|
||
|
|
```
|
||
|
|
|
||
|
|
## Update Profile
|
||
|
|
|
||
|
|
```
|
||
|
|
https://reacttask.mkdlabs.com/v2/api/lambda/profile
|
||
|
|
Method POST
|
||
|
|
content-type application/json
|
||
|
|
Authorization Bearer <token>
|
||
|
|
x-project cmVhY3R0YXNrOjVmY2h4bjVtOGhibzZqY3hpcTN4ZGRvZm9kb2Fjc2t5ZQ==
|
||
|
|
body
|
||
|
|
{
|
||
|
|
"payload": {
|
||
|
|
"first_name": "<update>",
|
||
|
|
"last_name": "<update>"
|
||
|
|
}
|
||
|
|
}
|
||
|
|
Response
|
||
|
|
{
|
||
|
|
"error": false,
|
||
|
|
"message": "updated"
|
||
|
|
}
|
||
|
|
```
|
||
|
|
|
||
|
|
## Forgot Password
|
||
|
|
|
||
|
|
```
|
||
|
|
https://reacttask.mkdlabs.com/v2/api/lambda/forgot
|
||
|
|
Method POST
|
||
|
|
content-type application/json
|
||
|
|
x-project cmVhY3R0YXNrOjVmY2h4bjVtOGhibzZqY3hpcTN4ZGRvZm9kb2Fjc2t5ZQ==
|
||
|
|
body
|
||
|
|
{
|
||
|
|
"email": "<update>",
|
||
|
|
}
|
||
|
|
Response
|
||
|
|
{
|
||
|
|
"error": false,
|
||
|
|
"message": "message",
|
||
|
|
"code" : "<code>",
|
||
|
|
"token": "<token>"
|
||
|
|
}
|
||
|
|
```
|
||
|
|
|
||
|
|
## Reset Password
|
||
|
|
|
||
|
|
```
|
||
|
|
https://reacttask.mkdlabs.com/v2/api/lambda/reset
|
||
|
|
Method POST
|
||
|
|
content-type application/json
|
||
|
|
x-project cmVhY3R0YXNrOjVmY2h4bjVtOGhibzZqY3hpcTN4ZGRvZm9kb2Fjc2t5ZQ==
|
||
|
|
body
|
||
|
|
{
|
||
|
|
"token": "1181961E-45A2-479B-B43F-69C5817258B5-57D2-16489608",
|
||
|
|
"code": "368200",
|
||
|
|
"password": "a1234567"
|
||
|
|
}
|
||
|
|
Response
|
||
|
|
{
|
||
|
|
"error": false,
|
||
|
|
"message": "Reset Password"
|
||
|
|
}
|
||
|
|
```
|