{"id":18484354,"url":"https://github.com/giveth/notification-center","last_synced_at":"2025-04-08T18:33:17.768Z","repository":{"id":46662108,"uuid":"513385022","full_name":"Giveth/notification-center","owner":"Giveth","description":"It's a microservice that would handle all notification of giveth.io and trace.giveth.io","archived":false,"fork":false,"pushed_at":"2024-12-04T16:03:58.000Z","size":707,"stargazers_count":24,"open_issues_count":12,"forks_count":2,"subscribers_count":17,"default_branch":"staging","last_synced_at":"2025-03-23T17:22:49.968Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Giveth.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-07-13T04:55:27.000Z","updated_at":"2024-11-22T08:20:49.000Z","dependencies_parsed_at":"2024-05-13T16:03:38.672Z","dependency_job_id":"7b95a474-87a2-45d8-9777-c2b4388178c1","html_url":"https://github.com/Giveth/notification-center","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Giveth%2Fnotification-center","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Giveth%2Fnotification-center/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Giveth%2Fnotification-center/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Giveth%2Fnotification-center/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Giveth","download_url":"https://codeload.github.com/Giveth/notification-center/tar.gz/refs/heads/staging","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247902837,"owners_count":21015530,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-06T12:39:28.784Z","updated_at":"2025-04-08T18:33:16.253Z","avatar_url":"https://github.com/Giveth.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"It's forked from https://github.com/Giveth/apiGive\n# Notification Center\nThis is a microservice for managing notifications for both https://giveth.io and other Dapps notifications\n\n[Used Technologies](#Used_Technologies)\n\n[Installation](#Installation)\n\n[Test](#Test)\n\n[Logs](#Logs)\n\n[Migrations](#Migrations)\n\n[References](#References)\n\n### Used_Technologies\n* Nodejs **v16** (You can use `nvm use` command to load appropriate Node version by `nvm`)\n* Typescript **v4.5.2**\n* DB: postgres **v14.2**\n* DB ORM: TypeORM **v0.3.6**\n* Redis **v5.0.9**\n* API protocol : REST\n* Web application: Express **v4.17.3**\n* Deployment: docker-compose **v3.3**\n* API Documentation: Swagger\n* Test framework: Mocha **v9.2.2**\n* CI/CD tools : [GitHub Actions](https://github.com/Giveth/notification-center/blob/staging/.github/workflows/CI-CD.yml)\n\n### Installation and Run\n\n* `git clone git@github.com:Giveth/notification-center.git`\n* `cd notification-center`\n* `npm ci`\n* Bringing up database, you can install that in other way, but I suggest\n  using docker `docker-compose -f docker-compose-local-postgres-redis.ym up -d`\n* Creat a file named `development.env` based on [Env example file](./config/example.env) and put it in `./config`\n* Run [Migrations](#Migrations)\n* `npm start`\n* Now you can browse [Swagger](http:localhost:3040/docs)\n\n### Test\nYou should have a postgress instance up in order to running tests so you can use  [Local DB docker-compose](./docker-compose-local-postgres-redis.ym)\n* `npm run test`\n\n### Logs\n\nIn 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\n\n* `npm i -g bunyan`\n* `tail -f logs/notification-center.log | bunyan`\n\n### Migrations\n\n#### Create new Migration file\n\n```\ntypeorm migration:create ./migrations/createNotificationTable\n```\n\n\n#### Then you need to run the migrations like so\n\n```\nnpm run db:migrate:run:local\n```\n\n#### If you want to revert last migration\n\n```\nnpm run db:migrate:revert:local\n```\n\n#### Create Third party in DB\nAs we can't put inserting third parties in migration, I put a query sample here, we can use it in prod\n\n```\n  INSERT INTO public.third_party(\n  \"microService\", secret, \"isActive\")\n  VALUES ('givethio', 'givethio_secret', true);\n```\n\n#### Local test\nIf you use mock jwt authentication adapter you can use accessToken\n```\neyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwdWJsaWNBZGRyZXNzIjoiMHgxMUJFNTVGNGVBNDFFOTlBM2ZiMDZBRGRBNTA3ZDk5ZDdiYjBhNTcxIiwiZXhwaXJhdGlvbkRhdGUiOiIyMDIyLTA5LTIzVDA4OjA5OjA2LjQ1N1oiLCJqdGkiOiIxNjYxMzI4NTQ2NDU3LTc1YzNhNGI2YWUiLCJpYXQiOjE2NjEzMjg1NDYsImV4cCI6MTY2MzkyMDU0Nn0.Tdd2f7bCMtg3F1ojX1AQQpJ7smTU7vR7Nixromr0ju4\n```\n\n## References\n\nI used these articles for writing project\n\n* https://blog.logrocket.com/linting-typescript-using-eslint-and-prettier\n\n* https://rsbh.dev/blog/rest-api-with-express-typescript\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgiveth%2Fnotification-center","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgiveth%2Fnotification-center","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgiveth%2Fnotification-center/lists"}