Build a full-stack application using React for the frontend and Express for the backend. This exercise focuses on creating, reading, updating, and deleting (CRUD) a specific resource via a RESTful API and interfacing with this API using a React application.
- Fields:
id
(number): Unique identifier for the task.title
(string): Title of the task.description
(string): A brief description of the task.status
(string): Current status of the task (e.g., "pending", "completed").
- GET
/tasks
: Retrieves a list of all tasks. - POST
/tasks
: Creates a new task. Expectstitle
,description
, andstatus
in the request body. - GET
/tasks/:id
: Retrieves a single task by itsid
. - PUT
/tasks/:id
: Updates the task identified byid
. Can updatetitle
,description
, and/orstatus
. - DELETE
/tasks/:id
: Deletes the task identified byid
.
- Displays all tasks in a list or table format.
- Each list item should have buttons or links to view its details, edit it, or delete it.
- Shows detailed information about a single task.
- Should be displayed when a user clicks to view more details about a task from the
TaskList
.
- Used for both creating a new task and editing an existing one.
- Should include form fields for
title
,description
, andstatus
. - Determine whether it's in "edit" mode or "create" mode based on the presence of an existing task
id
.
- Fork the provided repository to create a copy in your GitHub account.
- Clone your fork to your local machine for development.
- Inside the
backend
directory, initialize your project and install necessary packages (express
, etc.). - Implement the specified API endpoints, ensuring data is stored and managed in memory.
- Use
create-react-app
in thefrontend
directory to bootstrap your React application. - Develop the specified UI components, ensuring they interact with the backend API to perform CRUD operations.
- Test the backend independently using tools like Postman.
- Test the frontend by running the React development server and interacting with the UI.
- Push your completed project to your forked repository on GitHub.
- Submit a pull request to the original repository for review, including any setup and run instructions in your PR description.
- Ensure proper error handling in both the backend API and frontend components.
- Use state management effectively in your React components to reflect changes in the UI.
- Adhere to RESTful principles in your backend API design for clarity and maintenance.