{"id":13682362,"url":"https://github.com/jim108dev/purescript-payload-realworld-example","last_synced_at":"2025-04-30T09:32:15.367Z","repository":{"id":62603203,"uuid":"334895393","full_name":"jim108dev/purescript-payload-realworld-example","owner":"jim108dev","description":"Exemplary real world application built with PureScript + Payload + PostgreSQL","archived":false,"fork":false,"pushed_at":"2021-06-08T08:23:02.000Z","size":3859,"stargazers_count":21,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-08-02T13:34:02.632Z","etag":null,"topics":["jwt","postgresql","purescript","purescript-payload","purescript-selda","realworld-backend"],"latest_commit_sha":null,"homepage":"","language":"PureScript","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/jim108dev.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":"2021-02-01T09:24:46.000Z","updated_at":"2023-10-02T08:45:53.000Z","dependencies_parsed_at":"2022-11-04T00:38:57.537Z","dependency_job_id":null,"html_url":"https://github.com/jim108dev/purescript-payload-realworld-example","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jim108dev%2Fpurescript-payload-realworld-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jim108dev%2Fpurescript-payload-realworld-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jim108dev%2Fpurescript-payload-realworld-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jim108dev%2Fpurescript-payload-realworld-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jim108dev","download_url":"https://codeload.github.com/jim108dev/purescript-payload-realworld-example/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224206042,"owners_count":17273378,"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":["jwt","postgresql","purescript","purescript-payload","purescript-selda","realworld-backend"],"created_at":"2024-08-02T13:01:44.791Z","updated_at":"2024-11-12T02:30:30.498Z","avatar_url":"https://github.com/jim108dev.png","language":"PureScript","readme":"# PureScript Payload RealWorld Example\n\nThis is a learning project in order to set up a REST API with [PureScript Payload](https://github.com/hoodunit/purescript-payload) and [PostgreSQL](https://www.postgresql.org). The specification follows\n\n- [RealWorld API Spec](https://github.com/gothinkster/realworld/tree/master/api)\n\n## Install\n\n1. Install [PureScript](https://www.purescript.org/).\n\n1. Install repository 's software:\n\n    1. Run:\n\n    ```sh\n    # This repo\n    git clone https://github.com/jim108dev/purescript-payload-realworld-example.git\n    \n    cd purescript-payload-realworld-example\n    \n    npm install pg decimal.js xhr2 jsonwebtoken\n    spago install\n    spago build\n    ```\n\n### Development/Test Mode\n\nPlease choose if you want to run the server in development/test (Dev) mode or in production mode (Prod). *Dev* operates with fixed timestamps which is required for the automated tests to run. *Prod* operates with the current system time.\n\n1. Database Setup:\n   1. Install PostgreSQL.\n   1. `sql/CreateDB.sql`: Execute commands which set up a database called `conduit`.\n   1. `config/Server/{Dev|Prod}.json`: Change config files according to your db setup.\n   1. `sql/Functions.sql`: Execute commands which set up functions/triggers for *Prod*.\n   1. `sql/ResetTables.sql`: Activate the current timestamps by uncommenting `-- TIMESTAMP` for *Prod*. This file can be executed with:\n\n    ```sh\n    spago run -m Test.ResetTables\n    ```\n\n1. Jwt: `config/Server/Prod.json`: Change the token's secret key for *Prod*.\n\n1. Server: `src/Server/Main.purs`: Set the configuration file accordingly.\n\n1. Optional: Install [HTTPie](https://httpie.io) and [httpie-jwt-auth](https://github.com/teracyhq/httpie-jwt-auth) for testing via command line.\n\n1. Optional: Install a frontend like [Real World Halogen](\u003chttps://github.com/thomashoneyman/purescript-halogen-realworld\u003e).\n\n## Usage\n\n1. Run the server:\n\n    ```sh\n    spago run \n    ```\n\n1. [API-SPEC.md](./API-SPEC.md) lists HTTPie test calls to every request.\n\n1. Run a frontend.\n\n## Development\n\n1. Run the unit tests  \n\n    ```sh\n    spago run -m Test.Main\n    ```\n\n[APPROACH.md](./APPROACH.md) contains some comments about the decisions which were made.\n","funding_links":[],"categories":["PureScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjim108dev%2Fpurescript-payload-realworld-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjim108dev%2Fpurescript-payload-realworld-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjim108dev%2Fpurescript-payload-realworld-example/lists"}