{"id":24312705,"url":"https://github.com/matheus1714/financial-data-storage","last_synced_at":"2025-06-19T23:38:21.190Z","repository":{"id":191662433,"uuid":"685073100","full_name":"Matheus1714/financial-data-storage","owner":"Matheus1714","description":"This repository contains a sample user transaction database over a period of 1 year.","archived":false,"fork":false,"pushed_at":"2023-09-06T00:42:46.000Z","size":146,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-16T11:51:20.898Z","etag":null,"topics":["docker","environment","neon","postgres","sql"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Matheus1714.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}},"created_at":"2023-08-30T13:10:48.000Z","updated_at":"2023-09-05T04:58:22.000Z","dependencies_parsed_at":"2023-08-31T01:28:36.498Z","dependency_job_id":null,"html_url":"https://github.com/Matheus1714/financial-data-storage","commit_stats":{"total_commits":40,"total_committers":2,"mean_commits":20.0,"dds":"0.025000000000000022","last_synced_commit":"f277d9112a0b1bd1e745962d817f37ef61f5ea6f"},"previous_names":["matheus1714/financial-data-storage"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Matheus1714/financial-data-storage","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Matheus1714%2Ffinancial-data-storage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Matheus1714%2Ffinancial-data-storage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Matheus1714%2Ffinancial-data-storage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Matheus1714%2Ffinancial-data-storage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Matheus1714","download_url":"https://codeload.github.com/Matheus1714/financial-data-storage/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Matheus1714%2Ffinancial-data-storage/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260851172,"owners_count":23072551,"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":["docker","environment","neon","postgres","sql"],"created_at":"2025-01-17T08:29:28.562Z","updated_at":"2025-06-19T23:38:16.176Z","avatar_url":"https://github.com/Matheus1714.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Financial Data Storage 📊\n\n![banner](.github/banner.png)\n\nThis repository contains a sample user transaction database over a period of 1 year.\n\n## Technologies 🛠️\n\n* Docker 🐳\n* Postgres 🐘\n* Python 🐍\n\n## Model Entity Relationship (MER) 🗄️\n\nThis project revolves around three key entities:\n\n1. **Customers** 👤: These are the bank's valued users.\n2. **Accounts** 💳: Represents user accounts across different banks.\n3. **Transactions** 📈: Captures user account transactions.\n\n![MER](.github/mer.png)\n\nDive into the `/sql/init.sql` file for a detailed `SQL` script with all entity definitions.\n\n## Running the Project 🚀\n\nTo run this project follow these steps:\n\n### Local Database\n\n1. Clone the repository from GitHub:\n\n```shell\ngit clone https://github.com/Matheus1714/financial-data-storage.git\n```\n\n2. Ensure you have [Docker](https://www.docker.com/) installed on your machine.\n\n3. Open your terminal and navigate to the project's root directory.\n\n4. Change the `.env.example` file to `.env`\n\n```env\nPG_CONNECTION_STRING=postgres://postgres:postgres@database:5432/finantialdb\n```\n\n5. Run the following command:\n\n```shell\ndocker-compose up --build\n```\n\nThis command orchestrates the magic defined in the `docker-compose.yaml` file. It'll spin up the database and populate it with the wealth of information encapsulated in the entity relationship model.\n\nThe database population process is orchestrated by the `mock_dataset.py` file.\n\n### Remote Database\n\n1. Follow step 1 from [Local Database](#local-database)\n\n2. Create an account at [https://console.neon.tech/](https://console.neon.tech/) and generate a database and tables with file `sql/init.sql`.\n\n3. Take connection url and add and replace in `.env` file:\n\n```env\nPG_CONNECTION_STRING=... // Add your remote connection string here\n```\n\n4. Install [virtualenv](https://pypi.org/project/virtualenv/) in python\n\n```shell\npip install virtualenv\n```\n\n5. Generate a virtual environment\n\n```\nvirtualenv venv\n```\n\n6. With the virtual environment active in the terminal, install the requirements file dependencies\n\n```\npip install -r requirements.txt\n```\n\n7. Run the `mock_dataset.py` file\n\n```shell\npython mock_dataset.py\n```\n\n## Accessing the Database 📡\n\nAccessing the database is a breeze! Connect using the following credentials:\n\n```python\nDB_USER = 'postgres'\nDB_PASSWORD = 'postgres'\nDB_NAME = 'finantialdb'\nBD_PORT = 2222\n```\n\nFor local runs, set the host as `localhost` or `0.0.0.0`.\n\nHungry for data insights? Simply visit `localhost:8080 `in your browser.\n\n![db_view](.github/db_view.png)\n\n## Docker Tasks at a Glance 🐋\n\n### Task: Configure the Database\n\n```yaml\ndatabase:\n    image: postgres\n    ports:\n      - \"2222:5432\"\n    environment:\n      POSTGRES_USER: postgres\n      POSTGRES_PASSWORD: postgres\n      POSTGRES_DB: finantialdb\n    command: [ \"postgres\", \"-c\", \"log_statement=all\" ]\n    restart: always\n    volumes:\n      - ./sql/init.sql:/docker-entrypoint-initdb.d/init.sql\n```\n\n### Task: Database Interface\n\n```yaml\nadminer:\n    image: adminer\n    restart: always\n    depends_on:\n      - database\n    ports:\n      - 8080:8080\n```\n\n### Task: Configure Mock Dataset\n\n```yaml\nmock_app:\n    build:\n      context: .\n      dockerfile: Dockerfile.mock_app  # Specify the Dockerfile for your mock app\n    depends_on:\n      - database\n```\n\n## License 📜\n\nThis project is open-source and is distributed under the MIT License. Feel free to explore, modify, and utilize the codebase according to the terms outlined in the license. 🤝🌟","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatheus1714%2Ffinancial-data-storage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmatheus1714%2Ffinancial-data-storage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatheus1714%2Ffinancial-data-storage/lists"}