{"id":13554951,"url":"https://github.com/hackerspace-bootstrap/strichliste","last_synced_at":"2026-01-11T08:03:41.318Z","repository":{"id":78646479,"uuid":"21331766","full_name":"hackerspace-bootstrap/strichliste","owner":"hackerspace-bootstrap","description":"DEPRECATED - strichliste is a tool to replace a tally sheet inside a hackerspace, this module is the api for the strichliste","archived":false,"fork":false,"pushed_at":"2018-12-25T13:32:22.000Z","size":724,"stargazers_count":17,"open_issues_count":2,"forks_count":12,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-03T07:39:36.802Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hackerspace-bootstrap.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}},"created_at":"2014-06-29T20:35:01.000Z","updated_at":"2023-08-25T11:29:51.000Z","dependencies_parsed_at":null,"dependency_job_id":"66116e4a-8518-4158-b893-690ed30806f5","html_url":"https://github.com/hackerspace-bootstrap/strichliste","commit_stats":null,"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"purl":"pkg:github/hackerspace-bootstrap/strichliste","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hackerspace-bootstrap%2Fstrichliste","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hackerspace-bootstrap%2Fstrichliste/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hackerspace-bootstrap%2Fstrichliste/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hackerspace-bootstrap%2Fstrichliste/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hackerspace-bootstrap","download_url":"https://codeload.github.com/hackerspace-bootstrap/strichliste/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hackerspace-bootstrap%2Fstrichliste/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28297984,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-11T04:44:51.577Z","status":"ssl_error","status_checked_at":"2026-01-11T04:44:44.232Z","response_time":60,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":[],"created_at":"2024-08-01T12:02:58.330Z","updated_at":"2026-01-11T08:03:41.290Z","avatar_url":"https://github.com/hackerspace-bootstrap.png","language":"JavaScript","readme":"# strichliste \n\n[![Build Status](https://travis-ci.org/hackerspace-bootstrap/strichliste.png)](https://travis-ci.org/hackerspace-bootstrap/strichliste)\n[![Dependency Status](https://david-dm.org/hackerspace-bootstrap/strichliste/master.svg)](https://david-dm.org/hackerspace-bootstrap/strichliste/master)\n[![devDependency Status](https://david-dm.org/hackerspace-bootstrap/strichliste/master/dev-status.svg)](https://david-dm.org/hackerspace-bootstrap/strichliste/master#info=devDependencies)\n\n# DEPRECATED\nstrichliste1 has been replaced by strichliste2. See https://github.com/strichliste for the new version!\n\nThis module is the API for the strichliste app. Arbitrary clients can be implemented using this [API](#api-documentation)\n\n__Clients__:\n\n* [Web-Frontend](https://github.com/hackerspace-bootstrap/strichliste-web) ([demo](http://demo.strichliste.org/))\n\n## TOC\n\n* [First Steps](#first-steps)\n* [Configuration](#configuration)\n* [API Documentation](#api-documentation)\n\n## First Steps\n\n### Setup\n\n#### Steps\n\n##### Grab the latest [release](https://github.com/hackerspace-bootstrap/strichliste/releases)\n\n##### install dependencies\n\n````bash\n$ npm i\n````\n\n##### run tests\n\n````bash\n$ npm run test\n````\n\n##### initialize database\n\ncreates the tables in the sqlitefile\n\n````bash\n$ npm run setup:database\n````\n\n#### everything at once\n\nFor your convenience the following npm script does all of the above steps at once:\n````bash\n$ npm run setup\n````\n\n#### start api server\n\nConsider editing the configuration before starting the api server (see the [configuration](#configuration) section).\n````bash\n$ npm run start\n````\n\n## Configuration\n\nThe API server brings with it a default configuration which can be found in `/configuration/default.js`. This default can be used to setup your own configuration.\nThe server utilizes the [configurations](https://www.npmjs.org/package/configurations) module from npm which does a staged modification of configurations. Initially the default config is loaded and then subsequent modifications are applied.\n\nYou can add your own environment specific configuration by adding e.g. a `production.js` to the configurations folder. When the server is started with the node environment `NODE_ENV` set to `production`, the default config is enhanced by your production config. You don't have to specify each and every key from `default.js`, the defaults are retained.\n\nYou also can specify an external configuration sitting on an arbitrary place in your system by assigning it via a command line parameter:\n\n````bash\n$ node server.js --externalconfig=/etc/opt/strichliste/myconfig.js\n````\n\n### Configuration details\n\nThis section explains the content of the default.json which can be modified by you as you wish\n\n````javascript\nmodule.exports = {\n    //the server runs on this port\n    port: 8080,\n\n    //details to the database\n    database: {\n        //the engine that should be used, until now only sqlite is supported\n        type: 'SQLITE',\n\n        //(arbitrary) options to the database engine\n        options: {\n            filename: 'data.sqlite'\n        }\n    },\n\n    //strichliste announces actions via mqtt if desired\n    mqtt: {\n        //enable mqtt broadcasting\n        enabled: false,\n\n        //the mqtt service host\n        host: 'localhost',\n\n        // the mqtt service port\n        port: 1883,\n\n        //a list of topics that are broadcasted\n        topics: {\n            //gets broadcasted when someone adds a new transaction\n            transactionValue: 'strichliste/transactionValue'\n        }\n    },\n\n    //boundaries define values the apply to a user account or the transactions of auser\n    boundaries: {\n        account: {\n            //the maximum amount that can be stored in a user's account (99999999 is equvalent to Inifinity)\n            upper: 99999999,\n\n            //the maximum dept a user can have\n            lower: -50\n        },\n        transaction: {\n            //the biggest transaction a user can do\n            upper: 150,\n\n            //the biggest money withdrawal a user can do\n            lower: -20\n        }\n    },\n\n    //logging\n    logging: {\n        //specifies if the api should log api access to the console\n        active: true\n    }\n}\n````\n\n## API Documentation\n\nEvery API answer has the Content-Type `application/json`.\nData that is posted to the API is always JSON as well.\n\n### Pagination\n\nAt some endpoints the following queryparameters can be used to control the pagination of lists:\n\n* `limit`: the number of items to show\n* `offset`: the number of the first item in the list\n\nEach of the paginated lists are of the following data structure:\n\n````\n{\n  overallCount: \u003cint\u003e,\n  limit: \u003cint\u003e,\n  offset: \u003cint\u003e,\n  entries: [\u003centry]\n}\n````\n\n### Endpoints\n\n#### GET /user\n\nReturns the complete list of all users.\nEach user is described via the following data structure:\n````\n{\n  \"id\": \u003cint\u003e,\n  \"name\": \u003cstring\u003e,\n  \"mailAddress\": \u003cstring\u003e,\n  \"balance\": \u003cfloat\u003e,\n  \"lastTransaction\": \u003cdateTime\u003e,\n  \"countOfTransactions\": \u003cint\u003e,\n  \"weightedCountOfPurchases\": \u003cint\u003e,\n  \"activeDays\": \u003cint\u003e\n}\n````\n\nThe parameters and the list structure of the `Pagination` section are used in this endpoint.\n\n#### POST /user\n\nCreates a new user.\nTo create a new user a name and an optional mailAddress has to be assigned via the following data structure.\n\n````\n{\n    \"name\": \u003cstring\u003e,\n    \"mailAddress\": \u003cstring\u003e\n}\n````\n\nReturns the status code 201 and the created user if the creation was successfull.\n\n##### Errors\n\n* 409: If a user already exists\n\n#### GET /transaction\n\nLists the latest transactions.\nEach transaction has the following data structure:\n````\n{\n  id: \u003cint\u003e,\n  userId: \u003cint\u003e,\n  createDate: \u003cDateTime\u003e,\n  value: \u003cfloat\u003e,\n  comment: \u003cstring\u003e\n}\n````\n\nUse the parameters and the list structure of the `Pagination` section to specify the list's structure.\n\n#### GET /user/:userId\n\nReturns one specific user.\nThe returned data structure correlates with the /user endpoint, additionally a list of the five last transactions is sent.\n(See the /user/transaction section for a reference to the transaction data structure)\n\n##### Errors\n\n* 404: If the user could not be found\n\n#### GET /user/:userId/transaction\n\nReturns a list of transactions belonging to the user with the id :userId.\nThe structure of the transactions object corresponds to the definiton of the '/transaction' route\n\nThe parameters and the list structure of the `Pagination` section are used in this endpoint.\n\n##### Errors\n\n* 404: If the user could not be found\n\n#### POST /user/:userId/transaction\n\nCreates a new transaction for the user with the id `:userId`.\nThe following data structure describes the transaction:\n\n````\n{\n  value: \u003cfloat\u003e,\n  comment: \u003cstring\u003e,\n  toUserId: \u003cint\u003e\n}\n````\n\nReturns the status code 201 if a transaction was successfully created.\n\n##### Errors\n\n* 400: If a transaction value is not a number or is zero.\n* 403: If a transaction value is above or below a certain border (configurable) or the resulting user balance would exceed a certain border (configurable).\n* 404: If the user has not been found\n\n\n#### GET /user/:userId/transaction/:transactionId\n\nReturns a certain transaction.\nThe data structure corresponds to that of the `/user/:userId/transaction` section.\n\n##### Errors\n\n* 404: If the user or the transaction could not be found\n\n#### GET /settings\n\nReturns the configured settings:\n\n````\n{\n  boundaries: {\n    upper: \u003cint\u003e\n    lower: \u003cint\u003e\n  }\n}\n````\n\nFor more details on the configuration see the `configuration` section.\n\n#### GET /metrics\n\nReturns metrics concerning the registered users and their transactions.\nData structure:\n\n````\n{\n  overallBalance: \u003cfloat\u003e,\n  countTransactions: \u003cint\u003e,\n  contUsers: \u003cint\u003e,\n  avgBalance: \u003cfloat\u003e,\n  days: [\n    {\n      date: \u003cDate\u003e,\n      overallNumber: \u003cint\u003e,\n      distinctUsers: \u003cint\u003e,\n      dayBalance: \u003cfloat\u003e,\n      dayBalancePositive: \u003cfloat\u003e,\n      dayBalanceNegative: \u003cfloat\u003e\n    }\n  ]\n}\n````\n","funding_links":[],"categories":["JavaScript","others"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhackerspace-bootstrap%2Fstrichliste","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhackerspace-bootstrap%2Fstrichliste","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhackerspace-bootstrap%2Fstrichliste/lists"}