- Copy
.env.dist
into.env
and fill the environment variables properly. - Copy
docker-compose.override.yml.dist
intodocker-compose.override.yml
and change things accordling
- Build the dev environment
docker-compose up -d --build
- Install needed packages
docker-compose exec nodejs npm install
- Start the server
docker-compose exec nodejs npm run dev
You can now connect to http://localhost:6060/meetups
Run docker-compose exec nodejs npm run lint
to check for linting errors.
Run docker-compose exec nodejs npm run lint:fix
to automatic fix common errors.
Run docker-compose exec nodejs npm run test
to run unit tests once.
Run docker-compose exec nodejs npm run test:watch
to run unit tests every time a file change.
The app is conteneraized and deploied in Heroku. Here the steps to build and release
npx heroku login
(log in to Heroku)npx heroku container:login
(log in to Heroku Container Registry)npx heroku container:push web -a criptup
(builds, then pushes Docker images to deploy your Heroku app)npx heroku container:release web -a criptup
(Releases previously pushed Docker images to your Heroku app)
The project has a running Ganache instance. This allow you to avoid using a distributed blockchain while developing (es: Mumbai, Rinkeby, ...)
To use set it up you need:
Run docker-compose logs ganache | grep Mnemonic
. You should get a response like
criptup.ganache | Mnemonic: myth like bonus scare over problem client lizard pioneer submit female collect
criptup.ganache | Mnemonic: myth like bonus scare over problem client lizard pioneer submit female collect
criptup.ganache | Mnemonic: myth like bonus scare over problem client lizard pioneer submit female collect
don't worry about the multiples lines. Is because you started the services more times.
Set the value of GANACHE_SEED
in the .env
like
GANACHE_SEED="asdasd asdasd asd asd as das"
Run
docker-compose exec nodejs npm run ganache:smart-contract:deploy
you will get a response like
> OrganizationFactory contract created:
0x5b1869D9A4C187F2EAa108f3062412ecf0526b24
You can set the community address in the .env
COMMUNITY_FACTORY_ADDRESS="0x5b1869D9A4C187F2EAa108f3062412ecf0526b24"