A React 18 exercise for basic CRUD API functionality.
Originally written in 2022.
Note:
Original proprietary, now inactive endpoints replaced with dummyjson placeholder.
- Reusable, component-based structure:
App
,BlogList
,Modal
, and more for clear separation of concerns. - API logic separated:
All API calls are in their own module for easy maintenance. - Controlled forms:
Reliable form state management for add/edit post modal. - Basic error handling:
User-friendly messages for errors and empty states. - Mock API:
Uses a public mock API for demonstrationβno backend setup required.
src/
βββ App.js # Main application component
βββ BlogList.js # Renders the list of blog posts
βββ BlogListItem.js # Displays a single blog post
βββ Modal.js # Modal for add/edit post
βββ api-calls.js # API abstraction layer
βββ ...
- Install dependencies:
npm install
- Start the development server:
npm start
- Posts and changes are not persistentβthis is a frontend-only demo.
- Refresh to revert changes.
- No backend or authentication included.
Feel free to use this project as a starting point for more advanced features or as a demonstration of React 18 capabilities.