GithubHelp home page GithubHelp logo

task-webapi-demo's Introduction

CNVS Demo Web API project.

The initial looze requirements are:

Tasks management WEB-API

  1. Create a simple web api to create and read Users and Tasks.
  2. Users are defined by unique Name.
  3. Tasks are defined by their Description and a State (Waiting, InProgress, Completed).
  4. When a Task is created, an User should be assigned to it automatically.
  5. Users can have multiple tasks, Task can only have one user.
  6. Every 2 minutes all tasks should be reassigned to another random user (it can't be the user which is already assigned to the task).
  7. When no users are available the Task will stay without assigned user.
  8. All task have to be transferred for exactly 3 times, after that, they should be considered completed and stay unassigned.
  9. No user interface is requirement for the assignment.

We purposely left requirements loose.

How to run

Command line

  1. Install .NET 7.0 SDK if you haven't already.
  2. Clone the repository.
  3. cd .\task-webapi-demo\
  4. cd .\Cnvs.Demo.TaskManagement.WebApi\
  5. Run dotnet run in the root directory of the project.
  6. Follow http://localhost:5188/swagger/index.html to see the API documentation and test the API.
  7. cd .\Cnvs.Demo.TaskManagement.WebApi.Curl\ powershell
  8. Run .\CreateXTasks.ps1 to run the curl script to test the API.
  9. Run .\CreateOneUser.ps1 to run the curl script to test the API.
  10. Run .\CreateThreeUsers.ps1 to run the curl script to test the API.
  11. The current implementation is using in-memory database. The data will be lost when the application is stopped.
  12. The current implementation is using a simple timer to reassign tasks. The timer will be stopped when the application is stopped.

Docker

  1. Install Docker if you haven't already.
  2. First, in your terminal, navigate to the directory containing the Dockerfile cd .\Cnvs.Demo.TaskManagement.WebApi\
  3. Run docker build -t task-webapi-demo . to build the image.
  4. Once the image is built, you can check it in the list of docker images: docker images
  5. Run docker run -p 8000:8000 task-webapi-demo to run the container.
  6. Follow http://localhost:5188/swagger/index.html to see the API documentation and test the API.
  7. Use PS scripts from .\Cnvs.Demo.TaskManagement.WebApi.Curl\Docker-curls

task-webapi-demo's People

Contributors

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