{"id":19100246,"url":"https://github.com/DevBetterCom/DevBetterWeb","last_synced_at":"2025-04-18T17:33:08.003Z","repository":{"id":37055455,"uuid":"152619864","full_name":"DevBetterCom/DevBetterWeb","owner":"DevBetterCom","description":"A simple web application for devBetter","archived":false,"fork":false,"pushed_at":"2024-09-11T20:33:47.000Z","size":167342,"stargazers_count":139,"open_issues_count":32,"forks_count":56,"subscribers_count":26,"default_branch":"main","last_synced_at":"2024-09-12T06:54:07.709Z","etag":null,"topics":["hacktoberfest"],"latest_commit_sha":null,"homepage":"https://devbetter.com/","language":"C#","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/DevBetterCom.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":null,"code_of_conduct":"CODE_OF_CONDUCT.md","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":"2018-10-11T16:07:43.000Z","updated_at":"2024-09-11T20:33:53.000Z","dependencies_parsed_at":"2024-01-05T20:45:06.682Z","dependency_job_id":"9307e5ae-df0d-4bf7-bbd0-d58ab46c6fb4","html_url":"https://github.com/DevBetterCom/DevBetterWeb","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DevBetterCom%2FDevBetterWeb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DevBetterCom%2FDevBetterWeb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DevBetterCom%2FDevBetterWeb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DevBetterCom%2FDevBetterWeb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DevBetterCom","download_url":"https://codeload.github.com/DevBetterCom/DevBetterWeb/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223783092,"owners_count":17201903,"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":["hacktoberfest"],"created_at":"2024-11-09T03:52:38.540Z","updated_at":"2025-04-18T17:33:07.992Z","avatar_url":"https://github.com/DevBetterCom.png","language":"C#","funding_links":[],"categories":["hacktoberfest","Architectural Style"],"sub_categories":["Clean Architecture"],"readme":"[![CI/CD Pipeline](https://github.com/DevBetterCom/DevBetterWeb/actions/workflows/ci-cd.yml/badge.svg)](https://github.com/ardalis/DevBetterWeb/actions)\n[![UptimeRobot Status](https://img.shields.io/uptimerobot/status/m781614473-ee8694b6320f5a9ae94ffd29)](https://devbetter.com/)\n![UptimeRobot 30-day Uptime](https://img.shields.io/uptimerobot/ratio/m781614473-ee8694b6320f5a9ae94ffd29)\n\n# DevBetterWeb\n\nA web application for devBetter.com, a developer coaching program web site and application.\n\n## What is devBetter?\n\nHead over to [devBetter.com](https://devbetter.com) to see the live site. Scroll through the home page and read the testimonials. Essentially devBetter is a group dedicated to improving professional software developers of all stripes. We have a virtual community (currently using Discord) and we meet for live group Q\u0026A sessions about once a week (currently using Zoom). We challenge and promote one another, answer tough code and software design questions, work through exercises, and more. This site is used as a playground by some members and its owner, ardalis, to provide a real, working example of some of the coding techniques and practices we discuss. This is in contrast to labs, katas, and exercises that, while also valuable, are not the same as solving real world problems with real software in a production environment.\n\n## Features\n\n- Register\n- Login\n- View Public Questions/Topics\n- Validate Accounts via Email (SendGrid)\n\n### Members Only\n\n- Update Profile\n- View Member List\n- View Recorded Coaching Sessions (backlog)\n- View Book Leaderboard (who has read more of the books the group agrees are worth reading)\n\n### Administrators Only\n\n- View Users\n- View Roles\n- Add/Remove Users to Role\n- Add/Remove Roles to User\n- Add/Remove Books\n- Update Member Subscription Dates\n- Update User email confirmation\n\n## Development Links\n\n- [Production Site](https://devbetter.com/)\n\n### Prerequisite\n\n- [.NET 7 SDK](https://dotnet.microsoft.com/en-us/download)\n- [The command-line interface (CLI) tools for Entity Framework Core](https://docs.microsoft.com/en-us/ef/core/cli/dotnet)\n\n### Building and Running the App Locally\n\nYou can both run the app manually by running the SQL migrations, or by using `docker-compose` see [this section](#run-with-docker)\n\n- Clone (or Fork and Clone) the repository locally\n- Run migrations for both AppDbContext and IdentityDbContext\n\n```powershell\n# RUN THIS FROM THE WEB PROJECT FOLDER\ndotnet ef database update -c appdbcontext -p ../DevBetterWeb.Infrastructure/DevBetterWeb.Infrastructure.csproj -s DevBetterWeb.Web.csproj\n\n# RUN THIS FROM THE INFRASTRUCTURE PROJECT FOLDER\ndotnet ef database update -c IdentityDbContext -s ..\\devbetterweb.web\\DevBetterWeb.Web.csproj\n```\n\nYou should be able to run the application at this point. The default password for seeded accounts is [here](https://github.com/DevBetterCom/DevBetterWeb/blob/master/src/DevBetterWeb.Core/AuthConstants.cs#L13). The default users created are [here](https://github.com/DevBetterCom/DevBetterWeb/blob/master/src/DevBetterWeb.Infrastructure/Identity/Data/AppIdentityDbContextSeed.cs). Members are created [the first time they visit their edit profile page](https://github.com/DevBetterCom/DevBetterWeb/blob/master/src/DevBetterWeb.Web/Pages/User/MyProfile/Index.cshtml.cs#L64).\n\nSome actions, such as registering a member, send email notifications. You should run a [local email emulator like SMTP4Dev or Papercut](https://ardalis.com/configuring-a-local-test-email-server/) to capture these, or configure your local environment to use a fake email sender class.\n\nYou should create an **appsettings.development.json** file to hold your other connection strings such as for Azure Storage. You can use [Azurite](https://github.com/Azure/Azurite) as a local emulator for this.\n\nFor the Discord web hook integration, you can use the `dev-test` channel in devBetter's Discord server. The web hook url is in the channel description on Discord. You can use that in you appsettings.development.json. Alternatively, you can set up your own Discord server - see [here](https://ardalis.com/add-discord-notifications-to-asp-net-core-apps/) for a walkthrough -  and add the url to  appsettings.development.json in the Discord Webhooks section that you can copy from appsettings.json. You could also create a mock server which will provide you with a url to use - an example is mocky.io\n\n### EF Migrations Commands\n\nAdd a new migration (from the DevBetter.Web folder):\n\n```powershell\ndotnet ef migrations add MIGRATIONNAME -c appdbcontext -p ../DevBetterWeb.Infrastructure/DevBetterWeb.Infrastructure.csproj -s DevBetterWeb.Web.csproj -o Data/Migrations\n```\n\nIf changes on the Identity then you need to Add a new migration (from the DevBetter.Web folder):\n\n```powershell\n dotnet ef migrations add MIGRATIONNAME -c IdentityDbContext -p ../DevBetterWeb.Infrastructure/DevBetterWeb.Infrastructure.csproj -s DevBetterWeb.Web.csproj -o Identity/Data/Migrations\n```\n\nUpdate AppDbContext model (from the DevBetter.Web folder):\n\n```powershell\ndotnet ef database update -c AppDbContext -p ../DevBetterWeb.Infrastructure/DevBetterWeb.Infrastructure.csproj -s DevBetterWeb.Web.csproj\ndotnet ef database update -c IdentityDbContext -p ../DevBetterWeb.Infrastructure/DevBetterWeb.Infrastructure.csproj -s DevBetterWeb.Web.csproj\n```\n\nGenerate Idempotent Update Script (for production)(from the DevBetter.Web folder):\n\n```powershell\ndotnet ef migrations script -c AppDbContext -i -o migrate.sql -p ../DevBetterWeb.Infrastructure/DevBetterWeb.Infrastructure.csproj -s DevBetterWeb.Web.csproj\n```\n\n### Run with Docker\n\nAlternatively you can use `docker-compose` to run the app locally. This is specially helpful when launching the app in operative systems that don't have support for SQL Express like MacOS.\n\nTo run with docker compose, simply run in the root of the repo:\n\n```bash\ndocker compose up\n```\n\nThe multi-container app runs two services:\n- The web project: at `http://localhost/`\n- The SQL Edge container at `localhost:1433`.\n\nBy default the application will run in the `Development` environment, and the SQL migrations will be applied programatically by the web project container during startup.\n\nIf you want to access the database outside of the app you will need the local password for the database, which you can find in this [.env file](https://github.com/DevBetterCom/DevBetterWeb/blob/main/.env). You can also find the full connection string as an environment variable for the web project with the name `ConnectionStrings:DefaultConnection` running in bash:\n\n```bash\ndocker inspect \\\n\t--format='{{range .Config.Env}}{{println .}}{{end}}' dev-better-web \\\n\t| grep \"ConnectionStrings:DefaultConnection=\" \\\n\t| cut -d '=' -f 2- \\\n\t| sed 's/database/localhost/g'\n```\n\nOr in PowerShell:\n\n```powershell\ndocker inspect `\n\t--format='{{range .Config.Env}}{{println .}}{{end}}' dev-better-web  `\n\t| Select-String \"ConnectionStrings:DefaultConnection=\" `\n\t| ForEach-Object { $_.Line -replace \"database\", \"localhost\" } `\n\t| ForEach-Object { ($_ -split \"Connection=\")[1] } \n```\n\nTo stop the services run:\n\n```bash\ndocker compose down\n```\n\n## Video Upload Instructions (admin only)\n\nPut the video files and their associated markdown files in a folder you wish to upload from. Specify the Vimeo token and devBetter API key.\n\nFor the API link, the production link should be the root web site, \u003chttps://devbetter.com/\u003e\n\n```powershell\n.\\DevBetterWeb.UploaderApp.exe -d [folder] -t [Vimeo token] -a [api link] -akey [api key]\n```\n\n## Stripe WebHook Development\nInstall ngrok for more information [here](https://ngrok.com) \n```powershell\n\tnpm install ngrok -g \n```\nIf there is any security issue while you using it then run this command on pwoershell\n```powershell\nSet-ExecutionPolicy -ExecutionPolicy Bypass -Scope CurrentUser\n```\nActive the forword by running this command\n```powershell\nngrok http 5010\n```\nSave the link https://xxx-xxx-xxx-xxx.ngrok.io and create WebHook on your stripe account with this link. \nYou need to check which version is supported by Stripe .NET and choose it while you creating the WebHook on your account.  \nCopy the WebHook Secret from edit WebHook and insert it on `appsettings.json` -\u003e `StripeOptions` -\u003e `StripeCustomerSubscriptionDeletedWebHookSecretKey`,  `StripeCustomerSubscriptionUpdatedWebHookSecretKey`, `StripeInvoicePaidWebHookSecretKey`.  \nMake DevBetter application using http without redirect by comment this line `app.UseHttpsRedirection();` from `startup.cs`.    \nOpen the application on `http://localhost:5010/`.   \nYou can check PaymentIntentWebHook endpoint for more information.    \n![stripe-WebHook-1](https://user-images.githubusercontent.com/6225593/190837378-17d772ef-8669-41b8-bad0-ff24cffb6260.png)\n![stripe-WebHook-2](https://user-images.githubusercontent.com/6225593/190837386-3b29fdfc-0617-4a4a-a01b-c2b724628bef.png)\n![stripe-WebHook-3](https://user-images.githubusercontent.com/6225593/190837393-139eb304-5dd1-46bc-9f31-dd2e6d468118.png)\n![stripe-WebHook-4](https://user-images.githubusercontent.com/6225593/190837398-f90d1b46-c1b2-445d-b303-095733441500.png)\n![stripe-WebHook-5](https://user-images.githubusercontent.com/6225593/190940284-06cd9861-6745-4902-9bbe-4f0131d38ac2.png)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDevBetterCom%2FDevBetterWeb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FDevBetterCom%2FDevBetterWeb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDevBetterCom%2FDevBetterWeb/lists"}