{"id":16064453,"url":"https://github.com/x-coders-team/example-dontent-service","last_synced_at":"2026-05-05T12:32:15.122Z","repository":{"id":220393860,"uuid":"751520583","full_name":"x-coders-team/example-dontent-service","owner":"x-coders-team","description":"This repository serves as a comprehensive example for building a robust service in .NET C#, showcasing best practices, CI/CD automation using GitHub Actions and Jenkinsfile, and organized codebase for a single domain.","archived":false,"fork":false,"pushed_at":"2024-02-04T17:02:14.000Z","size":36,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-05T09:23:43.658Z","etag":null,"topics":["csharp","csharp-api","csharp-code","dotnet","example","example-project","github-actions","jenkinsfile"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/x-coders-team.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-02-01T19:14:08.000Z","updated_at":"2024-02-02T14:41:32.000Z","dependencies_parsed_at":"2024-02-01T21:02:54.129Z","dependency_job_id":null,"html_url":"https://github.com/x-coders-team/example-dontent-service","commit_stats":null,"previous_names":["x-coders-team/example-dontent-service"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/x-coders-team/example-dontent-service","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/x-coders-team%2Fexample-dontent-service","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/x-coders-team%2Fexample-dontent-service/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/x-coders-team%2Fexample-dontent-service/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/x-coders-team%2Fexample-dontent-service/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/x-coders-team","download_url":"https://codeload.github.com/x-coders-team/example-dontent-service/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/x-coders-team%2Fexample-dontent-service/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32649537,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-05T11:29:49.557Z","status":"ssl_error","status_checked_at":"2026-05-05T11:29:48.587Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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":["csharp","csharp-api","csharp-code","dotnet","example","example-project","github-actions","jenkinsfile"],"created_at":"2024-10-09T05:07:56.975Z","updated_at":"2026-05-05T12:32:15.100Z","avatar_url":"https://github.com/x-coders-team.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Crontab registry\n\nThis is example service with one main domain\n\n# Index of content\n* [Project directory structure](#project-directory-structure)\n* [Code standards](#code-starndards)\n* [Testing](#testing)\n* [Docker](#docker)\n  * [Build image](#build-image)\n    * [Build image for Production](#build-image-for-production)\n    * [Build image for Development](#build-image-for-development)\n  * [Container create](#container-create)\n    * [Container create for Production](#container-create-for-production)\n    * [Container create for Development](#container-create-for-development)\n  * [Container start](#container-start)\n  * [Container restart](#container-restart)\n  * [Container destroy](#container-destroy)\n  * [Container Stop \u0026 Destroy](#container-stop--destroy)\n  * [Container run bash](#container-run-bash)\n  * [Logs for container](#logs-for-container)\n  * [Set secret on container](#set-secret-on-container)\n  * [Full commands](#full-commands)\n    * [Rebuild for development env](#rebuild-for-development-env)\n  * [Environments variables](#environments-variables)\n  * [Secrets in project](#secrets-in-project)\n* [How to setup local environment](#how-to-setup-local-environment)\n\n\n---\n\n\n# Project directory structure\nIn this section outlines the project's directory structure and its key components:\n\n+ __root__ - Root directory\n  + __.github__ - Directory containing configurations and workflows related to GitHub\n    + __workflows__ - Directory containing files related to GitHub Actions\n  + __doc__ - Directory containing additional documentation (.md files) for the project\n  + __docker__ - Directory containing configurations, additional files needed to build the image, and Dockerfile\n    + __scripts__ - Directory containing shell scripts required to build the image or run the container (e.g., entrypoint)\n  + __src__ - Directory containing the source code for the service or application\n  + __tests__ - Directory containing unit and integration tests necessary for verification\n\n\n\n# Code starndards\nThis section outlines the code standards followed in the repository, covering topics such as naming rules, naming conventions, and general code conventions. For more in-depth information, please refer to the dedicated document on code standards, accessible [here](doc/CODE-STANDARDS.md).\n\n\n# Testing\nAlmost all public methods should be covered by unit tests, and endpoints must be tested by integration tests. All tests related to unit testing should be placed in `./test/Unit`, and those related to integration testing should be placed in `./test/Integration`. Before creating a Docker image ready to deploy on a specific server, the pipeline should run tests before the building process. This prevents deploying an unstable service or application. You can run unit tests locally via an IDE or manually using the command line:\n\n__Run all tests in repository__\n```shell\ndotnet test\n```\n\n__Run only integration tests__\n```shell\ndotnet test ./tests/Integration/Integration.csproj\n```\n\n__Run only unit tests__\n```shell\ndotnet test ./tests/Integration/Unit.csproj\n```\n\n\n# Docker \nThis section provides insights into fundamental Docker commands for efficient container management.\n\n## Build image\nUtilize a Dockerfile to define application configurations and dependencies, creating portable images for seamless deployment across diverse environments.\n\n### Build image for Production\n```shell\ndocker image build -f ./docker/Dockerfile -t crontab-registry:production .;\n```\n\n\n### Build image for Development\n```shell\ndocker image build -f ./docker/Dockerfile.development -t crontab-registry:development .;\n```\n\n\n## Container create\nThis section details the usage of the docker container create command with specific parameters for creating a container named \"crontab-registry.\"\n\n### Container create for Production\n```shell\ndocker container create -it -p 18181:4500 --env-file=./.env -l com.salamonrafal.repository=\"crontab-registry\" -l com.salamonrafal.environment=\"production\" --name \"crontab-registry\" --restart always crontab-registry:production\n```\n\n### Container create for Development\n```shell\ndocker container create -it -p 18181:4500 --env-file=./.env -l com.salamonrafal.repository=\"crontab-registry\" -l com.salamonrafal.environment=\"development\" --name \"crontab-registry\" --restart always crontab-registry:development\n```\n\n\n## Container start\nThis section outlines the usage of the docker container start command, focusing on initiating the \"crontab-registry\" container.\n\n```shell\ndocker container start crontab-registry\n```\n\n\n## Container restart\nThis section provides a concise overview of utilizing the docker container restart command, emphasizing the restart action for the \"crontab-registry\" container.\n\n```shell\ndocker container restart crontab-registry\n```\n\n\n## Container stop\nThis section provides a brief overview of using the docker container stop command, focusing on halting the \"crontab-registry\" container.\n\n```shell\ndocker container stop crontab-registry\n```\n\n\n## Container destroy\nThis section offers a brief overview of using the docker container rm command, focusing on the removal of the \"crontab-registry\" container.\n\n```shell\ndocker container rm crontab-registry\n```\n\n### Container Stop \u0026 Destroy\nThis section provides a concise overview of using the combination of docker container stop and docker container rm commands to halt and remove the \"crontab-registry\" container.\n\n```shell\ndocker container stop crontab-registry \u0026\u0026 docker container rm crontab-registry\n```\n\n\n## Container run bash\nThis section provides a brief overview of using the docker exec command with the options -it to access the interactive shell of the \"crontab-registry\" container.\n```shell\ndocker exec -it crontab-registry bash\n```\n\n## Logs for container:\nGain insights into container behavior by leveraging the docker logs command. This tool allows you to retrieve real-time or historical log data, aiding in troubleshooting, debugging, and performance analysis. Understand how to efficiently monitor and interpret the output generated by running containers.\n\n```shell\ndocker logs crontab-registry\n```\n\n## Set secret on container\nThis section provides a brief overview of the command sequence designed to update configuration settings within the \"crontab-registry\" container using Docker commands.\n\n```shell\n( source '.env' \u0026\u0026 docker exec -it crontab-registry \\\n  dotnet user-secrets set \"CrontabRegistryDatabaseOptions:ConnectionString\" \"${CRONTAB_REGISTRY_MONGODB_CS_SECRETS}\" \\\n  --project ./src/CrontabRegistry/Application/Application.csproj \u0026\u0026 docker container restart crontab-registry );\n```\n\nThis sequence is designed to dynamically update the MongoDB connection string within the \"crontab-registry\" container, ensuring seamless integration of configuration changes without disrupting the overall application functionality.\n\n## Full commands\n\n### Rebuild for development env\nThis section details a command sequence designed to stop and remove the \"crontab-registry\" container, followed by rebuilding the container with updated configurations.\n\n```shell\ndocker container stop crontab-registry \u0026\u0026 docker container rm crontab-registry; \\\n  (source '.env' \\\n    \u0026\u0026 docker image build -f ./docker/Dockerfile.development -t crontab-registry:development . \\\n    \u0026\u0026 docker container create -it -p 18181:4500 --env-file=./.env -l com.salamonrafal.repository=\"crontab-registry\" -l com.salamonrafal.environment=\"development\" --name \"crontab-registry\" --restart always crontab-registry:development \\\n    \u0026\u0026 docker container start crontab-registry \\\n  );\n```\n\nThis sequence provides a comprehensive approach to update, rebuild, and restart the \"crontab-registry\" container with the latest configurations.\n\n\n# Environments variables\n* DOTENT_APP_CrontabRegistryDatabaseOptions__ConnectionString - You can pass to your application connection string to MongoDb\n* ASPNETCORE_ENVIRONMENT - You can set for which environment you deploy code. Options: Development, Production\n\n\n# Secrets in project \nNever commit variables such as passwords or other sensitive data to the repository. \nYou can handle such data in several ways:\n* Through environment variables (used in this project for deploying the application to a server), and you can read more about them [here](https://learn.microsoft.com/en-us/aspnet/core/fundamentals/configuration/?view=aspnetcore-8.0#non-prefixed-environment-variables)\n* Using user-secrets in dotnet, which is very useful during the development and testing phases. More information can be found [here](https://learn.microsoft.com/en-us/aspnet/core/security/app-secrets?view=aspnetcore-8.0\u0026tabs=linux)\n* By utilizing an application like Vault or a similar tool (the best solution where sensitive data is not stored directly without encryption). You can learn more [here](https://developer.hashicorp.com/vault/docs/what-is-vault)\n\n\n# How to setup local environment\nThis section should describe how to set up your local computer to run the service or application on it.\n\nIf you need to test your service without the integration process, you can simply use your IDE or a shell command like:\n\n```shell\ndotnet run --no-launch-profile --project src/CrontabRegistry/Application/\n```\n\nBut before running locally, you have to prepare secrets for access to the database. You can do this in your IDE or use the shell command below:\n\n```shell\ndotnet user-secrets set \"CrontabRegistryDatabaseOptions:ConnectionString\" \"\u003cCONNECTION_STRING_TO_MONGO_DB\u003e\" --project src/CrontabRegistry/Application/Application.csproj\n```\n\nWhere _**\u003cCONNECTION_STRING_TO_MONGO_DB\u003e**_ is a string containing the address and authentication for the MongoDB server, like: `mongodb://demouser:demopassword@localhost:27017/`","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fx-coders-team%2Fexample-dontent-service","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fx-coders-team%2Fexample-dontent-service","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fx-coders-team%2Fexample-dontent-service/lists"}