From 3df9b472555709292125d388b297b5b042ce82a7 Mon Sep 17 00:00:00 2001 From: Bilal Khan Date: Mon, 29 Apr 2024 14:05:14 +0500 Subject: [PATCH] updated the documentation of this project by adding the new file structure --- cmd/root.go | 2 +- docs/structure.md | 171 ++++++++++++++++++++++++---------------------- 2 files changed, 90 insertions(+), 83 deletions(-) diff --git a/cmd/root.go b/cmd/root.go index dfb0cca..4d0e0a9 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -9,7 +9,7 @@ import ( "github.com/spf13/cobra" ) -const version = "v0.1.94" +const version = "v0.1.95" // rootCmd represents the base command when called without any subcommands var RootCmd = &cobra.Command{ diff --git a/docs/structure.md b/docs/structure.md index 56e5833..6e67e37 100644 --- a/docs/structure.md +++ b/docs/structure.md @@ -1,68 +1,85 @@ - ./ + ./ ├── .github │ └── funding.yml ├── cmd │ ├── budget - │ │ ├── budget.go │ │ ├── handler │ │ │ ├── adjust.go │ │ │ ├── alert.go │ │ │ ├── create.go │ │ │ ├── get.go - │ │ │ ├── remove.go - │ │ │ └── view.go - │ │ ├── sub_handler - │ │ │ ├── msg.go │ │ │ ├── remove.go - │ │ │ ├── setup.go - │ │ │ ├── update.go │ │ │ └── view.go + │ │ ├── main.go + │ │ └── sub_handler + │ │ ├── msg.go + │ │ ├── remove.go + │ │ ├── setup.go + │ │ ├── update.go + │ │ └── view.go │ ├── init - │ │ └── init.go + │ │ └── main.go │ ├── spend │ │ ├── handler │ │ │ └── history.go - │ │ ├── sub_handler - │ │ │ ├── show.go - │ │ │ └── remove.go - │ │ └── spend.go - │ ├── total_amount - │ │ ├── total_amount.go - │ │ ├── handler - │ │ │ ├── add.go - │ │ │ ├── remove.go - │ │ │ ├── status.go - │ │ │ ├── update.go - │ │ │ └── view.go + │ │ ├── main.go │ │ └── sub_handler - │ │ ├── active.go - │ │ ├── inactive.go - │ │ ├── amount.go - │ │ ├── categories.go - │ │ └── check.go - │ └── root.go - ├── db - │ ├── alert_db - │ │ └── alert_db.go - │ ├── budget_db - │ │ ├── budget_db.go - │ │ └── history_db.go - │ ├── total_amount_db - │ │ ├── total_amount_db.go - │ │ └── total_amount_category.go - │ ├── migrations - │ │ ├── 001_create_budget_table.sql - │ │ ├── 002_create_alert_table.sql - │ │ └── 003_create_total_amount_table.sql - │ └── connection.go + │ │ ├── remove.go + │ │ └── show.go + │ └── total_amount + │ ├── handler + │ │ ├── add.go + │ │ ├── remove.go + │ │ ├── status.go + │ │ ├── update.go + │ │ └── view.go + │ ├── main.go + │ └── sub_handler + │ ├── active.go + │ ├── amount.go + │ ├── categories.go + │ ├── check.go + │ └── inactive.go + ├── common + │ └── utils + │ └── conversion.go ├── docs │ ├── commands.md │ └── structure.md - ├── email - │ ├── templates - │ │ └── alert.html - │ └── email.go - ├── internal + ├── entities + │ ├── alert.go + │ ├── budget.go + │ ├── email.go + │ ├── history.go + │ ├── init.go + │ ├── spend.go + │ └── total_amount.go + ├── framework_drivers + │ ├── db + │ │ ├── connection.go + │ │ ├── alert_db + │ │ │ └── alert_db.go + │ │ ├── budget_db + │ │ │ ├── budget_db.go + │ │ │ └── history_db.go + │ │ ├── migrations + │ │ │ ├── 001_create_budget_table.sql + │ │ │ ├── 002_create_alert_table.sql + │ │ │ └── 003_create_total_amount_table.sql + │ │ └── total_amount_db + │ │ ├── total_amount_category.go + │ │ └── total_amount_db.go + │ ├── email + │ │ ├── email.go + │ │ └── templates + │ │ └── alert.html + ├── tests + │ └── app + │ ├── alert + │ │ └── alert_test.go + │ └── budget + │ └── budget_test.go + ├── usecases │ ├── app │ │ ├── alert │ │ │ └── alert.go @@ -76,19 +93,8 @@ │ │ │ └── spend.go │ │ └── total_amount │ │ └── total_amount.go - │ ├── middleware - │ │ └── env.go - │ └── common - │ ├── functions - │ │ └── functions.go - │ └── structs - │ └── structs.go - ├── tests - │ └── app - │ ├── alert - │ │ └── alert_test.go - │ └── budget - │ └── budget_test.go + │ └── middleware + │ └── env_loader.go ├── .gitignore ├── .dockerignore ├── CODE_OF_CONDUCT.md @@ -105,7 +111,7 @@ ### Budget command files -- **cmd/budget/budget.go:** Budget service entry point. +- **cmd/budget/main.go:** Budget service entry point. - **cmd/budget/handler/adjust.go:** Handler for adjusting budget. - **cmd/budget/handler/alert.go:** Handler for alerting. - **cmd/budget/handler/create.go:** Handler for creating budget. @@ -123,7 +129,7 @@ ### Total amount command files -- **cmd/total_amount/total_amount.go:** The management of the total amount to set the target. +- **cmd/total_amount/main.go:** The management of the total amount to set the target. - **cmd/total_amount/handler/add.go:** Handler for adding the total amount. - **cmd/total_amount/handler/remove.go:** Handler for removing the total amount data. - **cmd/total_amount/handler/status.go:** Handler for handling the total amount's status. @@ -139,20 +145,20 @@ ### Other command files -- **cmd/init/init.go:** Flow initialization functionality. -- **cmd/spend/spend.go:** Spending money on various categories. +- **cmd/init/main.go:** Flow initialization functionality. +- **cmd/spend/main.go:** Spending money on various categories. - **cmd/spend/handler/history.go:** Show the transaction history. - **cmd/spend/sub_handler/show.go:** Show the history data. - **cmd/spend/sub_handler/remove.go:** Remove the history data. ### Database files -- **db/connection.go:** Database connection setup. -- **db/migrations/001_create_budget_table.sql:** SQL script for creating budget table. -- **db/migrations/002_create_alert_table.sql:** SQL script for creating alert table. -- **db/alert_db/alert_db.go:** CRUD operation for the alert functionanlity. -- **db/budget_db/budget_db.go:** CRUD operation for the budget functionanlity. -- **db/total_amount_db/total_amount_db.go:** CRUD operation for the total amount functionanlity. +- **framework_drivers/db/connection.go:** Database connection setup. +- **framework_drivers/db/migrations/001_create_budget_table.sql:** SQL script for creating budget table. +- **framework_drivers/db/migrations/002_create_alert_table.sql:** SQL script for creating alert table. +- **framework_drivers/db/alert_db/alert_db.go:** CRUD operation for the alert functionality. +- **framework_drivers/db/budget_db/budget_db.go:** CRUD operation for the budget functionality. +- **framework_drivers/db/total_amount_db/total_amount_db.go:** CRUD operation for the total amount functionality. ### Documentation files @@ -161,25 +167,26 @@ ### Email files -- **email/email.go:** Handling the email function. -- **email/templates/alert.html:** Email template for alert notification. +- **framework_drivers/email/email.go:** Handling the email functionality. +- **framework_drivers/email/templates/alert.html:** Email template for alert notification. ### App logic files -- **internal/app/alert/alert.go:** Logic for alert management functionality. -- **internal/app/budget/budget.go:** Logic for budget management functionality. -- **internal/app/init/init.go:** Logic for init functionality. -- **internal/app/spend/history.go:** Logic for handling the history. -- **internal/app/spend/spend.go:** Logic for transaction functionality. -- **internal/app/spend/notification.go:** Functions for setting the hourly, daily and more notifications. -- **internal/app/total_amount/total_amount.go:** Logic for handling the total amount data. -- **internal/common/functions/functions.go:** Contains functions that are not directly attached to a file structure. -- **internal/common/structs/structs.go:** Contains type structures for various functions. -- **internal/middleware/env.go:** Environment middleware for handling environment variables. +- **usecases/app/alert/alert.go:** Logic for alert management functionality. +- **usecases/app/budget/budget.go:** Logic for budget management functionality. +- **usecases/app/init/init.go:** Logic for init functionality. +- **usecases/app/spend/history.go:** Logic for handling the history. +- **usecases/app/spend/spend.go:** Logic for transaction functionality. +- **usecases/app/spend/notification.go:** Functions for setting the hourly, daily and more notifications. +- **usecases/app/total_amount/total_amount.go:** Logic for handling the total amount data. + +### Middleware files + +- **usecases/middleware/env_loader.go:** Environment middleware for handling environment variables. ### Testing files -- **tests/app/budget/alert_test.go:** Test file for handling the alert test functions. +- **tests/app/alert/alert_test.go:** Test file for handling the alert test functions. - **tests/app/budget/budget_test.go:** Test file for handling the budget test functions. ### Root files