Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/medialab/ouatterrir
WIP
https://github.com/medialab/ouatterrir
Last synced: 21 days ago
JSON representation
WIP
- Host: GitHub
- URL: https://github.com/medialab/ouatterrir
- Owner: medialab
- License: agpl-3.0
- Created: 2020-04-19T12:53:55.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-01-06T02:47:29.000Z (almost 4 years ago)
- Last Synced: 2024-11-04T01:32:46.111Z (about 1 month ago)
- Language: JavaScript
- Size: 1.91 MB
- Stars: 4
- Watchers: 5
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-starred - medialab/ouatterrir - WIP (others)
README
# OuAtterrir
## API
* `POST /answer`: payload: `{data: answer}`
* `GET /data`: csv data (only one set of propositions per user contribution)
* `GET /data?returnAll`: csv data unfiltered (multiple versions of a user contribution possible)
* `GET /data?json`: json dump## Dev Install
- API:
```
npm install
```Start a MongoDB (at least 4.0) on the port 27117, either already installed, or you can do so via Docker using:
```
npm run mongo
```In another shell, run the API server with:
```
npm run start
```You can test the API is properly working by calling:
```
curl -H "Content-Type: application/json" -d '{"data": {"TEST": "OK"}}' localhost:4000/answer
curl 'admin:password@localhost:4000/data?json'
```- Client:
```
cd client
npm install
npm run start
```It will open automatically the website in your browser on `http://localhost:3000`
## Prod Deployment with Docker
Build the containers:
```
docker-compose build
```Or pull prebuilt ones:
```
docker-compose pull
```Then start the whole website with the credentials and the port of your choice, for instance admin/password and 8000, using:
```
PUBLIC_PORT=8000 MONGO_USER=admin MONGO_PASSWORD=password docker-compose up
```Or set environment variables definitely by creating a .env file such as the example one and edit it:
```
cp .env{.example,}
```Then just run (or with -d option for production):
```
docker-compose up
```The client is then served on `http://localhost:{PUBLIC_PORT}` and the API on `http://localhost:{PUBLIC_PORT}/api/`