App created by: Mateusz Budzisz, Wiktor Rostkowski, Sebastian Kreft, Damian Kreft.
Rider,Webstorm&Datagrip.NET 8.2 SDKMacOS, Linux, Windows.Node 20+MacOS and Linux, Windows.Pnpm 9+once you got node installed just run:corepack enable
Assuming you run latest Rider, Datagrip + Webstorm (though Visual Studio + VS code should work fine too)
git clone [email protected]:EngineerDiplomaTeam/city-map-planner.git
GitHub docs regarding ssh setup, as GitHub does not support password authentication anymore.cd Frontend && pnpm i --frozen-lockfile- Open Rider.
- Click Open from the top right corner of main window (if you have another project open, you can find this option inside file > open).
- Select
Backend.slnfrom/Backend. E.g.:/home/mate/city-map-planner/Backend/Backend.sln - Click green triangle next to WebApi: http from the top right corner of IDE.
- Open Webstorm.
- Click Open from the top right corner of main window (if you have another project open, you can find this option inside file > open).
- Select
/Frontenddirectory from repository. E.g.:/home/mate/city-map-planner/Frontend - Click green triangle next to Angular CLI Server from the top right corner of IDE.
- Open browser at https://localhost:4200/.
- Accept untrusted SSL certificate.
- Done. Every change you made in Frontend will be recompiled automatically, evey change you do to Backend needs manual restart (although both Rider and Visual Studio supports hot code swaps).
- Click Open from main DataGrip menu.
- Select whole
/Databasedirectory. E.g.:/home/mate/city-map-planner/Database. - On the left side pannel, right click on
[email protected] - Select Properties.
- Fill User & Password fields (optionally save password forever).
- Click Ok.
- Wait for introspection to finish.
- Go to Properties again.
- Go to Schemas tab.
- Expand city_planner
- Select data and user_data
- Click Ok.
- Wait for introspection to finish.
On production use city_planner_user which allows only local connections and does not require password.
- Follow this tutorial: https://www.twilio.com/en-us/blog/send-emails-using-the-sendgrid-api-with-dotnetnet-6-and-csharp
- Make
SendGridsection ofappsettings.jsonmatch your configuration - Paste access token to
SendGrid.ApiKey inappsettings.Development.json`
The default branch is main, it is protected from direct pushes.
- For your work please create new branch e.g.:
git checkout -b feature/my-awesome-feature. - Commit your changes to feature branch.
- PR will be validated:
- All unit tests must pass, although code coverage is not enforced.
- All build targets must compile.
- Code style is enforced, for Frontend run
pnpm ng lintlocally to see if your changes are compliant.
- Wait for approve.
- Once merged, GitHub actions will deploy application to https://city-planner.budziszm.pl/ within few minutes. You may track deployment via logs here.
- Initial setup user data:
dotnet ef migrations add InitialCreateUserData --project WebApi.Data/WebApi.Data.csproj --startup-project WebApi/WebApi.csproj --context UserDataDbContext - Initial setup data:
dotnet ef migrations add InitialCreateData --project WebApi.Data/WebApi.Data.csproj --startup-project WebApi/WebApi.csproj --context DataDbContext - Remove all migrations:
dotnet ef migrations remove --project WebApi.Data/WebApi.Data.csproj --startup-project WebApi/WebApi.csproj - Update user data:
dotnet ef database update --project WebApi.Data/WebApi.Data.csproj --startup-project WebApi/WebApi.csproj --context UserDataDbContext - Update data:
dotnet ef database update --project WebApi.Data/WebApi.Data.csproj --startup-project WebApi/WebApi.csproj --context DataDbContext - Run permission script after each migration:
../Database/structure.sql(Use DataGrip or psql)
- https://learn.microsoft.com/en-us/ef/core/get-started/overview/first-app?tabs=netcore-cli
- https://stackoverflow.com/a/71842300
- https://www.learnentityframeworkcore.com/configuration/fluent-api/model-configuration#schema
- https://learn.microsoft.com/en-us/aspnet/core/security/authentication/identity-api-authorization?view=aspnetcore-8.0
- TODO: https://learn.microsoft.com/en-us/aspnet/core/security/authentication/social/other-logins?view=aspnetcore-8.0
- TODO: https://learn.microsoft.com/en-us/aspnet/core/security/authentication/identity-enable-qrcodes?view=aspnetcore-8.0