Home / Learn React / Project 7: Notes App with React, PHP and MySQL
Project 7: Notes App with React, PHP and MySQL
Build the full stack in one go: tables, API and the React screen, with search, pages, done checkbox and delete.
Theory in plain words
What it is
This project joins everything: SQL tables, the PHP API, and a React screen with search and pages.
Why we use it
Building one complete feature end to end is the best way to understand how the three layers fit together.
How it works
Use the files from the PHP lesson on the server. Put the React component below into src/App.jsx, replace the fake api() with the real helper, run the build and upload.
Where it is used
- A starter for any CRUD app: customers, orders, tasks, bookmarks
What you will build
- Add a note (POST)
- Mark done (PUT)
- Delete (DELETE)
- Search with debounce (GET ?q=)
- Pages of 5 (GET ?page=)
- Loading and error messages
Backend files
Use schema.sql, config.php, api/db.php, api/notes.php and api/.htaccess from the lesson Build the PHP + MySQL API with PDO. No change needed.
The React app (runs here with a fake server)
All state that the server owns (rows, total) comes from the answer. Local state only holds what the user is typing or the current page.
Go live checklist
- Import schema.sql in phpMyAdmin.
- Create config.php with the real credentials.
- Upload api/ and open notes.php in the browser. Expect JSON.
- Swap the fake api() for the real fetch helper.
- npm run build, upload dist contents.
- Add login (previous lesson) and filter every query by user_id.
- Backup the database.
Ideas to extend
- Edit a note title (PUT with a title)
- Tags with a second table and JOIN
- Sort by date or done
- Export notes to CSV from PHP
- Show created time with
Intl.DateTimeFormat
Quick quiz
1. Which parts hold the real data?
State is only a copy for drawing the screen.