Personal Task Manager API
- Simple Task Manager API is a Node.js-based API designed to manage personal tasks with CRUD(Create, Read, Update, Delete) functionality. This API stores tasks in a JSON file and includes optional image upload support for each task. The server uses the native HTTP module, with routes configured based on request type and URL.
- Retrieve All Tasks: Fetch all tasks stored in the JSON file.
- Create a New Task: Add tasks with title, description, status (default is "pending"), and optional image upload.
- Update an Existing Task: Modify task details such as title, description, status, and image.
- Delete a Task: Remove a task by its unique ID.
- Static File Serving: Serves a main HTML page located at the root URL.
Task-API/
│
├── controllers/
│ └── tasksController.js # Handles CRUD operations
├── data/
│ └── tasks.json.js # JSON file for storing tasks
├── routes/
│ └── taskRoutes.js # Routes for task endpoints
├── utils
│ └── fileHandler.js # Utility to handle reading/writing tasks
├── uploads/ # Folder for uploaded images
│
├── views/ # Folder for HTML views
│
├── app.js # main server files
│
├── package.json # projct metadata and dependensies
│
└── README.md # Project documentation
- Node.js installed on your system.
- Clone the repository: git clone https://github.com/Abdizalan/TASKFY.git
- Navigate to the project directory: cd TASKFY
- Install the dependencies: npm install
Start the server by running: node app.js The server will run on port 9000. You can access it at http://localhost:9000.
- GET /tasks - Retrieve all tasks
- POST /tasks - Create a new task with optional image upload
- title (string) - Title of the task
- description (string) - Description of the task
- status (string, optional) - Task status (default: "pending")
- image (file, optional) - Image file for the task
- PUT /tasks/
- Update an existing task
- title (string) - New title
- description (string) - New description
- status (string) - Updated status
- image (file) - New image file for the task
- DELETE /tasks/
- Delete a specific task
License
- This project is licensed under the MIT License.