{"id":18207612,"url":"https://github.com/brodev3/mongolog","last_synced_at":"2026-02-04T05:43:59.671Z","repository":{"id":259288587,"uuid":"875747559","full_name":"brodev3/MongoLog","owner":"brodev3","description":"MongoLog is a software solution for centralized storage of project, wallet, and log data from various sources. It is based on MongoDB using the Mongoose ORM and is divided into two main components: the server bot and the logging client.","archived":false,"fork":false,"pushed_at":"2024-11-09T10:46:02.000Z","size":22,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-03T23:49:39.992Z","etag":null,"topics":["log","logger","logging","mongodb","mongodb-atlas","mongoose"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/brodev3.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":"2024-10-20T18:34:25.000Z","updated_at":"2024-11-09T10:46:06.000Z","dependencies_parsed_at":"2024-10-24T04:56:34.831Z","dependency_job_id":"47441388-0475-424c-9caf-748a03fb8c9a","html_url":"https://github.com/brodev3/MongoLog","commit_stats":null,"previous_names":["brodev3/mongolog"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/brodev3/MongoLog","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brodev3%2FMongoLog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brodev3%2FMongoLog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brodev3%2FMongoLog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brodev3%2FMongoLog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/brodev3","download_url":"https://codeload.github.com/brodev3/MongoLog/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brodev3%2FMongoLog/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264257676,"owners_count":23580469,"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":["log","logger","logging","mongodb","mongodb-atlas","mongoose"],"created_at":"2024-11-03T13:03:41.798Z","updated_at":"2026-02-04T05:43:59.605Z","avatar_url":"https://github.com/brodev3.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MongoLog\n\n\u003cp\u003e\n      \u003cimg src=\"https://i.ibb.co/3sHQCSp/av.jpg\" \u003e\n\u003c/p\u003e\n\n\u003cp \u003e\n   \u003cimg src=\"https://img.shields.io/badge/build-v_1.0-brightgreen?label=Version\" alt=\"Version\"\u003e\n\u003c/p\u003e\n\n\n## About\n\nMongoLog is a software solution for centralized storage of project, wallet, and log data from various sources. It is based on MongoDB using the Mongoose ORM and is divided into two main components: the server bot and the logging client.\n\n\u003cp align=\"center\"\u003e\n      \u003cimg src=\"https://i.ibb.co/s38jxXf/1.gif\"\u003e\n\u003c/p\u003e\n\n## Features\n\n- Centralized storage of project, wallet, and log data.\n- Report generation in Excel format with easy filtering by date and project.\n- A simple and convenient Telegram bot interface for interacting with the system.\n\n\u003cp align=\"center\"\u003e\n      \u003cimg src=\"https://i.ibb.co/nz6R1MS/2.png\"\u003e\n\u003c/p\u003e\n\n## Server\n\nThe MongoLog server interacts with users via Telegram and generates reports based on data from the MongoDB database. The server supports:\n\n- **Collection check and creation**: On startup, the server checks the existence of collections (projects, wallets, logs) and creates them if needed.\n- **Action logging**: All server actions are logged to the console for easier debugging and monitoring.\n\n### Data Structure\n\n#### Wallets Collection\n\nStores information about wallets and associated projects:\n- **address**: The wallet address.\n- **addressLowCase**: The wallet address in lowercase for easier search.\n- **index**: The wallet index.\n- **projects**: An array of associated projects, each containing:\n  - **project_id**: The project identifier.\n  - **project_name**: The project name.\n  - **added_at**: The date the project was added.\n  - **metrics**: Metrics for the project, including points and the last updated date.\n- **balances**: Information about wallet balances for different assets.\n\n#### Logs Collection\n\nStores log entries related to wallets and projects:\n- **wallet**: The wallet address related to the log.\n- **project_name**: The name of the project associated with the log.\n- **level**: Log level (error, success, fatal, debug, info, warn).\n- **action**: The action performed.\n- **message**: The log message.\n- **stack_trace**: Stack trace for debugging errors.\n- **date**: The log creation date (logs expire after 90 days).\n\n#### Projects Collection\n\nStores information about projects:\n- **name**: The project name.\n- **wallet_ids**: Array of wallet identifiers associated with the project.\n- **created_at**: The project creation date.\n- **updated_at**: The date the project was last updated.\n\n## Telegram Bot\n\n\n\n\n\nThe server bot interacts with users via Telegram, providing an interface for requesting data and generating reports.\n\n- **Telegram Bot**: A simple interface for interacting with the user, allowing reports on stored data.\n- **Data Filtering**: Supports filtering data by date and project, making it easier to find specific information.\n- **Excel Report Generation**: Automatically generates reports in Excel format, saved in the program folder for further use.\n\n\u003cp align=\"center\"\u003e\n      \u003cimg src=\"https://i.ibb.co/8sBwfYV/1.png\" \u003e\n\u003c/p\u003e\n\n## Logging Client\n\nThe logging client collects and records logs, centralizing information about system activities. This is particularly useful for managing multiple programs and projects since all logs are stored in one place, making analysis and data access more efficient.\n\n- **Log Levels**: Supports various log levels (`error`, `success`, `fatal`, `debug`, `info`, `warn`), allowing efficient classification of events by importance.\n- **Console Output**: Each log is also output to the console with timestamps and log levels for real-time monitoring.\n- **Log Saving to MongoDB**: Logs are stored in the MongoDB database, providing centralized storage and easy access via Telegram bot and Excel reports.\n- **Backup to Text Files**: For additional security, logs are also saved to text files.\n- **Error Handling**: The client includes an error handler that records logs before a crash and sends a message to Telegram, helping to react quickly to issues.\n\n---\n\n# Installation and Setup Guide\n\n## 1. Create a Telegram Bot and Get a Token\n\n1. Open Telegram and find the **@BotFather** bot.\n2. Use the `/newbot` command to create a new bot and follow the instructions.\n3. After creating the bot, you will receive a **token**. Keep it safe as you'll need it later for configuration.\n\n## 2. Set Up a MongoDB Cluster and Obtain a Connection String\n\n1. Sign up at [MongoDB Atlas](https://www.mongodb.com/cloud/atlas).\n2. Create a new cluster and choose the default Free Tier configuration.\n3. After the cluster is created, go to the **Connect** tab and choose **Connect your application**.\n4. Copy the connection string that looks like this:\n   ```\n   mongodb+srv://USERNAME:PASSWORD@cluster0.mongodb.net/myFirstDatabase?retryWrites=true\u0026w=majority\n   ```\n   Replace `USERNAME` and `PASSWORD` with your MongoDB credentials.\n\n## 3. Configure the Project\n\n1. In the project folder, rename the file `configEXAMPLE.js` to `config.js`.\n2. Open the `config.js` file and update the following parameters:\n\n   ```javascript\n   module.exports = {\n     mongoDB: {\n       use: true,  // Set to true if you want to use MongoDB for logging\n       URI: \"mongodb+srv://USERNAME:PASSWORD@cluster0.mongodb.net/?retryWrites=true\u0026w=majority\",  // MongoDB connection string\n       project_name: \"Morph\"  // Name of the project for logging\n     },\n     TGbot: {\n       token: \"YOUR_TELEGRAM_BOT_TOKEN\",  // Telegram bot token\n       allowedUsers: [1234567890, 9876543210]  // Array of Telegram user IDs allowed to interact with the bot\n     }\n   };\n   ```\n\n- **mongoDB.use**: Set to `true` to enable MongoDB logging.\n- **mongoDB.URI**: MongoDB connection string from step 2.\n- **mongoDB.project_name**: The project name for logging.\n- **TGbot.token**: Your Telegram bot token from step 1.\n- **TGbot.allowedUsers**: Array of Telegram user IDs that are allowed to interact with the bot.\n\n## 4. Install Dependencies and Start the Project\n\n1. Node JS\n2. Clone the repository to your disk\n3. Launch the console (for example, Windows PowerShell)\n4. Specify the working directory where you have uploaded the repository in the console using the CD command\n    ```\n    cd C:\\Program Files\\brothers\n    ```\n5. Install packages\n   \n    ```\n    npm install\n    ```\n6. Run MongoLog\n    ```\n    node TGbot\n    ```\n\n## License\n\nProject **brodev3**/MongoLog distributed under the MIT license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrodev3%2Fmongolog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrodev3%2Fmongolog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrodev3%2Fmongolog/lists"}