Not Maintained Development has moved to infinite-industries/infinite
- NodeJS 8.x.x
- Postgres 9.x.x
- git clone git@github.com:infinite-industries/infinite.git
- cd into
infinite
and runnpm install
- copy the file .env.sample to .env and update the environment variables
- The most important values to change are the ones regarding Postgres. You should have a postgres instance running with a database inside of it called 'infinite-api'. The POSTGRES_USER should be set to a superuser (for now, this should be changed for production but is necessary for migrations/seeds to run now)
- Create a folder called `keys\
- Obtain a copy of infinite.pem from a current dev (Sorry this is temporary just reach out to us)
- Setup Postgres (For Help See Next Section)
- If this is your first time running it:
- execute
npm run && setup-create-db && npm run setup-refresh-db
- execute
- execute
npm run start-dev
You can download installers from https://www.postgresql.org/ or if you have Docker setup simply run:
docker run -d /
--restart unless-stopped /
--name ininite-db /
--port 5432:5432 /
-e POSTGRES_PASSWORD xxx postgres
##After pulling new changes## run npm run setup-refresh-db
. This will drop the contents of and rebuild the existing database with the latest schemas and default data.
- start: starts the api server
- start-dev: starts the api server and re-starts when files are changed
- start-docker: runs setup-dev then starts the api server
- test: runs tests (not yet implemented)
- watchify: [Not Used Anymore],
- deploy: deploys to production assuming you have valid certs,
- createTestDevKey: creates a hard-coded dev key that can be used for tests,
- setup-create-db: creates the database (must be done with a postgres super user),
- setup-drop-db: drops the database,
- setup-migrate-db: runs migrations to create the correct schema in the database,
- setup-dev: run this the first time you start the project; it creates all the schemas and populates the database with test dev key and test data loaded from the production json
- setup-refresh-db: run this after pulling in changes, it drops the database, re-creates it and runs setup-dev to make sure your environment is up to date,
- setup-seed-from-prod: loads data from the json file driving the current production environment
2019529e-7f8c-44f9-8996-f52a88b2a314
curl -X POST -H "Content-Type: application/json" -d '{ "event": {"title":"foo", "slug":"xyz" }, "apikey":"48e80bde-aec4-44bb-89e9-01b4a90092cd"}' http://localhost:3003/events
curl -X PUT http://localhost:3003/events/verify/522479a0-c1ab-11e7-910d-794911741001?apikey=2019529e-7f8c-44f9-8996-f52a88b2a314
npm run importEvents
curl -X POST -H "Content-Type: application/json" \
-d '{ "eventList": {"list_name":"chris list" }, "apikey":"2019529e-7f8c-44f9-8996-f52a88b2a314"}' \
http://localhost:3003/event-lists
curl -X PUT -H "Content-Type: application/json" \
-d '{ "apikey":"2019529e-7f8c-44f9-8996-f52a88b2a314"}' \
http://localhost:3003/event-lists/addEvent/bc1afcd0-e37a-11e7-aa97-8d2f2418d66e/9bfb1e30-d3d5-11e7-86f9-b75399ffb386
- Where
bc1afcd0-e37a-11e7-aa97-8d2f2418d66e
is an existing list - And
9bfb1e30-d3d5-11e7-86f9-b75399ffb386
is an existing event
curl http://localhost:3003/event-lists/ | python -m json.tool
curl http://localhost:3003/users?apikey=2019529e-7f8c-44f9-8996-f52a88b2a314 | python -m json.tool
curl -X PUT -H "Content-Type: application/json" \
-d '{ "apikey":"2019529e-7f8c-44f9-8996-f52a88b2a314"}' \
http://localhost:3003/users/addList/99af7550-f3e6-11e7-8279-f30c6795f584/2b305e60-f3e5-11e7-81a0-7d63d12f2c04
curl -X PUT -H "Content-Type: application/json" \
-d '{ "apikey":"2019529e-7f8c-44f9-8996-f52a88b2a314", "venue": { "name": "boaty mc boatface" }}' \
http://localhost:3003/venues/d0858cc0-0478-11e8-808e-07b6d0fe568b"
curl -X PUT -H "Content-Type: application/json" \
-d '{ "apikey":"2019529e-7f8c-44f9-8996-f52a88b2a314"}' \
http://localhost:3003/event-lists/removeEvent/feaea5b0-f3dd-11e7-9986-13e9e40ddffe/9bfb1e30-d3d5-11e7-86f9-b75399ffb386
curl -X DELETE -H "Content-Type: application/json" \
http://localhost:3003/events/9bfb1e30-d3d5-11e7-86f9-b75399ffb387?apikey=2019529e-7f8c-44f9-8996-f52a88b2a314
curl http://localhost:3003/events/current/verified/?apikey=2019529e-7f8c-44f9-8996-f52a88b2a314
npm run dropDB && npm run setupDevEnv
docker run -p5432:5432 --name infinite-postgres -e POSTGRES_PASSWORD=xxx -d postgres
- https://hub.docker.com/_/postgres/
- Connect from host with
psql -h localhost -U postgres
- Note migrations need super user access to run, we probably wan't to run migrations and the application against two different postgres users