matcha-kontraktet-backend is an API that uses Slussen to get data about leases to detect if any lease is an illegal sublet by matching the contract data with Swedish folkbokföring through Syna or Creditsafe.
- Node.js installed preferably using nvm
- Docker installed
- Docker Compose installed
- access to GitHub Packages
- Matcha kontraktet uses PostgresQL that we run in docker
- Matcha kontraktet uses Slussen that we run in Docker.
- You need some configuration files as described in the Config section
- Create a personal token for GitHub Packages as described above and run
docker login https://docker.pkg.github.com
nvm use
npm i
docker-compose up -d
npm run migrate:up
npm run seed:dev
npm run dev
Go to http://localhost:9000/
Local config.json is needed for Syna credentials. Credentials are found in LastPass.
{
"syna": {
"username": "",
"customerNumber": ""
}
}
The other service for population registration is Creditsafe. Config options will be updated soon.
- Create new migration:
npx knex migrate:make <migration_name>
- Create new seed for dev:
npx knex seed:make $(date +%s)_<name> --env dev
- Reset (recreate and seed) dev db:
npm run reset:dev