https://github.com/cosanlab/trust-game
Interactive 2-player trust game demo
https://github.com/cosanlab/trust-game
firebase svelte tailwind trust-game
Last synced: 6 months ago
JSON representation
Interactive 2-player trust game demo
- Host: GitHub
- URL: https://github.com/cosanlab/trust-game
- Owner: cosanlab
- Created: 2023-01-19T21:23:09.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-01-29T17:26:47.000Z (over 3 years ago)
- Last Synced: 2025-09-10T05:45:49.196Z (10 months ago)
- Topics: firebase, svelte, tailwind, trust-game
- Language: Svelte
- Homepage: https://trust-game-demo.netlify.app
- Size: 297 KB
- Stars: 1
- Watchers: 5
- Forks: 0
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Trust Game Demo
This is a webapp that runs a mock interactive Trust Game between 2 people. It's built using:
- [SvelteJS](https://svelte.dev/) as an intuitive javascript framework for layout and logic
- [TailwindCSS](https://tailwindcss.com/) for styling
- [Firebase](https://firebase.google.com/) for server-less data storage (and real-time updates)
- [Netlify](https://www.netlify.com/) for automatic deploying and hosting from github
## Trial Phase schematic
1. Investor receives endowment and makes decision; Trustee sees endowment make prediction rating.
2. Investor makes 1st order expectation rating; Trustee make prediction rating and 2nd order expectation rating
3. Trustee makes decision
4. Both see trial outcome
5. Both rate how guilty they feel given partner's expectation as well as give counterfactual guilt rating
6. Fixation
### One time CORS configuration
In order to actually make any stored/static files (i.e. mp3s, videos, etc) accessible by the app you must set the [CORS access policy](https://cloud.google.com/storage/docs/configuring-cors) on google cloud:
1. Download [gsutil](https://cloud.google.com/storage/docs/gsutil_install)
2. Unzip it, `cd` into the unzipped folder, and run: `install.sh`
3. Then run `gcloud init` and login with the same google account you used to create your firebase project
4. Create a file called `cors.json` that contains the following:
```
[
{
"origin": ["*"],
"method": ["GET"],
"maxAgeSeconds": 3600
}
]
```
5. Find your google storage URL which should be something like `gs://yourproject.appspot.com`
6. Run `gsutil cors set cors.json yourURL`