yammat.cabal: add extensions DataKinds, FlexibleInstances
Reason: > Model.hs:25:1: error: > Generating Persistent entities now requires the following language extensions: > > DataKinds > FlexibleInstances
|1 month ago|
|Handler||2 months ago|
|Import||5 years ago|
|Migration/0.0.0-0.0.1||5 years ago|
|Settings||5 years ago|
|app||5 years ago|
|config||2 years ago|
|messages||2 years ago|
|static||2 years ago|
|templates||2 years ago|
|test||11 months ago|
|.gitignore||5 years ago|
|Application.hs||2 years ago|
|CONTRIBUTING.md||4 years ago|
|Foundation.hs||2 months ago|
|Import.hs||5 years ago|
|LICENSE.md||5 years ago|
|Model.hs||5 years ago|
|README.md||3 years ago|
|Settings.hs||11 months ago|
|default.nix||5 months ago|
|flake.lock||2 months ago|
|flake.nix||2 months ago|
|nixos-module.nix||2 months ago|
|pkg.nix||2 months ago|
|shell.nix||2 months ago|
|yammat.cabal||1 month ago|
Yet Another MateMAT
This project aims to be an implementation for a trust based POS for hackerspaces.
A working Haskell capable environment. For that you will need
cabal-install, which can be installed with:
sudo apt-get install ghc cabal-install
After you installed
cabal-install, let it make itself comfortable in your system with
cabal update && cabal install cabal-install
This might, depending on your system setup, take some time. Brew yourself some tea.
Now that your Haskell environment is set up, you need to install the dependencies for building and running yammat, which are:
Install all of them through your package management system.
First create a sandbox in the project directory with:
cabal sandbox init && cabal install --only-dependencies
This will take a long time, so go on a quest to find some cookies to go with the tea.
To build this project enter
cabal build into your command line.
Enjoy your cookies and tea while you watch your yammat being built.
Create a directory outside of the project directory, where you want to actually
run the application. Copy or link the executable
dist/build/yammat/ to your desired run location alongside with the folders
config and their contenst. The Folders should be copied, or you
may get problems with your git pulls.
To set up your database, Enter the postgresql root console (change to user
postgres and invoke
psql on a debian system). then create a user with
CREATE USER <username> WITH PASSWORD '<password>':
and then create the database and grant all privileges to the user with
CREATE DATABASE <databasename>; GRANT ALL PRIVILEGES ON <databasename> to <username>;
Let’s leave the project directory and enter your desired run location.
Check the configuration File
config/settings.yml and alter its content to your
liking. Most of these settings normally don’t need to be altered much, except
approot. Change this setting to the root address with which you want to
connect to the application, including the scheme (http or https).
Additionally edit the settings
currencyis your currency sign or shorthand, which will be used when displaying prices.
cash_chargeis the extra you want to charge your users, who pay cash.
cash_charge is effectively a “guest tax”. Setting it to
0 is perfectly fine,
if you don’t want that.
Create a Postgresql User and Database according to the settings in the settings file and grant the user all privileges on the database.
./yammat config/settings.yml in your desired run location. Finally point a reverse-proxy
(something like nginx) at
http://localhost:3000 or any other port you configured in
For better control You can wrap an systemd unit file around this. How to do this is described in my blog.
avatarin your Database with
alter table "avatar" drop column "alt_time";
runghc -package-db/full/path/to/sandbox(XXX-ghc-version-packages.conf.d /path/to/yammat/Migration/0.0.0-0.0.1/Migration.hs
-package-dband its argument
create or replace view "user_new" as select "user".id, "user".timestamp, date 'epoch' + "user".timestamp * interval '1 second' as timestamp_new from "user";
alter table "user" add column "timestamp_temp" date;
update "user" set timestamp_temp = (select timestamp_new from user_new where user_new.id = "user".id);
alter table "user" drop column timestamp cascade;
alter table "user" rename column timestamp_temp to "timestamp";