An open API service indexing awesome lists of open source software.

https://github.com/scottgriv/go-json_task_manager_api

This is a simple Task Manager API written in Go. The API provides basic CRUD (Create, Read, Update, Delete) functionality to manage tasks. Tasks are saved in a tasks.json file for persistence.
https://github.com/scottgriv/go-json_task_manager_api

api go json notes notes-app notes-application notes-taking-app notes-tool

Last synced: about 2 months ago
JSON representation

This is a simple Task Manager API written in Go. The API provides basic CRUD (Create, Read, Update, Delete) functionality to manage tasks. Tasks are saved in a tasks.json file for persistence.

Awesome Lists containing this project

README

        









Go Badge


GitHub Badge
Email Badge
BuyMeACoffee Badge


Bronze

---------------

Go JSON Task Manager API

This is a simple Task Manager API written in Go. The API provides basic CRUD (Create, Read, Update, Delete) functionality to manage tasks. Tasks are saved in a tasks.json file for persistence.

---------------

## Table of Contents

- [Getting Started](#getting-started)
- [Installation](#installation)
- [Usage](#usage)
- [Testing](#testing)
- [What's Inside?](#whats-inside)
- [Resources](#resources)
- [License](#license)
- [Credits](#credits)

## Getting Started

### Installation

1. Clone the Repository:

```bash
git clone https://github.com/scottgriv/go-json_task_manager_api
```

2. Change to the Directory:

```bash
cd go-json-task-manager-api
```

3. Run the Server:
```bash
go run .
```
4. The server should now be running on http://localhost:8080.

### Usage

```GET /tasks: Retrieve a list of all Tasks.```

Response:
```json
[
{ "id": 1, "name": "Sample Task" },
{ "id": 2, "name": "Modified Task" }
]

```

```POST /task/create: Create a new Task.```

Body:
```json
{
"name": "Your Task Name"
}
```

```DELETE /task/delete: Delete a Task by its ID.```

Body:
```json
{
"id": 1
}
```

```PUT /task/update: Update an existing Task by its ID or create a new one if it doesn't exist.```

Body:
```json
{
"id": 1,
"name": "Updated Task Name"
}
```

```PATCH /task/modify: Update specific fields of an existing Task by its ID.```

Body:
```json
{
"id": 1,
"name": "Modified Task Name"
}
```

### Testing

Use a tool like [Postman](https://www.postman.com/) or [curl](https://curl.se/) to send requests to the server and test each endpoint. You can also import the included Postman collection in the [api](api) directory to get started.

## What's Inside?

```bash
go-json_task_manager_api/ # Root directory
├── main.go # Entry point
├── router.go # Routes
├── handlers.go # Request handlers
├── tasks.go # Task model
├── postman/ # Postman collection
│ └── go-json_task_manager_api.postman_collection.json # Import this file into Postman
├── sample/ # Sample data
│ └── tasks_sample_output.json # Sample output from GET /tasks
├── tasks.json # Tasks data file
├── .gitignore # git ignore file
├── LICENSE # License file
└── README.md # This file
```

## Resources

- [Go](https://golang.org/)
- [Go Documentation](https://golang.org/doc/)
- [Go by Example](https://gobyexample.com/)
- [Go Tutorial](https://www.golangtutorial.dev/)

## License

This project is released under the terms of **The Unlicense**, which allows you to use, modify, and distribute the code as you see fit.
- [The Unlicense](https://choosealicense.com/licenses/unlicense/) removes traditional copyright restrictions, giving you the freedom to use the code in any way you choose.
- For more details, see the [LICENSE](LICENSE) file in this repository.

## Credits

**Author:** [Scott Grivner](https://github.com/scottgriv)

**Email:** [[email protected]](mailto:[email protected])

**Website:** [scottgrivner.dev](https://www.scottgrivner.dev)

**Reference:** [Main Branch](https://github.com/scottgriv/go-json_task_manager_api)

---------------