{"id":22086268,"url":"https://github.com/probablyclem/green-got-exercice","last_synced_at":"2025-03-23T22:18:35.140Z","repository":{"id":182058375,"uuid":"667881488","full_name":"ProbablyClem/green-got-exercice","owner":"ProbablyClem","description":null,"archived":false,"fork":false,"pushed_at":"2023-07-26T15:54:31.000Z","size":94,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-29T05:28:28.610Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","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/ProbablyClem.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":"2023-07-18T14:07:59.000Z","updated_at":"2023-07-18T20:08:48.000Z","dependencies_parsed_at":null,"dependency_job_id":"a19f06b1-78ed-4831-8f96-50d00874b610","html_url":"https://github.com/ProbablyClem/green-got-exercice","commit_stats":null,"previous_names":["probablyclem/green-got-exercice"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ProbablyClem%2Fgreen-got-exercice","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ProbablyClem%2Fgreen-got-exercice/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ProbablyClem%2Fgreen-got-exercice/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ProbablyClem%2Fgreen-got-exercice/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ProbablyClem","download_url":"https://codeload.github.com/ProbablyClem/green-got-exercice/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245175550,"owners_count":20572797,"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":[],"created_at":"2024-12-01T01:22:48.288Z","updated_at":"2025-03-23T22:18:35.120Z","avatar_url":"https://github.com/ProbablyClem.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Data transformation service\nasynchrounous service that transform data from a kafka topic and send it to a webhook\n\n## Documentation\n### API\nApi documentation is available at http://green-got-load-balancer-1867801757.eu-west-3.elb.amazonaws.com/swagger-ui/#/\n\n# Run\nstart app with `docker-compose up --build`\nthis will start the service listening on port 80 and the kafka broker\n\n## Developpement environnement\n### Prerequisites\n    - docker\n    - docker-compose\n    - rust\n    - cmake (needed for the rdkafka client)\n### Run\n- run `docker-compose -f docker-compose-kafka.yaml up` to start kafka broker\n- run `cargo run` to start the service\n### Test\nrun `cargo test` to run the tests locally  \nrun `docker build -f Dockerfile.test .` to run the tests in a docker container (usefull for CI)\n\n### Environnement variables\nThis service use the following environnement variables :\n- KAFKA_HOST : kafka broker host\n- PORT : service port \n- WEBHOOK_URL : webhook url  \nThoses can be set in the .env file for local development and in the docker-compose file for production\n\n## Deployment\nA pipeline is configured to deploy the service on AWS EC2 instance on push to main branch\n\n[Click here to learn how to replicate the service](node-setup.md)\n# Consignes\nImplémentation d’un service de transformation de données.\n\n\nL’objectif métier est de recevoir des transactions bancaires et de les enrichir / transformer.\n\n\nLe flux de données est le suivant :\n\n\nLe service reçoit une transaction de la forme :\n```json\n{\n    \"clientId\": \"1234567890\",\n\n    \"amount\": {\n\n        \"value\": -10.22,\n\n        \"currency\": \"euros\",\n\n    },\n\n    \"counterpart\": \"SCNF VA122345 dt: 01/01/2020\",\n}\n```\n\n```json\n{\n\n    \"clientId\": \"1234567890\",\n\n    \"amount\": {\n\n        \"value\": 150,\n\n        \"currency\": \"euros\",\n\n    },\n\n    \"counterpart\": \"papa\",\n}\n```\n\n\n\nLes  transactions doivent être envoyée vers un event bus au moment de leur réception puis traitées en mode FIFO et renvoyées vers un webhook une fois la transaction modifiée pour donner ceci :\n\n```json\n{\n\n    \"clientId\": \"1234567890\",\n\n    \"amount\": {\n\n        \"value\": 1022,\n\n        \"currency\": \"EUR\",\n\n    },\n\n    \"counterpart\": \"SCNF\",\n\n    \"rawCounterpart\": \"SCNF VA122345 dt: 01/01/2020\",\n\n    \"logo\": \"/companies/logo-sncf.svg\"\n\n    \"direction\": \"DEBIT\"\n\n}\n```\n```json\n{\n    \"clientId\": \"1234567890\",\n\n    \"amount\": {\n\n        \"value\": 15000,\n\n        \"currency\": \"EUR\",\n\n    },\n\n    \"counterpart\": \"papa\",\n    \"direction\": \"CREDIT\"\n}\n```\n\nNotes :\n\n    La valeur est maintenant en centimes et toujours positive\n    La monnaie est normalisée\n    On a ajouté la direction sur crédit / débit basée sur le signe de l’amount initial\n    Le logo et la cible de la première transaction on été modifiée. Il n’y a probablement pas de façon élégante de faire ça.\n\n\nLe code à écrire est simple, ce n’est pas ce sur quoi porte le test. Il faut livrer un repo GitHub public et un déploiement (sur une EC2 du free tier AWS).\n\nArchi : Message queue FIFO  \nKafka  \nressources bonus :   \n- https://model-checking.github.io/kani/\n- https://github.com/verus-lang/verus\n  \nLes éléments évalués :\n\n\n    La documentation du repo est claire\n    On peut lancer le projet en local en une commande\n    On peut déployer le projet en une commande\n    On peut tester le projet en une commande\n    On a des TU et des tests d’intégration\n    Tout est dans la CI via des actions GitHub\n    L’application est dockerisée, cloud agnostic\n    L’organisation du repo est claire\n    On comprend vite comment il sera possible d’ajouter des règles métier et de use cases\n    Bonus : si le code génère de la documentation pour chaque règle métier implémentée (avec rustdoc possiblement)\n    Bonus : on a un process pour répliquer le service sur plusieurs datacenters\n    Bonus : le serveur est bien configuré ; un nginx avec plusieurs node qui tournent pour l’event bus et le serveur applicatif\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprobablyclem%2Fgreen-got-exercice","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprobablyclem%2Fgreen-got-exercice","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprobablyclem%2Fgreen-got-exercice/lists"}