Skip to content

workflow representation using TS and Mongodb. the site shares one DB so unexpected behavior could occur with multiple user online.

License

Notifications You must be signed in to change notification settings

NoamRivlin/statuses_transitions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Screenshots and videos

image

Untitled.mov

Link to the deployed Site

Link to the Excalidraw planning board Link

Brief description of the project

Table of Contents

  1. Introduction
  2. Installation
  3. Endpoints
  4. Usage
  5. Contributing
  6. License

Introduction

Provide a brief introduction to your project. Mention the purpose, goals, and any important background information.

Installation

To run this project locally, follow these steps:

  1. Clone the repository:
git clone <repository-url>
cd <project-directory>
  1. Install the dependencies:
npm install
  1. Create a .env file in the server root directory and set the required environment variables:
PORT=<port-number>
MONGO_URI=<mongodb-connection-string>
  1. Start the server:
npm start

Endpoints

The API provides the following endpoints:

1. POST /api/status

  • Description: Adds a new status.
  • Parameters:
    • name: Name of the status (string).
  • Response:
    • 201: If the status is successfully created.
    • 400: If the status name already exists.
    • 500: If there's an internal server error.

2. GET /api/statuses

  • Description: Retrieves all statuses.
  • Response:
    • 200: If the statuses are successfully retrieved.
    • 400: If there are no statuses to be found.
    • 500: If there's an internal server error.

3. DELETE /api/statuses

  • Description: Deletes a status.
  • Parameters:
    • id: Id of the status to be deleted (string).
  • Response:
    • 204: If the status is successfully deleted.
    • 400: If the status does not exist.
    • 500: If there's an internal server error.

4. PATCH /api/statuses

  • Description: Edits the initial status and updates related statuses.
  • Parameters:
    • id: Id of the new initial status (string).
  • Response:
    • 200: If the initial status is successfully updated along with related statuses.
    • 400: If the status does not exist or is already the initial status.
    • 500: If there's an internal server error.

5. DELETE /api/statuses/reset

  • Description: Resets the statuses and transitions (for testing purposes).
  • Response:
    • 204: If the reset is successful.
    • 500: If there's an internal server error.

6. POST /api/statuses/reset

  • Description: Adds default statuses and transitions (for testing purposes).
  • Response:
    • 201: If the default statuses and transitions are successfully created.
    • 400: If the statuses array is empty.
    • 500: If there's an internal server error.

7. POST /api/transition

  • Description: Adds a new transition.
  • Parameters:
    • name: Name of the transition (string).
    • sourceId: Id of the source status .
    • targetId: Id of the target status .
  • Response:
    • 201: If the transition is successfully created.
    • 400: If the transition name already exists.
    • 500: If there's an internal server error.

8. GET /api/transitions

  • Description: Retrieves all transitions.
  • Response:
    • 200: If the transitions are successfully retrieved.
    • 500: If there's an internal server error.

9. DELETE /api/transitions

  • Description: Deletes a transition.
  • Parameters:
    • id: Id of the transition to be deleted.
  • Response:
    • 204: If the transition is successfully deleted.
    • 400: If the transition does not exist.
    • 500: If there's an internal server error.

Usage

Explain how to use the endpoints with examples if necessary.

Contributing

If you want to contribute to this project, follow these steps:

  1. Fork the repository.
  2. Create a new branch for your feature or bug fix.
  3. Make the changes and commit them.
  4. Push the changes to your forked repository.
  5. Open a pull request to the main repository.

License

MIT

About

workflow representation using TS and Mongodb. the site shares one DB so unexpected behavior could occur with multiple user online.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published