https://github.com/mohitkumarsahni/todo-api
An API for creating and managing tasks.
https://github.com/mohitkumarsahni/todo-api
api example-project maven-project openapi3 springboot springboot-rest-api to-do-rest-api
Last synced: 5 days ago
JSON representation
An API for creating and managing tasks.
- Host: GitHub
- URL: https://github.com/mohitkumarsahni/todo-api
- Owner: mohitkumarsahni
- License: mit
- Created: 2022-12-22T16:43:37.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-01-08T23:55:42.000Z (over 2 years ago)
- Last Synced: 2025-03-29T06:33:12.252Z (25 days ago)
- Topics: api, example-project, maven-project, openapi3, springboot, springboot-rest-api, to-do-rest-api
- Language: Java
- Homepage:
- Size: 43 KB
- Stars: 4
- Watchers: 1
- Forks: 13
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: docs/CODEOWNERS
Awesome Lists containing this project
README
## ToDo-API
An API for creating and managing tasks.### The API can perform following operations:
- [x] Create a new task-list.
- [x] Update a task-list.
- [x] Fetch a task-list.
- [x] Delete a task-list.
- [x] Create a new task in a task-list.
- [x] Update a task in a task-list.
- [x] Fetch a task.
- [x] Fetch all tasks in a task-list.
- [x] Delete a task in a task-list.Please see the [openapi contract](./docs/api-contract.yaml) for API endpoints and details.
### Prerequisites
#### Install Java 11
- This application requires Java 11.
- Please refer to the following link to download and install Java-11: [Java-11](https://www.oracle.com/in/java/technologies/javase/jdk11-archive-downloads.html)#### Install & Setup Database
- This application requires MySQL 8.
- Please refer to the following link to download and install MySQL-8: [MySQL-8](https://dev.mysql.com/doc/refman/8.0/en/installing.html)
- To create database and user you can run following script: [db_setup.sql](./docs/database/db_setup.sql)### Running the application
- Clone the repository.
- Open the project in IntelliJ IDEA or any suitable IDE of your choice.
- Add following environment variables in configurations:
- DB_HOST
- DB_NAME
- DB_PASSWORD
- DB_PORT
- DB_USERNAME
- In IntelliJ IDEA, environment variables can be added from Run -> Edit Configurations -> Environment Variables
- Run the project.### Build & run with Docker on Ubuntu
- Install Docker from: [Docker](https://docs.docker.com/engine/install/ubuntu/)
- In terminal switch to project directory.
- Use following command: `docker build -t todo-api:1.0.0 .`
- Above command will build the image.
- Now run the following command:`sudo docker run todo-api:1.0.0 -e "DB_HOST=" -e "DB_PORT=" -e "DB_NAME=" -e "DB_USERNAME=" -e "DB_PASSWORD=" -p 8080:8080 -d `
- Change the actual variable value in angle brackets.
- It will spin up a container which can be accessed on `http://localhost:8080/`### Pending Work
- Unit Testing
- How to deploy with docker on ubuntu
- How to deploy with Azure Web App Service
- Authorization & Authentication