{"id":18522483,"url":"https://github.com/astro/yammat","last_synced_at":"2025-04-09T11:30:55.448Z","repository":{"id":30147604,"uuid":"33697784","full_name":"astro/yammat","owner":"astro","description":"Yet Another MateMAT","archived":false,"fork":false,"pushed_at":"2020-06-05T17:45:25.000Z","size":1959,"stargazers_count":1,"open_issues_count":0,"forks_count":10,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-24T05:05:08.303Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Haskell","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/astro.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-04-09T23:26:06.000Z","updated_at":"2024-04-14T21:30:39.000Z","dependencies_parsed_at":"2022-08-26T09:50:51.963Z","dependency_job_id":null,"html_url":"https://github.com/astro/yammat","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/astro%2Fyammat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/astro%2Fyammat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/astro%2Fyammat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/astro%2Fyammat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/astro","download_url":"https://codeload.github.com/astro/yammat/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248031061,"owners_count":21036324,"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":[],"created_at":"2024-11-06T17:31:24.319Z","updated_at":"2025-04-09T11:30:53.764Z","avatar_url":"https://github.com/astro.png","language":"Haskell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# yammat\n\nYet Another MateMAT\n\n## Introduction\n\nThis project aims to be an implementation for a trust based POS for hackerspaces.\n\n## Installation\n\n### Dependencies\n\n#### Environment dependencies\n\nA working Haskell capable environment. For that you will need `ghc` and\n`cabal-install`, which can be installed with:\n\n```bash\nsudo apt-get install ghc cabal-install\n```\n\nAfter you installed `cabal-install`, let it make itself comfortable in your system with\n\n```bash\ncabal update \u0026\u0026 cabal install cabal-install\n```\n\nThis might, depending on your system setup, take some time. Brew yourself some tea.\n\n#### Build dependencies\n\nNow that your Haskell environment is set up, you need to install the \ndependencies for building and running yammat, which are:\n\n* build-essential\n* alex\n* happy\n* libpq-dev\n* postgresql\n* libfftw3-dev\n* zlib1g-dev\n\nInstall all of them through your package management system.\n\n### Building\n\nFirst create a sandbox in the project directory with:\n\n```bash\ncabal sandbox init \u0026\u0026 cabal install --only-dependencies\n```\n\nThis will take a long time, so go on a quest to find some cookies to go with\nthe tea.\n\nTo build this project enter `cabal build` into your command line.\n\nEnjoy your cookies and tea while you watch your yammat being built.\n\n## Deployment\n\nCreate a directory outside of the project directory, where you want to actually\nrun the application. Copy or link the executable `yammat` from\n`dist/build/yammat/` to your desired run location alongside with the folders\n`static` and `config` and their contenst. The Folders should be copied, or you\nmay get problems with your git pulls.\n\n## Configuration\n\n### Database\n\nTo set up your database, Enter the postgresql root console (change to user\n`postgres` and invoke `psql` on a debian system). then create a user with\n\n```SQL\nCREATE USER \u003cusername\u003e WITH PASSWORD '\u003cpassword\u003e':\n```\n\nand then create the database and grant all privileges to the user with\n\n```SQL\nCREATE DATABASE \u003cdatabasename\u003e;\nGRANT ALL PRIVILEGES ON \u003cdatabasename\u003e to \u003cusername\u003e;\n```\n\n### Webapp\n\nLet's leave the project directory and enter your desired run location.\nCheck the configuration File `config/settings.yml` and alter its content to your\nliking. Most of these settings normally don't need to be altered much, except\nfor `approot`. Change this setting to the root address with which you want to\nconnect to the application, including the scheme (http or https).\nAdditionally edit the settings `email`, `currency` and `cash_charge`.\n\n* `email` is the email address, which will receive notifications from yammat,\nshould the stock run low.  \n* `currency` is your currency sign or shorthand, which will be used when\ndisplaying prices.\n* `cash_charge` is the extra you want to charge your users, who pay cash.\n\t* *Note:* The value of this setting is in hundredths of your currency\n\tdenomination.\n\n`cash_charge` is effectively a \"guest tax\". Setting it to `0` is perfectly fine,\nif you don't want that.\n\nCreate a Postgresql User and Database according to the settings in the settings\nfile and grant the user all privileges on the database.\n\n## Lift-Off\n\nRun `./yammat config/settings.yml` in your desired run location. Finally point a reverse-proxy\n(something like nginx) at `http://localhost:3000` or any other port you configured in\n`config/settings.yml`.\n\nFor better control You can wrap an systemd unit file around this.\nHow to do this is described [in my blog][blog].\n\n## Migrations\n\n### 0.0.0-0.0.1\n\n* Delete column `alt_time` from table `avatar` in your Database with\n  `alter table \"avatar\" drop column \"alt_time\";`\n* Start yammat normally to fill database with dummy data and stop it again\n* Run migration script\n\t* if you have built yammat with a sandbox, run\n`runghc -package-db/full/path/to/sandbox(XXX-ghc-version-packages.conf.d\n/path/to/yammat/Migration/0.0.0-0.0.1/Migration.hs`\n\t\t* Note: No space between the option `-package-db` and its argument\n\t* without sandbox: `runghc /path/to/yammat/Migration/0.0.0-0.0.1/Migration.hs`\n* Enjoy your freshly migrated Matemat\n\n### 0.0.2-0.0.3\n\n* stop old matemat\n* create a view with new and old timestamps and user ids with\n  `create or replace view \"user_new\" as select \"user\".id, \"user\".timestamp, date 'epoch' + \"user\".timestamp * interval '1 second' as timestamp_new from \"user\";`\n* create temporary timestamp column in user table with\n  `alter table \"user\" add column \"timestamp_temp\" date;`\n* fill temporary timestamp column with new timestamps with\n  `update \"user\" set timestamp_temp = (select timestamp_new from user_new where user_new.id = \"user\".id);`\n* check if new timestamps look sane\n* drop old timestamp column\n  `alter table \"user\" drop column timestamp cascade;`\n* rename temporary column\n  `alter table \"user\" rename column timestamp_temp to \"timestamp\";`\n* start new matemat\n\n[stackage]: http://www.stackage.org/\n[blog]: https://nek0.eu/posts/2015-08-28-Daemonize-a-Yesod-application-systemd-style.html\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fastro%2Fyammat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fastro%2Fyammat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fastro%2Fyammat/lists"}