{"id":18781601,"url":"https://github.com/aboutlo/casval-gas-station","last_synced_at":"2025-12-19T10:30:15.900Z","repository":{"id":50250427,"uuid":"351230275","full_name":"aboutlo/casval-gas-station","owner":"aboutlo","description":null,"archived":false,"fork":false,"pushed_at":"2021-06-29T18:02:47.000Z","size":792,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-12-29T11:16:34.063Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/aboutlo.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-03-24T21:40:33.000Z","updated_at":"2021-06-29T18:01:59.000Z","dependencies_parsed_at":"2022-08-25T19:02:10.541Z","dependency_job_id":null,"html_url":"https://github.com/aboutlo/casval-gas-station","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aboutlo%2Fcasval-gas-station","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aboutlo%2Fcasval-gas-station/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aboutlo%2Fcasval-gas-station/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aboutlo%2Fcasval-gas-station/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aboutlo","download_url":"https://codeload.github.com/aboutlo/casval-gas-station/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239699244,"owners_count":19682537,"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-11-07T20:32:47.242Z","updated_at":"2025-12-19T10:30:15.867Z","avatar_url":"https://github.com/aboutlo.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# README\n\n## Prerequisites\n\n- Intstall https://ngrok.com/download\n- `brew install libpq` \u0026 `brew link --force libpq` (only for interact with AWS RDS)\n\n## Dev mode\n\n    docker-compose up\n    yarn build\n    yarn start\n\n### webhook \u0026 ngrok\n\nIn order to test in local the webhooks with the mobile app it's useful to expose the local instance via (ngrok)[https://ngrok.com/download]\n\n    ngrok http 8080\n\nThen in the `config.ts` file update `rampNetwork.kovan.webhookURL` with the ngrok url e.g. `http://bae108bc8677.ngrok.io/ramp-network`\n\nThis will bind the port 8080 to a public port via a proxy.\n\n## Crate a proxy from local to a Google Cloud SQL\n\nStaging\n\n    ./cloud_sql_proxy -instances=casval-308710:europe-west1:db-staging=tcp:5434\n\nProduction\n\n    ./cloud_sql_proxy -instances=casval-308710:europe-west1:db-prod=tcp:5435\n\n## Add a property to a model\n\n- Open `schema.prisma`\n- Add the property in a model e.g `fooId` as `String` in the Order entity or event a whole new entity\n\n```\nmodel Order {\n   fooId             String\n}\n```\n\n- Run `yarn db:migrate` this will ask for a migration name and generate all the required files\n- Run `yarn db:test:migrate` to apply the changes to the test database too\n\n## deploy\n\n- Create a connection to the `Staging` Postgresql `./cloud_sql_proxy -instances=casval-308710:europe-west1:db-staging=tcp:5434`\n- Run `yarn db:staging:migrate`\n- Commit and push to update the container\n\n## Continuous Deployment\n\n### Prerequisites\n\nInstall `aws`\n\n```bash\ncurl \"https://awscli.amazonaws.com/AWSCLIV2.pkg\" -o \"AWSCLIV2.pkg\"\nsudo installer -pkg AWSCLIV2.pkg -target /\n```\n\nConfigure `aws`\n\n    aws configure --profile ci\n\nask for the credentials of `ci`\n\ncreate a ECR repo (if doesn't exist)\n\n    aws ecr create-repository gas-station --profile ci\n\nbuild the image\n\n    docker build -t  345106504809.dkr.ecr.eu-west-1.amazonaws.com/gas-station:latest .\n\npush the image\n\n    aws ecr get-login-password --region eu-west-1 | docker login --username AWS --password-stdin 345106504809.dkr.ecr.eu-west-1.amazonaws.com\n\n## restore a db\n\n```bash\npsql --host database-stage.cpfuih3je3rv.eu-west-1.rds.amazonaws.com --port 5432 --username postgres  --dbname gas-station-staging\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faboutlo%2Fcasval-gas-station","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faboutlo%2Fcasval-gas-station","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faboutlo%2Fcasval-gas-station/lists"}