{"id":25648669,"url":"https://github.com/stats4sd/ccrp-soils","last_synced_at":"2025-02-23T13:15:41.218Z","repository":{"id":37531750,"uuid":"187621331","full_name":"stats4sd/ccrp-soils","owner":"stats4sd","description":null,"archived":false,"fork":false,"pushed_at":"2023-07-14T15:48:06.000Z","size":64373,"stargazers_count":0,"open_issues_count":4,"forks_count":0,"subscribers_count":2,"default_branch":"dev","last_synced_at":"2024-04-11T19:44:34.629Z","etag":null,"topics":["agriculture-research","data-collection","laravel","soils-data"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stats4sd.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2019-05-20T10:43:39.000Z","updated_at":"2021-12-06T17:36:32.000Z","dependencies_parsed_at":"2023-02-12T03:45:53.498Z","dependency_job_id":"92f8e8c8-5c45-4b89-9d81-47da77e8d0bb","html_url":"https://github.com/stats4sd/ccrp-soils","commit_stats":{"total_commits":360,"total_committers":9,"mean_commits":40.0,"dds":0.4194444444444444,"last_synced_commit":"243f2335ac4875ca231ab9b88bbd19467c3a1b4e"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stats4sd%2Fccrp-soils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stats4sd%2Fccrp-soils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stats4sd%2Fccrp-soils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stats4sd%2Fccrp-soils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stats4sd","download_url":"https://codeload.github.com/stats4sd/ccrp-soils/tar.gz/refs/heads/dev","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240317440,"owners_count":19782390,"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":["agriculture-research","data-collection","laravel","soils-data"],"created_at":"2025-02-23T13:15:40.357Z","updated_at":"2025-02-23T13:15:41.097Z","avatar_url":"https://github.com/stats4sd.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CCRP Soils Data Platform\n\nThis soils platform is the result of a collaboration between the Soils and the Research Methods Support teams, a pair of cross-cutting projects from the Collaborative Crop Research Program (CCRP).\n\nhttps://soils.stats4sd.org/\n\n# Development\nThis platform is built using Laravel/PHP. The front-end is written in VueJS and the admin panel uses Backpack for Laravel.\n\n## Setup Local Environment\n1.\tClone repo: `git@github.com:stats4sd/ccrp-soils.git`\n2.\tCopy `.env.example` as a new file and call it `.env`\n3.\tUpdate variables in `.env` file to match your local environment:\n    1.\tCheck APP_URL is correct\n    2.\tUpdate DB_DATABASE (name of the local MySQL database to use), DB_USERNAME (local MySQL username) and DB_PASSWORD (local MySQL password)\n    3.\tIf you need to test the Kobo link, make sure QUEUE_CONNECTION is set to `database` or `redis` (and that you have redis setup locally). Also add your test KOBO_USERNAME and KOBO_PASSWORD\n    4.\tIf you need to test real email sending, update the MAIL_MAILER to mailgun, and copy over the Stats4SD Mailgun keys from 1 Password\n4.\tCreate a local MySQL database with the same name used in the `.env` file\n6.\tRun the following setup commands in the root project folder:\n```\ncomposer install\nphp artisan key:generate\nphp artisan backpack:install\nphp artisan telescope:publish\nnpm install\nnpm run dev\n```\n7.\tMigrate the database: `php aritsan migrate:fresh --seed` or copy from the staging site\n\n## Run Laravel Websockets \u0026 Queues\nTo run the local notifications, start up Laravel Websockets locally: `php artisan websockets:serve`. This runs the websockets server on localhost port 6001.\n\nTo test the job queue locally, run Horizon: `php artisan horizon`.\n\n## Add New Analysis Result to Data Download - Wide Format\nData download in wide format extracts data in one single sheet in excel file.\u003cbr/\u003e\nIt is achieved by extracting data from database view.\n\nThere is a \"base view\" called \"samples_merge\" for most of the projects.\u003cbr/\u003e\nThe CREATE VIEW SQL is stored in a manually created file database\\views\\samples_merged.sql.\n\nFor projects with specific data download requirement, the CREATE VIEW SQL is generated dynamically and executed when project is created or updated.\n\nWhen there is a new analysis result, update the \"base view\" SQL in two files:\n - database\\views\\samples_merged.sql\n - src\\App\\Http\\Controllers\\SampleMergedController.php\n\nThen run artisan command generatedbviews to re-generate database views.\n\n`php artisan generatedbviews`\n\n## Add New Analysis Result to Data Download - Split Format\nData download in split format extracts data in multiple sheets in excel file.\u003cbr/\u003e\nIndividual analysis result table is extracted as individual sheet in excel file.\n\nWhen there is a new analysis result, add new Export class for new analysis result table, then add the new Export class to SoilWorkbookExport.php.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstats4sd%2Fccrp-soils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstats4sd%2Fccrp-soils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstats4sd%2Fccrp-soils/lists"}