These settings are for development and tests only. Data added interactively (by hand or by automated tests) are wiped out when the container is shut down. It is on purpose.
Production settings will be provided in a different document.
- Start CouchDB and push the code and samples:
export COUCHDB_USER="TO_BE_CHANGED"
export COUCHDB_PASSWORD="TO_BE_CHANGED"
docker-compose up -d
- Enable CORS in CouchDB.
alias put='curl -X PUT -u "${COUCHDB_USER}:${COUCHDB_PASSWORD}"'
put localhost:5984/_node/nonode@nohost/_config/httpd/enable_cors --data '"true"'
put localhost:5984/_node/nonode@nohost/_config/cors/origins --data '"*"'
- Set public access to the database:
put localhost:5984/hyperglosae/_security --data '{"members":{"roles":[]},"admins":{"roles":["_admin"]}}'
- Create test users:
put localhost:5984/_users
put localhost:5984/_users/org.couchdb.user:alice --data '{"name":"alice", "password":"whiterabbit", "roles":[], "type":"user"}'
put localhost:5984/_users/org.couchdb.user:bill --data '{"name":"bill", "password":"madhatter", "roles":[], "type":"user"}'
Update documents in ../samples
and push them to the backend:
docker-compose up updated_samples
Update code in src
and push it to the backend:
docker-compose up updated_code
The backend is coded in JavaScript as CouchDB views (see documentation). Documents stored in CouchDB can be created, updated and deleted (esp. by the frontend) using CouchDB REST API (see documentation).
docker-compose down