Skip to content

Ethereum-Jakarta/phase-2-week4-state-and-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🏰 Phase 2 β€” Week 4: State Management & API Integration

"The week that connects everything."

Minggu ini kalian belajar menghubungkan React frontend ke backend API, manage state dengan proper, handle authentication, dan prepare for production deployment.


πŸ“‹ Prerequisites

Sebelum mulai Week 4, pastikan kalian udah paham:

  • βœ… Week 1: React basics, JSX, components, props
  • βœ… Week 2: Hooks (useState, useEffect, useRef), React Router
  • βœ… Week 3: Advanced hooks, custom hooks, performance optimization
  • βœ… Phase 1: Express API, JWT authentication, database CRUD

πŸ“š Study Materials

Pelajari secara berurutan β€” setiap materi build on top of the previous one.

Day 1-2: State Management

# Materi Topik Durasi
01 The State Spectrum Dari useState sampe server state, lifting state, prop drilling 45 min
02 Zustand Fundamentals State management yang gak bikin pusing, store creation 60 min
03 Zustand Advanced Production-grade patterns, middleware, selectors 60 min

Day 2-3: API Integration

# Materi Topik Durasi
04 Data Fetching Patterns Kenapa useEffect + fetch itu bencana, proper patterns 45 min
05 Axios Service Layer Arsitektur API yang bener, interceptors, error handling 45 min
06 React Query CRUD useQuery, useMutation, queryKey, caching 75 min
07 React Query Advanced Dashboard dengan multiple data sources, optimistic updates 60 min

Day 3-4: Authentication

# Materi Topik Durasi
08 Auth JWT Complete Dari register sampe auto-logout, token rotation 60 min
09 Protected Routes Role-based access control, route guards, auth context 45 min
10 Error Handling & UX Bikin app yang gak malu-maluin pas error 60 min

Day 4-5: Advanced Topics

# Materi Topik Durasi
11 Environment Variables & Deploy Prep Vite env vars, CORS, proxy, production checklist 45 min
12 WebSocket β€” Real-time WebSocket basics, Socket.IO in React, real-time patterns 60 min
13 Testing API Integration MSW, testing React Query hooks, testing auth flows 75 min
14 Soft Skill: API Documentation Swagger/OpenAPI, Postman, HTTP status codes, rate limiting 45 min
15 Week 4 Recap Decision trees, checklists, top mistakes, Week 5 prep 30 min

βš”οΈ Arcane Quests

# Quest Type Difficulty
01 Arcane Bridge β€” Connect to Phase 1 API MANDATORY ⭐⭐⭐
02 Arcane Command Center β€” Real-time Dashboard Optional ⭐⭐⭐⭐
03 Arcane Scroll β€” Social Feed Optional ⭐⭐⭐⭐
04 Arcane Task Guild β€” Group Project Group (3-4) ⭐⭐⭐⭐⭐
05 Ujian Week 4 Exam ⭐⭐⭐

AQ-01 is MANDATORY. Ini bridge antara Phase 1 dan Phase 2. Semua orang HARUS submit.


🧩 Quizzes

Practice challenges buat tiap major topic:

Quiz Topic Challenges
Quiz: State Management Zustand, Context, state patterns 8 challenges
Quiz: API Integration React Query, Axios, data fetching 6 challenges
Quiz: Authentication JWT, protected routes, token handling 5 challenges

πŸ—“οΈ Suggested Schedule

Day 1 (Mon):  Materi 01-03 β†’ Quiz State (partial)
Day 2 (Tue):  Materi 04-06 β†’ Start AQ-01
Day 3 (Wed):  Materi 07-09 β†’ Quiz API + Quiz Auth
Day 4 (Thu):  Materi 10-12 β†’ Continue AQ-01
Day 5 (Fri):  Materi 13-15 β†’ Finish AQ-01 β†’ Ujian

πŸ› οΈ Tech Stack This Week

Category Tools
State Management useState, Context API, Zustand
Server State TanStack React Query v5
HTTP Client Axios
Forms React Hook Form + Zod
Real-time Socket.IO Client
Testing Vitest + React Testing Library + MSW
Deployment Vercel (FE) + Railway (BE)

🎯 Learning Outcomes

By the end of this week, kalian bisa:

  1. Choose the right state management solution for any scenario
  2. Connect a React frontend to a REST API
  3. Implement JWT authentication with protected routes
  4. Handle loading, error, and empty states professionally
  5. Write tests for API integrations
  6. Deploy a fullstack application to production
  7. Read API documentation and use professional tools

πŸ“– Additional Resources



Cara Pengerjaan & Submit Tugas

Kalian udah pernah ngerjain flow ini di Phase 0-1, jadi harusnya udah familiar. Tapi gua tulis lagi biar gak ada yang bingung.

Kalian akan melakukan Fork & PR ulang untuk setiap week karena ETHJKT memisahkan 1 Repo = 1 Week.

Flow Pengerjaan

  1. Fork repo ini ke GitHub account kalian
  2. Clone fork kalian ke local
  3. Kerjain study materials, quizzes, dan arcane quests
  4. Commit progress kalian (wajib push minimal 1 commit per hari!)
  5. Push ke fork kalian
  6. Create Pull Request ke repo ETHJKT ini
  7. Mentor akan review lewat PR comments
  8. Untuk pengerjaan selanjutnya, tinggal commit & push aja β€” PR otomatis ke-update

Rules Submission

  • πŸ“ Isi judul PR dengan username/nama kalian
  • πŸ“… Wajib push minimal 1 commit per hari
  • 🧹 Code harus clean, typed (TypeScript), dan well-commented
  • πŸ“¬ Semua submission via Pull Request
  • πŸš€ Deploy setiap Arcane Quest ke Vercel

Next Week: Week 5 β€” Capstone Project πŸš€

About

Phase 2 Week 4 β€” State Management + API Integration πŸ§™β€β™‚οΈ

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors