It's forked from https://github.com/Giveth/apiGive
This is a microservice for managing notifications for both https://giveth.io and other Dapps notifications
nvm use
command to load appropriate Node version by nvm
)git clone git@github.com:Giveth/notification-center.git
cd notification-center
npm ci
docker-compose -f docker-compose-local-postgres-redis.ym up -d
development.env
based on Env example file and put it in ./config
npm start
You should have a postgress instance up in order to running tests so you can use Local DB docker-compose
npm run test
In localhost and test we put logs in console and file but in production and staging we just use file for writing logs You can see logs beautifully with this command
npm i -g bunyan
tail -f logs/notification-center.log | bunyan
typeorm migration:create ./migrations/createNotificationTable
npm run db:migrate:run:local
npm run db:migrate:revert:local
As we can't put inserting third parties in migration, I put a query sample here, we can use it in prod
INSERT INTO public.third_party(
"microService", secret, "isActive")
VALUES ('givethio', 'givethio_secret', true);
If you use mock jwt authentication adapter you can use accessToken
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwdWJsaWNBZGRyZXNzIjoiMHgxMUJFNTVGNGVBNDFFOTlBM2ZiMDZBRGRBNTA3ZDk5ZDdiYjBhNTcxIiwiZXhwaXJhdGlvbkRhdGUiOiIyMDIyLTA5LTIzVDA4OjA5OjA2LjQ1N1oiLCJqdGkiOiIxNjYxMzI4NTQ2NDU3LTc1YzNhNGI2YWUiLCJpYXQiOjE2NjEzMjg1NDYsImV4cCI6MTY2MzkyMDU0Nn0.Tdd2f7bCMtg3F1ojX1AQQpJ7smTU7vR7Nixromr0ju4
I used these articles for writing project