Giter Club home page Giter Club logo

cardinity-task-manager-api's Introduction

Cardinity-Task-Manager-API

A Sample Rest API Project for Cardinity Evaluation Test

LinkedIn

About Project

This is a sample REST API Service Cardinity Evaluation Test, has been developed in spring-boot. It contains spring-security jwt-token role-base-authentication jpa-hibernate

Quick Lookup

Check all the endpoints from Swagger

http://localhost:8080/api/v1/swagger-ui.html

  • NOTE There are some additional endpoints which might be used for further usage.

Built With

REST Clients

Since this is a REST API Service, We need an external REST Client to Test the API endpoints

Rest Client Config

Install Project

  • Open the pom.xml as a Maven Project in your IDE
  • Run the command bellow in your Terminal
mvn clean install
  • Configure DB
db.url=jdbc:mysql://localhost:3306/<DB_NAME>
db.username=<DB_USERNAME>
db.password=<DB_PASSWORD>

User Roles

Cardinity Users can have bellow Roles

  • USER
  • ADMIN

Status

We have bellow status for the Tasks and Projects

  • Open
  • In Progress
  • Closed

Execution

  • Run the application by executing CardinityTaskManagerRestApiApplication.java
  • Import the Postman Collection to test the API endpoints

Authentication

{
    "username": "dummy_user",
    "password": "user"
}
  • You will get a JWT TOKEN in Success Response which is actually a Bearer token.
  • Token format Bearer {{AuthenticationToken}}
  • After that, You will use this Token in Authorization Header of each request.

Endpoints

Each of the endpoints will require this Header bellow to authenticate the USER

Authorization: Bearer {{AuthenticationToken}}

Project

  • Create Project

    • Method POST
    • URL /project/create
    • Request Body
      {
          "name": "Cardinity REST API Project",
          "description": "Sample project for test",
          "status": "open",
          "assignedTo": "dummy_user"
      }
  • Get All Projects

  • Delete Project by ID

Task

  • Create Task

    • Method POST
    • URL /task/create
    • Request Body
      {
          "name": "Spring Security Integration",
          "description": "Spring Security Integration",
          "status": "open",
          "expiryHour": 8,
          "assignedTo":"dummy_user",
          "projectId": 1
      }
  • Edit Task

    • Method POST
    • URL /task/update
    • Request Body
      {
          "taskId": 1,
          "name": "Spring Security Integration",
          "description": "Spring Security Integration",
          "status": "in progress",
          "expiryHour": 16,
          "assignedTo":"",
          "projectId": 1
      }
  • GET Tasks OWN USER TASK

  • GET All Tasks by Project

  • GET ALL Expired Tasks

  • GET ALL Tasks by Status

Admin Endpoints

Only users with ADMIN Role can access these endpoints

Configuration (Optional)

  • Server Port Configuration
server.port=8080
  • We already have a StartupLoader to populate the Dummy Users and Roles. Username and Password in the application.property file
dummy.admin.username=dummy_admin
dummy.user.username=dummy_user
dummy.user2.username=dummy_user2

dummy.admin.password.common=admin
dummy.user.password.common=user
  • Toggle Hibernate DDL Auto Generation by create or update
hibernate.hbm2ddl.auto=create
  • Configure Token Expiry minute by changing
jwt.token.expirey.minute=30

Contact

Dipanjal Maitra @linkedin - [email protected]

cardinity-task-manager-api's People

Contributors

dipanjal 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.