https://github.com/arnobt78/task-management-server--react-fundamental-project-15
This is a simple task management server built with Express.js (using for running React Query Task Manager - React Fundamental Project 15) . It provides a RESTful API to manage tasks, including creating, updating, and deleting tasks.
https://github.com/arnobt78/task-management-server--react-fundamental-project-15
axios axios-react backend backend-api crud-api crud-application crud-operation expressjs nodejs react reactjs restful-api server server-side-rendering task-management
Last synced: about 1 month ago
JSON representation
This is a simple task management server built with Express.js (using for running React Query Task Manager - React Fundamental Project 15) . It provides a RESTful API to manage tasks, including creating, updating, and deleting tasks.
- Host: GitHub
- URL: https://github.com/arnobt78/task-management-server--react-fundamental-project-15
- Owner: arnobt78
- Created: 2025-02-10T08:45:39.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2025-02-10T09:31:19.000Z (3 months ago)
- Last Synced: 2025-04-05T09:15:18.311Z (about 1 month ago)
- Topics: axios, axios-react, backend, backend-api, crud-api, crud-application, crud-operation, expressjs, nodejs, react, reactjs, restful-api, server, server-side-rendering, task-management
- Language: JavaScript
- Homepage: https://task-management-server-nyfr.onrender.com
- Size: 20.5 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Task Management Server - React Fundamental Project 15
This is a simple task management server built with Express.j (using for running React Query Task Manager - React Fundamental Project 15) . It provides a RESTful API to manage tasks, including creating, updating, and deleting tasks.
**Backend Online Live:** https://task-management-server-nyfr.onrender.com
**Frontend Online Live:** https://react-query-task-manager-arnob.netlify.app/
**Front-End Source Code:** https://github.com/arnobt78/React-Query-Task-Manager--React-Fundamental-Project-15
## Project Structure
```
.
├── localDataServer.js
├── package.json
├── server.js
└── tasks.json
```- `localDataServer.js`: Main server file using for Local Storage Server that handles API requests. (Alternative Approach)
- `package.json`: Contains project metadata and dependencies.
- `server.js`: Entry point for the server (Not using Local Storage).
- `tasks.json`: JSON file to store tasks data.## Installation
1. Clone the repository.
2. Navigate to the project directory.
3. Install the dependencies:```sh
npm install
```## Running the Server
To start the server, run:
```sh
npm start
```To start the local data server, run:
```sh
npm run local-server
```## API Endpoints
### GET /
Returns a welcome message.
**Response:**
```html
Hello From Server...
```### GET /api/tasks
Returns the list of tasks.
**Response:**
```json
{
"taskList": [
{
"id": "unique-task-id",
"title": "Task title",
"isDone": false
}
]
}
```### POST /api/tasks
Creates a new task.
**Request Body:**
```json
{
"title": "Task title"
}
```**Response:**
```json
{
"task": {
"id": "unique-task-id",
"title": "Task title",
"isDone": false
}
}
```### PATCH /api/tasks/:id
Updates the status of a task.
**Request Parameters:**
- `id`: The ID of the task to update.
**Request Body:**
```json
{
"isDone": true
}
```**Response:**
```json
{
"msg": "task updated"
}
```### DELETE /api/tasks/:id
Deletes a task.
**Request Parameters:**
- `id`: The ID of the task to delete.
**Response:**
```json
{
"msg": "task removed"
}
```## Middleware
- `cors`: Enables Cross-Origin Resource Sharing.
- `morgan`: HTTP request logger middleware for Node.js.
- `express.json()`: Parses incoming requests with JSON payloads.## Error Handling
If a route does not exist, the server responds with a 404 status code and a message:
```text
Route does not exist
```## Environment Variables
- `PORT`: The port on which the server will listen (default is 5000).