{"id":17862541,"url":"https://github.com/krdlab/haskell-webapp-testing-experimentation","last_synced_at":"2025-06-19T07:08:45.389Z","repository":{"id":141883113,"uuid":"45298800","full_name":"krdlab/haskell-webapp-testing-experimentation","owner":"krdlab","description":null,"archived":false,"fork":false,"pushed_at":"2015-11-01T14:40:22.000Z","size":144,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-02T21:14:52.240Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://krdlab.hatenablog.com/entry/2015/11/03/122732","language":"Haskell","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/krdlab.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}},"created_at":"2015-10-31T11:16:00.000Z","updated_at":"2020-01-31T05:04:42.000Z","dependencies_parsed_at":"2023-03-13T15:42:20.452Z","dependency_job_id":null,"html_url":"https://github.com/krdlab/haskell-webapp-testing-experimentation","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/krdlab/haskell-webapp-testing-experimentation","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krdlab%2Fhaskell-webapp-testing-experimentation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krdlab%2Fhaskell-webapp-testing-experimentation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krdlab%2Fhaskell-webapp-testing-experimentation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krdlab%2Fhaskell-webapp-testing-experimentation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/krdlab","download_url":"https://codeload.github.com/krdlab/haskell-webapp-testing-experimentation/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krdlab%2Fhaskell-webapp-testing-experimentation/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260705876,"owners_count":23049493,"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-10-28T08:53:11.954Z","updated_at":"2025-06-19T07:08:40.373Z","avatar_url":"https://github.com/krdlab.png","language":"Haskell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Web App. Testing experimentation\n\n## Prepare\n\n* Redis\n* MySQL\n* MailCatcher\n* SQLite\n\n```sql\n-- $ mysql -u root -p\n\nCREATE DATABASE main DEFAULT CHARACTER SET utf8mb4;\nCREATE TABLE main.user (\n    id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,\n    name VARCHAR(64) NOT NULL,\n    email_address VARCHAR(128) NOT NULL,\n    created_at DATETIME NOT NULL,\n    last_loggedin_at DATETIME NOT NULL,\n    UNIQUE KEY unique_user_name (name),\n    UNIQUE KEY unique_user_email_address (email_address)\n);\nCREATE USER 'tester'@\"%\" IDENTIFIED BY 'tester';\nGRANT ALL PRIVILEGES ON main.* TO 'tester'@\"%\";\n```\n\n```sql\n-- $ sqlite3 test.db\n\nCREATE TABLE user (\n    id INTEGER PRIMARY KEY AUTOINCREMENT,\n    name VARCHAR(64) NOT NULL UNIQUE,\n    email_address VARCHAR(128) NOT NULL UNIQUE,\n    created_at DATETIME NOT NULL,\n    last_loggedin_at DATETIME NOT NULL\n);\n```\n\nSQLite uses \"main\" as a virtual database name. I don't know how to rename it.\nThus both MySQL and SQLite use \"main\" as a database name here.\n\n## Build \u0026 Run\n\n```sh\n$ git submodule update\n$ cabal sandbox init \u0026\u0026 cabal sandbox add-source hdbc-mysql/\n$ cabal build\n$ cabal run server\n```\n\n## Check\n\n```sh\n$ curl -X POST \\\n    -H 'Content-Type: application/json' \\\n    -d '{\"reg_name\":\"tester\",\"reg_email_address\":\"tester@localhost\"}' \\\n    http://localhost:8081/register\n\n$ curl -X POST \\\n    -H 'Content-Type: application/json' \\\n    -d '{\"login_name\":\"tester\"}' \\\n    http://localhost:8081/login\n\n$ curl -X GET \\\n    http://localhost:8081/users/2\n```\n\n## Test\n\n```sh\n$ cabal install --only-dependencies --enable-tests\n$ cabal configure --enable-tests\n$ cabal build\n$ cabal test\n```\n\n`registerSpec` uses `MockApp`. `MockApp` emulates IO actions and doesn't access to an external process.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkrdlab%2Fhaskell-webapp-testing-experimentation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkrdlab%2Fhaskell-webapp-testing-experimentation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkrdlab%2Fhaskell-webapp-testing-experimentation/lists"}