{"id":42664699,"url":"https://github.com/code4romania/de-urgenta-backend","last_synced_at":"2026-01-29T10:01:53.180Z","repository":{"id":44712008,"uuid":"353318527","full_name":"code4romania/de-urgenta-backend","owner":"code4romania","description":"De Urgență backend - web \u0026 mobile","archived":false,"fork":false,"pushed_at":"2023-03-28T08:43:20.000Z","size":2955,"stargazers_count":10,"open_issues_count":5,"forks_count":22,"subscribers_count":10,"default_branch":"develop","last_synced_at":"2024-05-01T11:45:57.396Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://de-urgenta-backend.vercel.app/","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/code4romania.png","metadata":{"funding":{"github":"code4romania","custom":["https://code4.ro/en/donate/"]},"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null}},"created_at":"2021-03-31T10:34:29.000Z","updated_at":"2024-04-03T08:12:53.000Z","dependencies_parsed_at":"2022-09-05T02:50:41.062Z","dependency_job_id":"57f74a64-23de-4822-a4f8-42a899cc5214","html_url":"https://github.com/code4romania/de-urgenta-backend","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/code4romania/de-urgenta-backend","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/code4romania%2Fde-urgenta-backend","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/code4romania%2Fde-urgenta-backend/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/code4romania%2Fde-urgenta-backend/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/code4romania%2Fde-urgenta-backend/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/code4romania","download_url":"https://codeload.github.com/code4romania/de-urgenta-backend/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/code4romania%2Fde-urgenta-backend/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28875445,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-29T09:47:23.353Z","status":"ssl_error","status_checked_at":"2026-01-29T09:47:19.357Z","response_time":59,"last_error":"SSL_read: 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":[],"created_at":"2026-01-29T10:01:52.368Z","updated_at":"2026-01-29T10:01:53.161Z","avatar_url":"https://github.com/code4romania.png","language":"C#","funding_links":["https://github.com/sponsors/code4romania","https://code4.ro/en/donate/"],"categories":[],"sub_categories":[],"readme":"# De urgenta - Backend API\n\n[![GitHub contributors](https://img.shields.io/github/contributors/code4romania/de-urgenta-backend.svg?style=for-the-badge)](https://github.com/code4romania/de-urgenta-backend/graphs/contributors) [![GitHub last commit](https://img.shields.io/github/last-commit/code4romania/de-urgenta-backend.svg?style=for-the-badge)](https://github.com/code4romania/de-urgenta-backend/commits/master) [![License: MPL 2.0](https://img.shields.io/badge/license-MPL%202.0-brightgreen.svg?style=for-the-badge)](https://opensource.org/licenses/MPL-2.0)\n\n**Check out the [Wiki](https://github.com/code4romania/de-urgenta-backend/wiki)!**\n\nDe Urgență [was prototyped](https://civiclabs.ro/ro/solutions/stay-together) in [Code for Romania](https://code4.ro/ro)'s research project, [Civic Labs](https://civiclabs.ro/ro).\n\nThe application aims to inform citizens about how to react to the first critical hours in a crisis situation (like that of an earthquake).\n\nIt also aims to build healthy habits that become ingrained with time, so that, when the critical moment arrives, each person knows what the key first steps to keeping themselves safe are. \n\n## Contributing\n\nThis project is built by amazing volunteers and you can be one of them! Here's a list of ways in [which you can contribute to this project](https://github.com/code4romania/.github/blob/master/CONTRIBUTING.md). If you want to make any change to this repository, please **make a fork first**.\n\nIf you would like to suggest new functionality, open an Issue and mark it as a __[Feature request]__. Please be specific about why you think this functionality will be of use. If you can, please include some visual description of what you would like the UI to look like, if you are suggesting new UI elements. \n\n### Programming languages\n\n.NET 5.0 (C#)\n\n### Package managers\n\nNuGet\n\n### Database technology \u0026 provider\n\nPostgreSQL\n\n### API endpoints\n\n[Swagger](https://api.deurgenta.hostmysite.ro/swagger/index.html)\n\n## Repos and projects\n\n[Android repo](https://github.com/code4romania/de-urgenta-android)   \n[iOS repo](https://github.com/code4romania/de-urgenta-ios)   \n[Web app - frontend](https://github.com/code4romania/de-urgenta-client)   \n[Web app - backend](https://github.com/code4romania/de-urgenta-backend)   \n\n## Development Tips\n\n### Get started with docker-compose\n1. Navigate to `/src`\n2. Copy `.env.example` to `.env`\n3. Build images (optional - they will be built in step `4.` if they don't exist)\n    ```bash\n    docker-compose -p de-urgenta build\n    ```\n4. Start your containers\n    ```bash\n    docker-compose -p de-urgenta up -d\n    ```\n5. Navigate to http://localhost:5040/swagger\n\n\u003e we use `-p de-urgenta` to distinguish this compose project and you can skip it if you want. (it would inherit `src` otherwise - you probably have some of those already running)\n\n\u003e you can also specify a env file at runtime with docker-compose so you don't necessarily need to take step `2.` - more info [here](https://docs.docker.com/compose/environment-variables/#using-the---env-file--option)\n### Start a postgres server\n```\ndocker-compose -d up migrator postgres\n```\n\n### Creating a EF Core migration from console\n```\nde-urgenta-backend\\Src\u003e dotnet ef migrations add \u003cMigration-name\u003e --project DeUrgenta.Domain.Api --startup-project DeUrgenta.Api --context DeUrgentaContext\nde-urgenta-backend\\Src\u003e dotnet ef migrations add \u003cMigration-name\u003e --project DeUrgenta.Domain.Identity --startup-project DeUrgenta.Api --context UserDbContext\nde-urgenta-backend\\Src\u003e dotnet ef migrations add \u003cMigration-name\u003e --project DeUrgenta.Domain.I18n --startup-project DeUrgenta.Api --context I18nDbContext\nde-urgenta-backend\\Src\u003e dotnet ef migrations add \u003cMigration-name\u003e --project DeUrgenta.Domain.RecurringJobs --startup-project DeUrgenta.RecurringJobs --context JobsContext\n```\n\n### Domains migrator\nWe use a special project which will create databases (if not exists) and will apply migrations for every registered context.\nUse DeUrgenta.Domains.Migrator project to initialize an empty database.\n\n\n### Configuring storage\nIn order to store certification photos you will need to have either Local or S3 storage configured. Toggle between these two options by setting the *StorageService* app setting to the appropriate value.\n\nLocal storage needs no additional configuration. This option is suitable for development environments.\n\nS3 storage requires having an [AWS account configured](https://docs.aws.amazon.com/sdk-for-java/v1/developer-guide/setup-credentials.html), a bucket created and the following app settings:\n```\n\"S3ConfigOptions\": {\n    \"BucketName\": \"your-bucket-name\",\n    \"PresignedUrlExpirationInMinutes\": \"10\"\n  }\n```\n\n### Configuring recurring jobs\nRecurring jobs can be turned on or off or scheduled at different intervals by using the following configuration section in the RecurringJobs.sln appsettings.json file.\n```\n\"RecurringJobsConfig\": {\n    \"ExpiredCertificationJobConfig\": {\n      \"IsEnabled\": \"true\",\n      \"CronExpression\": \"0 0 * * *\",\n      \"DaysBeforeExpirationDate\": \"30\"\n    },\n    ...\n  },\n```\nEvery jobs will have at least the *IsEnabled* and *CronExpression* settings, but additional settings can be added as needed.\n\nUse [crontab](https://crontab.guru/) to generate valid cron expressions.\n\n### Using DB checkpoint for integration tests\nTo configure a DB to be cleaned after integration tests are run you can enable the *UseDbCheckpoint* option in the appsettings.testing.json\n```\n \"UseDbCheckpoint\" : \"true\"\n```\n\n### Using Localstack S3 emulator for local development\n\nFor local development against S3 when you don't have a bucket you can use the localstack emulator service present in the docker compose file. \n\nTo use this make sure to set the environment variable `STORAGESERVICE=S3` in your .env file. Then start the application as usual using `docker-compose up -d`.\nAfter starting you will need to create the bucket in the emulator via the following AWS CLI command:\n```\naws --endpoint-url=http://localhost:4566 s3 mb s3://de-urgenta-certifications\n```\nTo list buckets currently existing on your emulator use the following command:\n```\naws --endpoint-url=http://localhost:4566 s3 ls\n```\nand to list objects in a particular bucket use \n```\naws --endpoint-url=http://localhost:4566 s3 ls s3://de-urgenta-certifications\n```\nor navigate to the emulator's bucket endpoint in your browser (i.e. http://localhost:4566/de-urgenta-certifications).\nIf you want to also check the presigned URLs generated by the API add the following line to your hostfile:\n```\n127.0.0.1 deurgenta_localstack_s3\n```\n\nIn order to not use the emulator and use the actual S3 service, just set the `ServiceURL` environment variable to an empty string or delete it altogether.\n\n## Feedback\n\n* Request a new feature on GitHub.\n* Vote for popular feature requests.\n* File a bug in GitHub Issues.\n* Email us with other feedback contact@code4.ro\n\n## License\n\nThis project is licensed under the MPL 2.0 License - see the [LICENSE](LICENSE) file for details\n\n## About Code for Romania\n\nStarted in 2016, Code for Romania is a civic tech NGO, official member of the Code for All network. We have a community of around 2.000 volunteers (developers, ux/ui, communications, data scientists, graphic designers, devops, it security and more) who work pro-bono for developing digital solutions to solve social problems. #techforsocialgood. If you want to learn more details about our projects [visit our site](https://www.code4.ro/en/) or if you want to talk to one of our staff members, please e-mail us at contact@code4.ro.\n\nLast, but not least, we rely on donations to ensure the infrastructure, logistics and management of our community that is widely spread across 11 timezones, coding for social change to make Romania and the world a better place. If you want to support us, [you can do it here](https://code4.ro/en/donate/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcode4romania%2Fde-urgenta-backend","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcode4romania%2Fde-urgenta-backend","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcode4romania%2Fde-urgenta-backend/lists"}