Run only Neo4j:
sudo docker-compose up neo4j
Run both webapp and db:
sudo docker-compose up
Stop container(s):
sudo docker-compose down
Neo4j browser:
http://localhost:7474/browser/
Show everything:
MATCH (n) RETURN n
Remove everything:
MATCH (n) DETACH DELETE n
Add constraint:
CREATE constraint ON (a:Asset) ASSERT a.assetRefId IS UNIQUE
In order of priority:
- Setup docker compose with Neo4j image in one container and node app in another
- Test connection between Node and Neo4j
- Build db query and prototype endpoint for creating the share + tests
- Build db query and prototype endpoint for getting assets shared with me + tests
- Build db query and prototype endpoint for deleting assets I own + tests
- Add district constraint to all queries
- Add input data validation
- Move from common.js to es modules with babel
- Use logger in place of console.logs
- Read settings from env vars (dotenv only for dev env loaded with babel)
- Add linter and prettier and use precommit hooks
- Refactor koa app, organize routes, create db abstraction
- Add CI with Jenkins pipeline
- Add unit / functional / integration tests
Notes:
- Tests should be independent from each other - use beforeAll/Each to populate db with seed data
- env vars handling
- [loading .env via babel plugin] motdotla/dotenv#133
- Jest mocks explained
$ npm run test:unit -- -- app/db/__tests__/connection.unit.test.js
Add --verbose
flag when running jest