Coder Social home page Coder Social logo

mohitkumarsahni / todo-api Goto Github PK

View Code? Open in Web Editor NEW
4.0 1.0 13.0 44 KB

An API for creating and managing tasks.

License: MIT License

Java 99.42% Dockerfile 0.58%
api springboot springboot-rest-api to-do-rest-api maven-project openapi3 example-project

todo-api's Introduction

ToDo-API

An API for creating and managing tasks.

The API can perform following operations:

  • Create a new task-list.
  • Update a task-list.
  • Fetch a task-list.
  • Delete a task-list.
  • Create a new task in a task-list.
  • Update a task in a task-list.
  • Fetch a task.
  • Fetch all tasks in a task-list.
  • Delete a task in a task-list.

Please see the openapi contract 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

Install & Setup Database

  • This application requires MySQL 8.
  • Please refer to the following link to download and install MySQL-8: MySQL-8
  • To create database and user you can run following script: 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

  • 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=<DB_HOST>" -e "DB_PORT=<DB_PORT>" -e "DB_NAME=<DB_NAME>" -e "DB_USERNAME=<DB_USERNAME>" -e "DB_PASSWORD=<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

todo-api's People

Contributors

mohitkumarsahni avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.