IF you finished reading this article, please read how we create branch and how commit message on git
Todo List
- Create demo API
- Create login route
- Create register route
- Create create-post route
- Create get-posts route
- Create get-post by id route
- Create update post route
- Create delete post route
- Encrypt and Decrypt all request and response
- Create demo mobile app
- From handling with react-hook-form with zod
- Fetching / mutation api data with react-query
- Mutation
- Login user (auto save user token on success and navigate to home screen)
- Register user (same logic like login)
- Create post (auto add new post to posts queries)
- Update post (auto update post from posts queries)
- Delete post (auto delete post from posts queries)
- Query
- Fetch all posts with Infinite Queries (auto fetch next paginate posts on scroll end and fetch new post on refresh control/ user refresh screen)
- Mutation
- FlatList optimization with FlashList
- Integration Redux/toolkit state management
- Add encrypt / decrypt on server and mobile
- Add Push notification with firebase
- Add map service
Installation and setup environment
- Must be
React nativedeveloper - Must have
Docker(to run PostgresSQL database)
If you don't have or not installed
Docker, no problem at ACE office because we can share server on local network
Make sure your docker is running in background and open terminal
# first run server and db
git clone git@github.com:minkgkyaw9899/demo_app_frame.git
cd demo_app_frame/server
npm install
cp .env.example .env
docker compose up -d
npm run dev
# second run and build app on debug mod
cd mobile
npm install
cp .env.example .env
# update API_URL *
npm start
# happy coding....API_URL - api base url can depend on your server host address
- login user
POST - /users/login
{
"email": "string@mail.com",
"password": "string"
}- register user
POST - /users/register
{
"name": "string",
"email": "string@mail.com",
"password": "string"
}- get all posts
GET - /posts
With pagination
GET -
/posts?pages=2
- get post by id
GET - /posts/:id
- update post by id
PATCH - /posts/:id
{
"title": "string",
"body": "string"
}- delete post by id
DELETE - /posts/:id