-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsteps.txt
More file actions
122 lines (91 loc) · 4.93 KB
/
steps.txt
File metadata and controls
122 lines (91 loc) · 4.93 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
# Create the main solution
dotnet new sln -n EHR
# Domain Layer
dotnet new classlib -n EHR.Domain
dotnet sln add EHR.Domain/EHR.Domain.csproj
# Application Layer
dotnet new classlib -n EHR.Application
dotnet sln add EHR.Application/EHR.Application.csproj
# Infrastructure Layer
dotnet new classlib -n EHR.Infrastructure
dotnet sln add EHR.Infrastructure/EHR.Infrastructure.csproj
# API Layer
dotnet new webapi -n EHR.API
dotnet sln add EHR.API/EHR.API.csproj
# IdentityServer (Authorization Server)
dotnet new web -n EHR.IdentityServer
dotnet sln add EHR.IdentityServer/EHR.IdentityServer.csproj
# Test Projects
dotnet new xunit -n EHR.UnitTests
dotnet sln add EHR.UnitTests/EHR.UnitTests.csproj
dotnet new xunit -n EHR.IntegrationTests
dotnet sln add EHR.IntegrationTests/EHR.IntegrationTests.csproj
/src
/EHR.Api -> Controllers, Program.cs, Startup-style config
/EHR.Application -> Services, DTOs, interfaces for application layer
/EHR.Domain -> Entities, ValueObjects, Enums
/EHR.Infrastructure -> EF Core DbContext, Migrations, Repositories, Mappings
/EHR.Identity -> (IdentityServer project - will integrate later)
/Tests -> Unit & Integration tests
# Application depends on Domain
dotnet add EHR.Application/EHR.Application.csproj reference EHR.Domain/EHR.Domain.csproj
# Infrastructure depends on Application + Domain
dotnet add EHR.Infrastructure/EHR.Infrastructure.csproj reference EHR.Application/EHR.Application.csproj
dotnet add EHR.Infrastructure/EHR.Infrastructure.csproj reference EHR.Domain/EHR.Domain.csproj
# API depends on Application + Infrastructure
dotnet add EHR.API/EHR.API.csproj reference EHR.Application/EHR.Application.csproj
dotnet add EHR.API/EHR.API.csproj reference EHR.Infrastructure/EHR.Infrastructure.csproj
# IdentityServer depends on Infrastructure + Application
dotnet add EHR.IdentityServer/EHR.IdentityServer.csproj reference EHR.Infrastructure/EHR.Infrastructure.csproj
dotnet add EHR.IdentityServer/EHR.IdentityServer.csproj reference EHR.Application/EHR.Application.csproj
--------------------
dotnet add EHR.Infrastructure package Microsoft.EntityFrameworkCore
dotnet add EHR.Infrastructure package Microsoft.EntityFrameworkCore.SqlServer
dotnet add EHR.Infrastructure package Microsoft.EntityFrameworkCore.Design
dotnet add EHR.Infrastructure package Microsoft.EntityFrameworkCore.Tools
dotnet add EHR.Infrastructure package Microsoft.AspNetCore.Identity.EntityFrameworkCore
dotnet add EHR.Infrastructure package Microsoft.Extensions.Configuration.Binder
dotnet add EHR.Infrastructure package Microsoft.AspNetCore.SignalR
------------
dotnet add EHR.API package Swashbuckle.AspNetCore
dotnet add EHR.API package Microsoft.AspNetCore.Authentication.JwtBearer
dotnet add EHR.API package Microsoft.AspNetCore.SignalR
---------------
dotnet add EHR.IdentityServer package Duende.IdentityServer
dotnet add EHR.IdentityServer package Duende.IdentityServer.EntityFramework
dotnet add EHR.IdentityServer package Microsoft.AspNetCore.Identity.EntityFrameworkCore
dotnet add EHR.IdentityServer package Microsoft.EntityFrameworkCore.SqlServer
dotnet add EHR.IdentityServer package Microsoft.EntityFrameworkCore.Tools
--------------
dotnet add EHR.Application package FluentValidation
dotnet add EHR.Application package AutoMapper
dotnet add EHR.Application package MediatR.Extensions.Microsoft.DependencyInjection
----------------
dotnet add EHR.UnitTests package Moq
dotnet add EHR.UnitTests package FluentAssertions
dotnet add EHR.IntegrationTests package Microsoft.AspNetCore.Mvc.Testing
-------------------
dotnet tool install --global dotnet-ef
dotnet add EHR.API package Microsoft.EntityFrameworkCore.Design
dotnet ef migrations add InitialEhrSchema -p EHR.Infrastructure -s EHR.API --output-dir Migrations
--> if error remove first --> dotnet ef migrations remove -p EHR.Infrastructure -s EHR.API
dotnet ef database update -p EHR.Infrastructure -s EHR.API
--> if error remove first --> dotnet ef database update <InitialEhrSchema>
-----------------------
Generate the schema SQL:
dotnet ef migrations script -p EHR.Infrastructure -s EHR.API --output schema.sql
This will create a file schema.sql containing the full SQL script that EF applied to your database.
-----------------------
dotnet ef migrations add MakeAuditNullable -p EHR.Infrastructure -s EHR.API
dotnet ef database update -p EHR.Infrastructure -s EHR.API
-------------------------------
dotnet add EHR.IdentityServer package Microsoft.AspNetCore.Identity.UI
dotnet ef migrations add IdentitySchema -c ApplicationDbContext -o Data/Migrations
dotnet ef database update -c ApplicationDbContext
dotnet remove EHR.IdentityServer package Microsoft.AspNetCore.ApiAuthorization.IdentityServer
dotnet add EHR.IdentityServer package Microsoft.AspNetCore.Authentication.JwtBearer
------------------
# Create React + TypeScript + Vite project
npm create vite@latest ehr-ui --template react-ts
cd ehr-ui
npm install antd axios react-router-dom