Welcome to the React Advanced practice repository! This module takes your React skills to the next level - you'll learn to fetch real data from APIs, build multi-page applications, and implement secure authentication with a Python backend.
Real applications don't live in isolation. They fetch data from servers, navigate between pages, and protect content behind login screens. In this module, you'll master side effects with useEffect, integrate third-party APIs, build client-side routing, and implement full JWT authentication with Flask.
| Topic | Description |
|---|---|
| useEffect & Side Effects | Timers, event listeners, cleanup, and the component lifecycle |
| API Integration | Fetching real data from Weather API and JSONPlaceholder |
| Client-Side Routing | Hash-based navigation for multi-page React applications |
| JWT Authentication | Login, register, protected routes with Flask backend |
| Full Project Architecture | Combining all concepts in a production-style Expense Tracker |
repo/
├── advance-1/ ⭐ useEffect & Side Effects
│ ├── index.html
│ ├── script.js
│ └── README.md
│
├── advance-2/ ⭐⭐ Fetching Data from APIs
│ ├── index.html
│ ├── script.js
│ └── README.md
│
├── advance-3/ ⭐⭐⭐ React Router & Navigation
│ ├── index.html
│ ├── script.js
│ └── README.md
│
├── advance-4/ ⭐⭐⭐⭐ Authentication (React + Flask)
│ ├── README.md
│ ├── backend/
│ │ ├── app.py
│ │ └── requirements.txt
│ └── frontend/
│ ├── index.html
│ └── script.js
│
├── advance-5/ ⭐⭐⭐⭐⭐ Final Project (Expense Tracker)
│ ├── index.html
│ ├── style.css
│ ├── script.js
│ └── README.md
│
└── README.md 📖 This file
- Completed the React Basics course (or equivalent knowledge)
- Understanding of components, props, state, events, and forms
- A modern web browser (Chrome, Firefox, Edge)
- A code editor (VS Code recommended)
- For Advance-4: Python 3.8+ installed
- Clone or download this repository to your computer
- Start with Advance 1 - open the
advance-1folder - Open
index.htmlin your browser to see the working examples - Open
script.jsin your code editor to study the code (reference copy) - Progress sequentially - each module builds on the previous
- For Advance 4 - set up the Flask backend (see below)
- Finish with Advance 5 - the final project combining everything
- Navigate to the module folder (e.g.,
advance-1/) - Double-click
index.htmlto open it in your browser (Chrome, Firefox, or Edge) - The page loads with working examples - interact with them
- Open
script.jsin your code editor (VS Code recommended) to study the code - The working code runs inline inside
index.html—script.jsis a reference copy - To complete exercises, edit the
<script>block insideindex.html, then save (Ctrl+S) - Refresh the browser (Ctrl+R or Cmd+R) to see your changes
- Open Developer Tools (F12) > Console tab to check for errors
No installation required for these modules. React loads automatically from the internet via CDN.
Step 1: Set up the backend (one-time setup)
cd advance-4/backend
python -m venv venv
venv\Scripts\activate # Windows
# source venv/bin/activate # Mac/Linux
pip install -r requirements.txtStep 2: Start the Flask server
python app.pyYou should see: Server running on http://localhost:5000
Step 3: Open the frontend
- Open
advance-4/frontend/index.htmlin your browser - The frontend communicates with the Flask server running on port 5000
Step 4: Test it
- Register a new user, then login
- Open the Console (F12) to see the JWT token
- Access the protected Dashboard
Important: The Flask server must be running while you use the frontend. If you close the terminal, the server stops.
Difficulty: Intermediate
Master React's useEffect hook for side effects:
- Dependency arrays (empty, with values, no array)
- Cleanup functions for timers and listeners
- Document title updates
- Debouncing patterns
Difficulty: Intermediate+
Fetch and display real data from third-party APIs:
fetch()insideuseEffect- Loading and error state patterns
- Open-Meteo Weather API (free, no key)
- JSONPlaceholder for mock data
Difficulty: Advanced
Build multi-page React applications:
- Hash-based routing (
#/page) - URL parameters
- Active link highlighting
- Navigation guards
Difficulty: Advanced+
Build a complete login and registration system:
- Flask backend with SQLite
- Password hashing with Bcrypt
- JWT token generation and verification
- Protected routes and dashboard
Difficulty: Expert
Build a complete Expense Tracker combining all concepts:
- CRUD operations with localStorage
- Category filtering and sorting
- Dashboard with spending breakdown
- Hash-based routing for navigation
- Simulated authentication
| API | URL | Used In |
|---|---|---|
| JSONPlaceholder | https://jsonplaceholder.typicode.com | Advance 2 |
| Open-Meteo Weather | https://api.open-meteo.com/v1/forecast | Advance 2 |
| Open-Meteo Geocoding | https://geocoding-api.open-meteo.com/v1/search | Advance 2 |
| Component | Technology |
|---|---|
| Frontend | React 18 (CDN) |
| Backend (Advance-4) | Python Flask |
| Database (Advance-4) | SQLite |
| Password Hashing | Bcrypt |
| Authentication | JWT (JSON Web Tokens) |
- Complete React Basics first - this course assumes that knowledge
- Check the Network tab - inspect API requests and responses in DevTools
- Use console.log() - debug data flow and state changes
- Handle errors - always add loading and error states for API calls
- Clean up effects - always return cleanup functions from useEffect
| Problem | Solution |
|---|---|
| API data not loading | Check browser console for errors, verify URL is correct |
| useEffect runs infinitely | Check dependency array - missing [] causes infinite loops |
| CORS error | Ensure Flask-CORS is installed and configured |
| Flask server won't start | Activate virtual environment first, check requirements installed |
| Token expired | Login again to get a new JWT token |
| Changes don't show | Save the file and refresh browser |
- Advance 1: useEffect & Side Effects
- Advance 2: Fetching Data from APIs
- Advance 3: React Router & Navigation
- Advance 4: Authentication (React + Flask)
- Advance 5: Expense Tracker (Final Project)
Happy Coding!
Remember: Every real-world app needs data, navigation, and security. You're building those skills right now!