{"id":27168237,"url":"https://github.com/michaelpiper/automated-deposit-notification-system","last_synced_at":"2025-07-29T09:34:55.218Z","repository":{"id":170084827,"uuid":"646155004","full_name":"michaelpiper/automated-deposit-notification-system","owner":"michaelpiper","description":"An automated deposit notification system is a system designed to provide notifications or alerts whenever a deposit is made into a particular account. The system typically works as follows:  Account Setup: Deposit Monitoring:  Notification Triggers","archived":false,"fork":false,"pushed_at":"2023-07-06T08:19:36.000Z","size":273,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-09T05:32:22.703Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/michaelpiper.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2023-05-27T13:13:16.000Z","updated_at":"2023-05-31T08:17:32.000Z","dependencies_parsed_at":null,"dependency_job_id":"dbbb2f70-e54b-4f7e-995c-130fc7c86c1c","html_url":"https://github.com/michaelpiper/automated-deposit-notification-system","commit_stats":null,"previous_names":["michaelpiper/automated-deposit-notification-system"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/michaelpiper/automated-deposit-notification-system","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaelpiper%2Fautomated-deposit-notification-system","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaelpiper%2Fautomated-deposit-notification-system/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaelpiper%2Fautomated-deposit-notification-system/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaelpiper%2Fautomated-deposit-notification-system/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/michaelpiper","download_url":"https://codeload.github.com/michaelpiper/automated-deposit-notification-system/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaelpiper%2Fautomated-deposit-notification-system/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267662918,"owners_count":24123960,"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","status":"online","status_checked_at":"2025-07-29T02:00:12.549Z","response_time":2574,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":"2025-04-09T05:29:40.165Z","updated_at":"2025-07-29T09:34:55.205Z","avatar_url":"https://github.com/michaelpiper.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# \u003ca href=\"https://documenter.getpostman.com/view/9260774/2s93m7WgkM\"\u003eAPI DOCUMENTATION FOUND HERE\u003c/a\u003e\n###### https://documenter.getpostman.com/view/9260774/2s93m7WgkM\n\n\nTool and Technologies\n=====================\n1. Mac Book M1 macOS 13.2.1 \n2. Express Server ^4.18.2\n3. NodeJS v18.12.1\n4. Typescript ^5.0.4\n6. Redis ^5.3.2\n7. PM2 ^5.3.0\n\n# INSTALLATION GUIDE\n    To install and run the automated deposit notification system, follow these steps:\n\n##### Open the first terminal:\n\n    Run `npm install` or `yarn install` to install the required dependencies.\n    Once the installation is complete,\n\n##### Compile TypeScript to JavaScript:\n\n    After the dependencies are installed, you need to compile the TypeScript code into JavaScript before running the application.\n    In the first terminal, run `npm run build` or `yarn build`.\n    This command will compile the TypeScript files into JavaScript and generate the corresponding JavaScript files in the appropriate output directory.\n\n##### Start the application: \n    Execute  `npm run dev` or `yarn dev` to start the application using nodemon. \n    Nodemon is a development utility that automatically restarts the application whenever changes are detected in the source code. It helps in the development process by providing a more efficient workflow.\n\n    Execute or `npm start` or`yarn start` to start the application in production using PM2. PM2 will manage the application process, handle automatic restarts, and provide logging capabilities.\n    The application should now be up and running, and you can monitor the logs in the second terminal using npm run pm2 log or yarn pm2 log.\n\n##### Open the second terminal:\n    Run `npm run pm log` or `yarn pm log` in the second terminal. This command will start the application using PM2. PM2 is a process manager for Node.js applications that provides features like automatic restarts, monitoring, and logging. The log argument ensures that the logs of the running application are displayed in the terminal.\n    By following these steps, you will have the automated deposit notification system up and running using nodemon for development purposes and PM2 for process management. The first terminal is used to start the application, while the second terminal displays the application logs using PM2.\n\n\n# Application Directory Tree\n\n```\nsrc\n├── @api\n│   ├── loaders\n│   │   ├── index.ts\n│   │   └── server.ts\n│   └── notification\n│       ├── notification.controller.ts\n│       ├── notification.dto.ts\n│       ├── notification.middleware.ts\n│       ├── notification.model.ts\n│       ├── notification.route.ts\n│       ├── notification.service.ts\n│       └── notification.validation.ts\n├── @idp\n│   ├── loaders\n│   │   ├── index.ts\n│   │   └── server.ts\n│   └── user\n│       ├── user.controller.ts\n│       ├── user.dto.ts\n│       ├── user.middleware.ts\n│       ├── user.model.ts\n│       ├── user.route.ts\n│       ├── user.service.ts\n│       └── user.validation.ts\n├── @wallet\n│   ├── loaders\n│   │   ├── index.ts\n│   │   └── server.ts\n│   └── wallet\n│       ├── wallet.controller.ts\n│       ├── wallet.dto.ts\n│       ├── wallet.middleware.ts\n│       ├── wallet.model.ts\n│       ├── wallet.route.ts\n│       ├── wallet.service.ts\n│       └── wallet.validation.ts\n├── api.server.ts\n├── common\n│   ├── config\n│   │   └── index.ts\n│   ├── connections\n│   │   ├── index.ts\n│   │   ├── mail.ts\n│   │   ├── mongodb.ts\n│   │   └── redis.ts\n│   ├── constants.ts\n│   ├── dto\n│   │   └── pagination.dto.ts\n│   ├── interfaces\n│   │   ├── notification.interface.ts\n│   │   ├── pagination.interface.ts\n│   │   ├── responses.ts\n│   │   ├── user.interface.ts\n│   │   └── wallet.interface.ts\n│   ├── modules\n│   │   ├── mongooseAdapter.ts\n│   │   ├── redisAdapter.ts\n│   │   └── storage.ts\n│   ├── sdk\n│   │   ├── api.ts\n│   │   ├── idp.ts\n│   │   ├── queue.ts\n│   │   └── wallet.ts\n│   └── types.ts\n├── factories\n│   └── generic.error.ts\n├── idp.server.ts\n├── responses\n│   ├── artifacts\n│   │   └── success.artifact.ts\n│   ├── clientErrors\n│   │   ├── badRequest.clientError.ts\n│   │   ├── forbidden.clientError.ts\n│   │   ├── notFound.clientError.ts\n│   │   ├── unauthorized.clientError.ts\n│   │   └── unprocessableEntity.clientError.ts\n│   ├── errorHandler.ts\n│   └── serverErrors\n│       └── internalServerError.serverError.ts\n├── utils\n│   └── index.ts\n├── wallet.server.ts\n└── workers\n    ├── index.ts\n    ├── job-type.ts\n    ├── pots\n    │   └── notification.worker.ts\n    ├── start.ts\n    └── worker.wrapper.ts\n\n```\n## Explanation\n    An automated deposit notification system is a software system that is designed to automatically send notifications or alerts when deposits are made to a particular account. It utilizes various microservices and workers to handle different functionalities of the system.\n\n###### In this directory tree, we have the following main components:\n\n##### @api:\n    This directory contains the microservice responsible for handling API-related functionality. It includes loaders for initializing the server and the server itself. Additionally, there are files related to notifications, such as controllers, DTOs (Data Transfer Objects), middleware, models, routes, services, and validation.\n\n##### @idp: \n    This directory represents the microservice responsible for identity management. It includes loaders and user-related functionality, such as controllers, DTOs, middleware, models, routes, services, and validation.\n\n##### @wallet:\n    This directory represents the microservice responsible for wallet-related functionality. It includes loaders and wallet-related functionality, such as controllers, DTOs, middleware, models, routes, services, and validation.\n\n  - api.server.ts: This file is the entry point for the API microservice.\n\n    * [ ] common: This directory contains common functionality shared across different components of the system. It includes configurations, database connections, constants, DTOs for pagination, interfaces for notifications, pagination, responses, users, and wallets, modules for database adapters and storage, and SDKs for interacting with different services.\n\n    * [ ] factories: This directory contains a file related to generic error handling.\n\n    * [ ] idp.server.ts: This file is the entry point for the identity management microservice.\n\n    * [ ] responses: This directory contains files related to different types of responses, including success artifacts, client errors (e.g., bad request, forbidden, not found, unauthorized, unprocessable entity), error handling, and server errors (e.g., internal server error).\n\n    * [ ] utils: This directory contains utility files.\n\n    * [ ] wallet.server.ts: This file is the entry point for the wallet microservice.\n\n##### Workers: \n    This directory contains files related to background workers. It includes an index file, a job-type file, a start file, and a worker wrapper. \n    The pots directory within the workers directory contains a specific worker file (notification.worker.ts) related to sending deposit notifications.\n\n    The system uses these components to automate the process of sending notifications to users whenever a deposit is made, using both email and mobile notifications. \n    The microservices handle different aspects of the system, such as API handling, identity management, and wallet management. \n    The workers handle background tasks, such as sending notifications, which are performed asynchronously to ensure efficient processing of deposit notifications.\n\n    The automated deposit notification system utilizes two databases:\n\n##### Redis: \n    Redis is used as a queue server through the implementation of Kue.js. Kue.js is a job queue library for Node.js that allows for the processing of asynchronous tasks in the background. Redis, in this context, serves as the storage engine for the job queue. \n    The notification.worker.ts file likely contains code related to processing jobs from the queue, such as sending notifications or performing other tasks asynchronously. \n    Redis provides fast and efficient data storage and retrieval, making it suitable for managing the job queue in the system.\n\n##### MongoDB with Mongoose:\n    MongoDB is used as the main database, and Mongoose is employed as an Object Data Modeling (ODM) library for Node.js, providing a convenient interface for interacting with MongoDB.\n    Mongoose allows you to define schemas (as shown in the previous explanation) to structure and enforce rules on the data stored in MongoDB.\n    It provides a powerful set of features for querying, updating, and managing data in the database. In this system, Mongoose is likely used to store and retrieve various entities such as notifications, users, and wallets.\n\nBy using Redis as the queue server and MongoDB with Mongoose as the database, the automated deposit notification system can efficiently manage and process notifications asynchronously, while also persisting relevant data in a structured manner.\n\nBelow are Database Schema, The provided code snippets define Mongoose schemas, which are used in conjunction with MongoDB to define the structure and behavior of documents in a collection. Each schema represents a specific entity or object in the system and defines the fields, data types, and validation rules for that entity.\n\n### Notification Schema:\n - reference: A string field representing a reference associated with the notification.\n - userId: A field representing the user's unique identifier. It uses Schema.Types.ObjectId, which references the ObjectId type from Mongoose.\n -   amount: A numeric field representing the amount associated with the notification.\n -  status: A string field representing the status of the notification. It has a predefined set of values defined by the NotificationStatus enum. The default value is set to NotificationStatus.pending.\n -  type: A string field representing the type of the notification. It has a predefined set of values defined by the NotificationType enum.\n\n``` ts\nSchema\u003cINotification\u003e({\n  reference: String,\n  userId: Schema.Types.ObjectId,\n  amount: Number,\n  status: {\n    type: String,\n    values: Object.values(NotificationStatus),\n    default: NotificationStatus.pending\n  },\n  type: {\n    type: String,\n    values: Object.values(NotificationType)\n    required: true\n  }\n})\n\n```\n\n### User Schema:\n - name: A string field representing the user's name.\n - username: A string field representing the user's username.\n - deviceNotificationToken: A string field representing the user's device notification  token. It has a default value of null.\n - password: A string field representing the user's password.\n - email: A string field representing the user's email.\n - phone: A string field representing the user's phone.\n - type: A string field representing the type of user. It has a predefined set of values defined by the UserType enum.\n``` ts\nSchema\u003cIProtectedUser\u003e({\n  name: { type: String, required: true },\n  username: { type: String, required: true },\n  deviceNotificationToken: { type: String, default: null },\n  password: { type: String, required: true },\n  email: { type: String, required: true },\n  phone: { type: String, required: true },\n  type: {\n    type: String,\n    values: Object.values(UserType),\n    required: true\n  }\n})\n```\n\n### Wallet Schema:\n - userId: A field representing the user's unique identifier. It uses Schema.Types.ObjectId, which references the ObjectId type from Mongoose.\n - value: A numeric field representing the value of the wallet.\n - groupId: A field representing the group's unique identifier. It uses Schema.Types.ObjectId, which references the ObjectId type from Mongoose.\n - type: A string field representing the type of the wallet. It has a predefined set of values defined by the WalletType enum.\n\n\n``` ts\nSchema\u003cIWallet\u003e({\n  userId: Schema.Types.ObjectId,\n  value: Number,\n  groupId: Schema.Types.ObjectId,\n  type: {\n    type: String,\n    values: Object.values(WalletType)\n    required: true\n  }\n})\n\n```\nMore details about the application tree\n   - @api: This folder represents the API microservice.\n   \n    - loaders:  Contains files responsible for initializing and configuring the API microservice.\n\n    - notification: Contains files related to handling notifications, including controllers, DTOs (Data Transfer Objects), middleware, models, routes, services, and validation.\n\n   - @idp: This folder represents the Identity Provider microservice.\n\n    - loaders: Contains files responsible for initializing and configuring the Identity Provider microservice.\n\n    - user: Contains files related to user management, including controllers, DTOs, middleware, models, routes, services, and validation.\n\n   - @wallet: This folder represents the Wallet microservice.\n\n    - loaders: Contains files responsible for initializing and configuring the Wallet microservice.\n\n    - wallet: Contains files related to wallet management, including controllers, DTOs, middleware, models, routes, services, and validation.\n\n   - api.server.ts, idp.server.ts, wallet.server.ts: These files serve as the entry points for their respective microservices, responsible for starting the servers.\n\n   - common: This folder contains common components shared across microservices.\n\n   - config: Contains configuration files.\n\n   - connections: Contains files for establishing connections with external services such as mail, MongoDB, and Redis.\n\n   - constants.ts: Defines common constants used across the system.\n\n   - dto: Contains Data Transfer Objects used across microservices.\n\n   - interfaces: Contains interfaces defining structures for notifications, pagination, responses, users, and wallets.\n\n   - modules: Contains modules such as adapters for Mongoose (MongoDB) and Redis, as well as a storage module.\n\n   - sdk: Contains SDK files for interacting with external services like API, IDP, queue, and wallet.\n\n   - types.ts: Defines common types used throughout the system.\n\n   - factories: Contains a file named generic.error.ts, which likely represents a factory for creating generic error objects.\n\n   - responses: Contains files related to handling different types of responses from the microservices.\n\n   - artifacts: Contains a success artifact file.\n\n   - clientErrors: Contains client error files such as bad request, forbidden, not found, unauthorized, and unprocessable entity.\n\n   - errorHandler.ts: Handles errors and maps them to appropriate responses.\n\n   - serverErrors: Contains server error files, such as an internal server error.\n    utils: Contains utility functions that may be used throughout the system.\n\n   - workers: Contains files related to background workers responsible for handling specific tasks.\n\n    - index.ts: Entry point for the worker module.\n\n    - job-type.ts: Defines different job types that workers can handle.\n\n    - pots: Contains a file named notification.worker.ts, which likely represents a worker responsible for handling deposit notification tasks.\n\n    - start.ts: Starts the worker.\n\n    - worker.wrapper.ts: Wraps the worker logic.\n\n\n# TypeScript is a popular choice for projects like the automated deposit notification system due to several advantages it offers over plain JavaScript. Here are some reasons why TypeScript may have been used for this project:\n\n#### Static Typing: TypeScript introduces static typing to JavaScript, allowing you to define and enforce types for variables, function parameters, and return values. This helps catch type-related errors during development and provides better code quality and reliability.\n\n#### Enhanced Tooling and IDE Support: TypeScript provides improved tooling and IDE support compared to JavaScript. With TypeScript, you can leverage features like code completion, intelligent code navigation, and better refactoring support. This enhances productivity and makes development more efficient.\n\n#### Early Detection of Errors: TypeScript's static type checking catches errors early in the development process, even before running the code. This helps identify potential bugs and prevents runtime errors, leading to more robust and stable code.\n\n#### Improved Maintainability: By using TypeScript, you can write more expressive and self-documenting code. The addition of static types makes the codebase easier to understand, maintain, and refactor. It also helps in collaboration among team members by providing clear interfaces and contracts.\n\n#### Ecosystem and Community Support: TypeScript has a large and active community, with extensive support and a rich ecosystem of libraries and tools. This makes it easier to find resources, share code, and integrate with other frameworks and libraries.\n\n#### Migration and Scalability: If the project grows over time or requires integration with existing JavaScript codebases, TypeScript allows for easy migration. TypeScript is a superset of JavaScript, meaning you can gradually introduce TypeScript into your codebase without having to rewrite everything at once.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichaelpiper%2Fautomated-deposit-notification-system","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmichaelpiper%2Fautomated-deposit-notification-system","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichaelpiper%2Fautomated-deposit-notification-system/lists"}