{"id":23049904,"url":"https://github.com/phulelouch/catalyst_challenge","last_synced_at":"2026-05-08T19:31:08.365Z","repository":{"id":231111791,"uuid":"779244223","full_name":"phulelouch/catalyst_challenge","owner":"phulelouch","description":"This is a challenge by Catalyst IT AU. But I want this to also be a useful tools that can be use in real life to parse CSV contents into Mysql","archived":false,"fork":false,"pushed_at":"2024-04-02T14:28:00.000Z","size":95,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-23T18:58:54.281Z","etag":null,"topics":["docker","mysql","php","script"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/phulelouch.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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-03-29T11:24:35.000Z","updated_at":"2024-04-02T13:03:29.000Z","dependencies_parsed_at":null,"dependency_job_id":"44fe106f-8026-4007-adf1-55a2a917c0d7","html_url":"https://github.com/phulelouch/catalyst_challenge","commit_stats":null,"previous_names":["phulelouch/catalyst_challenge"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/phulelouch/catalyst_challenge","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phulelouch%2Fcatalyst_challenge","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phulelouch%2Fcatalyst_challenge/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phulelouch%2Fcatalyst_challenge/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phulelouch%2Fcatalyst_challenge/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phulelouch","download_url":"https://codeload.github.com/phulelouch/catalyst_challenge/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phulelouch%2Fcatalyst_challenge/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32794525,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-08T08:22:46.396Z","status":"ssl_error","status_checked_at":"2026-05-08T08:22:45.650Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["docker","mysql","php","script"],"created_at":"2024-12-15T23:18:00.330Z","updated_at":"2026-05-08T19:31:08.342Z","avatar_url":"https://github.com/phulelouch.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# User Upload Script\n\nThe user_upload.php is a CLI tools that accepts a CSV file as input (see command line directives below) and processes the CSV file. The parsed file data is to be inserted into a MySQL database.\nBeside all the basic requirements, the script also include these features:\n\n- [x] Can be run independently from host env with Docker\n- [x] Use directly with [docker run](#usage) \n- [x] Security implementation (SQL Injection, DOS)\n- [x] Test script to generate a CSV file for test\n- [x] Frontend web for easy testing\n\n## Table of Contents\n\n- [Catalyst Challenge](#catalyst_challenge)\n  - [Table of Contents](#table-of-contents)\n  - [Feature Completion Status](#features-completion-status)\n  - [Installation](#installation)\n    - [Database Credentials](#database-credentials)\n  - [Usage](#usage)\n    - [Asciicast Video](#video)\n  - [How to use the test script](#how-to-use-the-test-script)\n  - [How to use web](#how-to-use-web)\n\n## Feature Completion Status\n\n\nBelow is the list of features and their completion status. \n\n- [x] Create a Docker environment with Dockerfile the united with the Assumptions in the task (Ubuntu 22.04, Mysql)\n- [x] Perform basic requirements\n- [x] Apply Security measurement: DOS (import from CSV)\n- [x] Apply Security measurement: SQL Injection (import from CSV)\n- [ ] Apply Security measurement: OS Injection\n- [x] Generate test script \n- [x] A frontend web for easy test\n- [ ] Fix the database config, it is better to create a DBConfig class or create a .env\n- [ ] Implement based on OOP, like create a class User (though as I understand the task were to create a script)\n- [ ] Expose the docker so that it can insert into other Mysql database outside\n\n## Installation\nThere are 2 options:\n\n1. Install the assumptions environment: Ubuntu 22.04, php8.1, mysql\n\n2. Build the docker:\n   ```bash\n   #Build the docker\n   docker build -t catalyst .\n   ```\n### Database Credentials\n\n- Set default if not provided:\n\n```env\nDB_HOST=localhost \nDB_NAME=users\nDB_USER=phulelouch \nDB_PASSWORD=phulelouch\n```\n\n\n## Usage\n\n### VIDEO:\n*Please refer to this asciicast for easy installation and use*\n\n[![asciicast](https://asciinema.org/a/ERHWJtk7uQeMncFOaNID5Q0ah.svg)](https://asciinema.org/a/ERHWJtk7uQeMncFOaNID5Q0ah)\nIf the above doesn't load, click [here](https://asciinema.org/a/ERHWJtk7uQeMncFOaNID5Q0ah) to view the recording.\n\n\n1. Run with the assumptions environment\n\n2. Access the docker terminal and run the script:\n  - Access /bin/bash:\n  ```bash\n   #Access the terminal inside docker\n   docker run -it --rm catalyst /bin/bash\n   ```\n  - Run the script:\n   ```bash\n    php user_upload.php [options]  \n   ```\n\n3. Run the script directly\n\n*Note: This will not preserve the database since the database is in the docker as php script (all inside the Ubuntu docker).*\n*This is the assumptions I made: in case the database is outside of docker we can expose the docker and the script will still run as an independence tools.*\n\n  - Parse the argument into it directly:\n  ```bash\n    #Run directly like ... --help\n    docker run -it --rm catalyst --file test_data.csv\n  ```\n  - Tips:\n  ```bash\n    #Run alias to create a alias so that you don't have to type too many times\n    alias catalyst='docker run -it --rm catalyst'\n  ```\n\n\n## How to use the test script\n*In addition I create a script to create CSV file for testing. This script will add invalid special characters at random point to test the filters ability*\n\n ```bash\n    #File output at the location of running\n    php test/test.php\n```\nThe test csv name is: test_data.csv after that, use as normal and use the test_data.csv instead of users.csv\n\n## How to use web\n\nThe frontend is a simple features use php/html for testing the script faster\n\n ```bash\n    #expose port 3000\n    docker run -p 3000:3000 -it --rm catalyst web\n```\nOpen your browser at http://localhost:3000/\n\n\u003c!-- \u003cp align=\"center\"\u003e\n  \u003cimg src=\"web.png\" alt=\"Frontend example\"\u003e\n\u003c/p\u003e --\u003e\n\n## AI usage\n\nAI was use to help with:\n- Unknow syntax and functions like: ucfirst, getopt\n- Help with regex syntax\n- Help with creating test script\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphulelouch%2Fcatalyst_challenge","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphulelouch%2Fcatalyst_challenge","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphulelouch%2Fcatalyst_challenge/lists"}