{"id":15664863,"url":"https://github.com/bkrem/quanti-team","last_synced_at":"2025-05-06T19:41:28.794Z","repository":{"id":82809924,"uuid":"61381899","full_name":"bkrem/quanti-team","owner":"bkrem","description":":link: A TenderMint blockchain API to make collaborative work measurable \u0026 quantifiable ","archived":false,"fork":false,"pushed_at":"2016-11-13T22:08:01.000Z","size":1174,"stargazers_count":16,"open_issues_count":32,"forks_count":1,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-24T23:02:07.645Z","etag":null,"topics":["blockchain","collaboration","paper","proof-of-concept","quantification","tendermint"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bkrem.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-06-17T15:00:34.000Z","updated_at":"2023-10-27T08:10:06.000Z","dependencies_parsed_at":null,"dependency_job_id":"f681e7b9-10d5-437c-9632-15bb295b2e7b","html_url":"https://github.com/bkrem/quanti-team","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bkrem%2Fquanti-team","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bkrem%2Fquanti-team/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bkrem%2Fquanti-team/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bkrem%2Fquanti-team/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bkrem","download_url":"https://codeload.github.com/bkrem/quanti-team/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252755333,"owners_count":21799300,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["blockchain","collaboration","paper","proof-of-concept","quantification","tendermint"],"created_at":"2024-10-03T13:44:22.642Z","updated_at":"2025-05-06T19:41:28.774Z","avatar_url":"https://github.com/bkrem.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# QuantiTeam\n\n## About\nThe abstract below has been taken from my MSc thesis paper _QuantiTeam: Blockchain architecture as a medium to verify collaborative work_. The full paper is available in PDF format [here](https://github.com/bkrem/msc-thesis/blob/master/final/bkremer-report-final.pdf).\n\n\u003e The ability to work proficiently in collaboration with others is highly valued within a large number of social contexts. Yet, a person’s ability to do so is scarcely quantifiable in any meaningful way. The goal of this project was therefore to examine the feasibility of constructing a system which can verify and quantify collaborative work. The project was set in the specific context of attempting to solve student disengagement, as the larger concept arose from this concrete problem.\n\n\u003e The project attempts to provide a high level of potential for true verification and quantification of collaborative data by utilising a distributed data structure known as a blockchain. Following an analysis of how the proposed system could be structured in terms of interactions between a client and the blockchain, an API was constructed to provide as much functionality as was feasible within the time available. Additionally, a simple client-side mobile application was developed to showcase the API’s functionality in a concrete manner.\n\n\u003e While the project falls short of establishing a manner to truly verify and quantify collaborative work with a distributed blockchain, it demonstrates that such an endeavour is certainly feasible given more time and expertise in the topic area, thus providing a basis for future work to create a bona fide system for verification and quantification of team work.\n\n## Installation\n#### Dependencies\nThe following dependencies are required to run a local development instance of QuantiTeam's [Tendermint](https://github.com/tendermint/tendermint) blockchain:\n- [Docker](https://www.docker.com/) CLI - `docker` (\u0026 `docker-machine` on OSX).  \n- [Eris](https://erisindustries.com/) CLI - `eris` provides a wrapper and toolchain around the Tendermint blockchain and is used extensively.  \n- [Node.js](https://nodejs.org/en/) - v4.x upwards.  \n- [NPM](https://www.npmjs.com/) - QuantiTeam relies on NPM scripts to run tests and various other tasks.  \n\nTo install the project's Node.js dependencies, ensure your present working directory (`pwd`) is `quantiteam/chain` and run:\n```\nnpm install\n```\n\n#### Setting up\nFirst, let's move into QuantiTeam's API directory with the following command:\n```\ncd chain\n```\n\nCreating a local dev `simplechain`:  \n- Automatically: Run `. ./simplechain.sh` in the repository's root directory, which should start logging the chain's activities after setup.  \n- Manually: Follow Eris's brief [tutorial](https://docs.erisindustries.com/tutorials/chain-making/).  \n\n\n## Running a local development chain\nAssuming we now have a functioning `simplechain` instance, let's boot it up and configure some local environment variables. In the repo's root directory run the following two shell scripts:\n```\n. ./chain-up.sh; . ./envsetup.sh\n```\n\nWe can easily verify whether the `simplechain` instance is running as expected by following its log output:\n```\nnpm run chainlog\n```\n\n\n## Running the Node.js chain service\nNow that we have a local development chain running which we can interact with, let's spin up the chain service which will act as our API router to interface with the local chain itself.\n\n#### Deploying contracts\nFirst, let's compile and deploy our Solidity smart contracts in the `contracts` directory:\n```bash\n# `$addr` should be defined from previously running `envsetup.sh`\nnpm run compile -- $addr\n```\nAnytime a change is made to the smart contracts, `compile` should be run to deploy these changes to the running `simplechain` instance.\n\n#### Running tests\nNext, we'll want to run QuantiTeam's test suite to ensure everything is working as expected:\n```\nnpm test\n```\nThis should also provide a coverage report once all unit tests have run.\n\n#### Booting the service\nThe chain service itself can be built \u0026 booted simply with:\n```\nnpm run build\n```\nAnytime a change is made to the node server, `build` should be run as it builds a new service container via `docker` and replaces it with the previous one via `eris`.  \nPlease refer to `package.json` for more detailed insights into which shell commands each NPM script executes.\n\n\n## API\nQuantiTeam's API exposes the following HTTP endpoints:\n\n### Stable\n#### Users\n##### `/user/taken`  \n- Description: Checks whether the the username in `req.body.username` is already taken. Returns a boolean.  \n- Method: POST  \n- Request body:\n```js\n{\n    username: string\n}\n```\n- Response:\n```js\n{\n    isTaken: boolean\n}\n```\n\n##### `/user/signup`\n- Description: Signs up a new user with the credentials in `req.body.form`. Returns the new `User` contract's hex address.\n- Method: POST\n- Request body:\n```js\n{\n    form: {\n        name: string,\n        email: string,\n        username: string,\n        password: string\n    }\n}\n```\n- Response:\n```js\n{\n    address: string // hex address\n}\n```\n\n##### `/user/login`\n- Description: Logs in an existing user with the credentials passed in `req.body.form`. Returns `isValid` boolean to signify validity of credentials, and a `user` object if the login was successful. Additionally a `team` object is returned if the user is part of a team.\n- Method: POST\n- Request body:\n```js\n{\n    form: {\n        username: string,\n        password: string\n    }\n}\n```\n- Response:\n```js\n{\n    isValid: boolean,\n    user: {\n        name: string,\n        username: string,\n        score: string,\n        teamname?: string,\n        email?: string,\n        address?: string\n    },\n    team: {\n        name: string,\n        score: number;\n        members: Array\u003cUser\u003e,\n        founderUsername: string,\n        founderAddress: string, // hex address\n        address?: string\n    }\n}\n```\n**Note**\n- `user` \u0026 `team` props will be `null` if `isValid === false`.\n- `team` prop will automatically be null if the user is not part of a team.\n\n\n##### `/user/profile/:username`\n- Description: Gets the profile of the username passed via `req.params.username`. Returns a `profile` object.\n- Method: GET\n- Request: `/user/profile/johndoe`\n- Response:\n```js\n{\n    profile: {\n        name: string,\n        username: string,\n        score: string,\n        teamname?: string,\n        email?: string,\n        address?: string\n    }\n}\n```\n\n#### Tasks\n##### `/tasks/:username`\n- Description: Gets the tasks of the username passed via `req.params.username`. Returns an array of `Task`-type objects. Returns an empty array if `:username` param has no tasks associated with it.\n- Method: GET\n- Request: `/tasks/johndoe`\n- Response:\n```js\n{\n    data: Array\u003cTask\u003e\n}\n```\n\n##### `/task`\n- Description: Adds a new task to the blockchain via the form data passed in `req.body.task` for the username in `req.body.username`. Returns a boolean indicating whether a previously existing task was overwritten, along with the task's hex address.\n- Method: POST\n- Request body:\n```js\n{\n    username: string,\n    task: {\n        id: string,\n        title: string,\n        desc: string,\n        reward: string,\n        complete: string,\n        status: \"To Do\" || \"Completed\" // enum\n        participants: Array\u003cstring\u003e,\n        creator: string,\n        token: string,\n        createdAt: number // unix timestamp\n    }\n}\n```\n- Response:\n```js\n{\n    isOverwrite: boolean,\n    taskAddr: string\n}\n```\n\n##### `/task/completed/:token`\n- Description: Marks the task associated with the token passed in `req.params.token` as completed. Returns a boolean indicating whether marking the task was successful.\n- Method: GET\n- Request: `/task/completed/xyz123`\n- Response:\n```js\n{\n    success: boolean\n}\n```\n\n\n#### Teams\n##### `/team/taken/:teamname`\n- Description: Checks whether the teamname passed as `req.params.teamname` is already taken. Returns a boolean indicating whether the team name is already taken or not.\n- Method: GET\n**TODO**\n\n##### `/team`\n- Description: Adds a new team to the blockchain via the form data passed in `req.body.form`. Returns the new team's hex address in the blockchain and a boolean indicating whether the team was successfully linked to it's founder in the blockchain.\n- Method: POST\n- Request body:\n```js\n{\n    form: {\n        name: string,\n        founderUsername: string,\n        founderAddress: string, // hex address\n        createdAt: number // unix timestamp\n    }\n}\n```\n- Response:\n```js\n{\n    address: string, // hex address\n    linkSuccess: boolean\n}\n```\n\n##### `/team/:teamname`\n- Description: Gets the team profile for the teamname passed as `req.params.teamname`. Returns a `Team`-type object.\n- Method: GET\n- Request: `/team/myteamname`\n- Response:\n```js\n{\n    name: string,\n    score: number,\n    members: Array\u003cUser\u003e,\n    founderUsername: string,\n    founderAddress: string,\n    address: string // hex address\n}\n```\n\n\n##### `/team/add-member`\n- Description: Adds a new member to a team with the form data passed in `req.body.form`. Returns a boolean indicating whether the passed username was successfully linked to the team, along with an indicator of whether the username actually exists.\n- Method: POST\n- Request body:\n```js\n{\n    form: {\n        username: string,\n        teamname: string,\n        teamAddress: string // hex address\n    }\n}\n```\n- Response:\n```js\n{\n    isTaken: boolean,\n    username: string,\n    linkSuccess: boolean\n}\n```\n\n### Experimental\n- POST `/upload` - Upload a task related file via `multipart/form-data`.\n\n\n## Shutting down\nTo shut down the local chain and the `docker-machine` instance, simply run:\n```\n. ./chain-down.sh\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbkrem%2Fquanti-team","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbkrem%2Fquanti-team","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbkrem%2Fquanti-team/lists"}