Skip to content
This repository was archived by the owner on Apr 11, 2024. It is now read-only.

Commit a0e76a7

Browse files
feat(certificate-processing): add initial implementation (#404)
Add service scaffolding Co-authored-by: Ratan Sunder Parai <ratanparai@gmail.com>
1 parent 7f864bf commit a0e76a7

14 files changed

Lines changed: 206 additions & 0 deletions

File tree

docker-compose.override.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,13 @@ services:
2323
- "5102:80"
2424
- "5581:5001"
2525

26+
certificateprocessing.api:
27+
environment:
28+
- ASPNETCORE_ENVIRONMENT=Development
29+
- ASPNETCORE_URLS=http://0.0.0.0:80
30+
ports:
31+
- "5103:80"
32+
2633
webstatus:
2734
environment:
2835
- ASPNETCORE_ENVIRONMENT=Development

docker-compose.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,14 @@ services:
1515
depends_on:
1616
- sql.data
1717

18+
certificateprocessing.api:
19+
image: ${REGISTRY:-eschool}/certificateprocessing.api:${TAG:-latest}
20+
build:
21+
context: .
22+
dockerfile: src/Services/CertificateProcessing/CertificateProcessing.API/Dockerfile
23+
depends_on:
24+
- sql.data
25+
1826
webstatus:
1927
image: ${REGISTRY:-eschool}/webstatus:${TAG:-latest}
2028
build:

eSchool.sln

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Frontend.Blazor.Server", "s
4141
EndProject
4242
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Frontend.Blazor.Shared", "src\Web\Frontend.Blazor\Frontend.Blazor.Shared\Frontend.Blazor.Shared.csproj", "{4EB86635-CF79-4D15-909E-C41C98B0B586}"
4343
EndProject
44+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "CertificateProcessing", "CertificateProcessing", "{38032F91-9580-44DC-AF92-0F562D7126F8}"
45+
EndProject
46+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CertificateProcessing.API", "src\Services\CertificateProcessing\CertificateProcessing.API\CertificateProcessing.API.csproj", "{7C7B638F-A1E9-4908-91DD-4060E45F2CE5}"
47+
EndProject
4448
Global
4549
GlobalSection(SolutionConfigurationPlatforms) = preSolution
4650
Debug|Any CPU = Debug|Any CPU
@@ -195,6 +199,18 @@ Global
195199
{4EB86635-CF79-4D15-909E-C41C98B0B586}.Release|x64.Build.0 = Release|Any CPU
196200
{4EB86635-CF79-4D15-909E-C41C98B0B586}.Release|x86.ActiveCfg = Release|Any CPU
197201
{4EB86635-CF79-4D15-909E-C41C98B0B586}.Release|x86.Build.0 = Release|Any CPU
202+
{7C7B638F-A1E9-4908-91DD-4060E45F2CE5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
203+
{7C7B638F-A1E9-4908-91DD-4060E45F2CE5}.Debug|Any CPU.Build.0 = Debug|Any CPU
204+
{7C7B638F-A1E9-4908-91DD-4060E45F2CE5}.Debug|x64.ActiveCfg = Debug|Any CPU
205+
{7C7B638F-A1E9-4908-91DD-4060E45F2CE5}.Debug|x64.Build.0 = Debug|Any CPU
206+
{7C7B638F-A1E9-4908-91DD-4060E45F2CE5}.Debug|x86.ActiveCfg = Debug|Any CPU
207+
{7C7B638F-A1E9-4908-91DD-4060E45F2CE5}.Debug|x86.Build.0 = Debug|Any CPU
208+
{7C7B638F-A1E9-4908-91DD-4060E45F2CE5}.Release|Any CPU.ActiveCfg = Release|Any CPU
209+
{7C7B638F-A1E9-4908-91DD-4060E45F2CE5}.Release|Any CPU.Build.0 = Release|Any CPU
210+
{7C7B638F-A1E9-4908-91DD-4060E45F2CE5}.Release|x64.ActiveCfg = Release|Any CPU
211+
{7C7B638F-A1E9-4908-91DD-4060E45F2CE5}.Release|x64.Build.0 = Release|Any CPU
212+
{7C7B638F-A1E9-4908-91DD-4060E45F2CE5}.Release|x86.ActiveCfg = Release|Any CPU
213+
{7C7B638F-A1E9-4908-91DD-4060E45F2CE5}.Release|x86.Build.0 = Release|Any CPU
198214
EndGlobalSection
199215
GlobalSection(SolutionProperties) = preSolution
200216
HideSolutionNode = FALSE
@@ -217,6 +233,8 @@ Global
217233
{53F4E6F9-6B91-45F9-97F9-F6EFA0EBEFCE} = {0C00A596-0FE3-4FA6-B54B-FE2BE83371EF}
218234
{3BABD4D9-56A1-4BA3-B30C-30E6765AB389} = {0C00A596-0FE3-4FA6-B54B-FE2BE83371EF}
219235
{4EB86635-CF79-4D15-909E-C41C98B0B586} = {0C00A596-0FE3-4FA6-B54B-FE2BE83371EF}
236+
{38032F91-9580-44DC-AF92-0F562D7126F8} = {1C120673-72F4-4679-AC4C-68286E9091A5}
237+
{7C7B638F-A1E9-4908-91DD-4060E45F2CE5} = {38032F91-9580-44DC-AF92-0F562D7126F8}
220238
EndGlobalSection
221239
GlobalSection(ExtensibilityGlobals) = postSolution
222240
SolutionGuid = {E418719F-3193-403E-AF58-9BE9F94FD8BE}

src/ApiGateways/eSchool.GraphQL/Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ COPY "src/Services/Enrolling/Enrolling.Infrastructure/Enrolling.Infrastructure.c
1515
COPY "src/Services/Enrolling/Enrolling.UnitTests/Enrolling.UnitTests.csproj" "src/Services/Enrolling/Enrolling.UnitTests/Enrolling.UnitTests.csproj"
1616
COPY "src/Services/Enrolling/Enrolling.FunctionalTests/Enrolling.FunctionalTests.csproj" "src/Services/Enrolling/Enrolling.FunctionalTests/Enrolling.FunctionalTests.csproj"
1717

18+
COPY "src/Services/CertificateProcessing/CertificateProcessing.API/CertificateProcessing.API.csproj" "src/Services/CertificateProcessing/CertificateProcessing.API/CertificateProcessing.API.csproj"
19+
1820
COPY "src/Libraries/OpenTelemetry/OpenTelemetry.csproj" "src/Libraries/OpenTelemetry/OpenTelemetry.csproj"
1921

2022
COPY "src/Web/WebStatus/WebStatus.csproj" "src/Web/WebStatus/WebStatus.csproj"
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<Project Sdk="Microsoft.NET.Sdk.Web">
2+
3+
<PropertyGroup>
4+
<TargetFramework>net5.0</TargetFramework>
5+
</PropertyGroup>
6+
7+
<ItemGroup>
8+
<PackageReference Include="Swashbuckle.AspNetCore" Version="5.6.3" />
9+
</ItemGroup>
10+
11+
</Project>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
using Microsoft.AspNetCore.Mvc;
2+
3+
namespace CertificateProcessing.API.Controllers
4+
{
5+
[ApiController]
6+
[Route("[controller]")]
7+
public class HelloWorldController : ControllerBase
8+
{
9+
[HttpGet]
10+
public ActionResult<string> Ping()
11+
{
12+
return Ok("Pong");
13+
}
14+
}
15+
}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
FROM mcr.microsoft.com/dotnet/aspnet:5.0-buster-slim AS base
2+
WORKDIR /app
3+
EXPOSE 80
4+
5+
FROM mcr.microsoft.com/dotnet/sdk:5.0-buster-slim AS build
6+
WORKDIR /src
7+
8+
COPY "eSchool.sln" "eSchool.sln"
9+
10+
COPY "src/ApiGateways/eSchool.GraphQL/eSchool.GraphQL.csproj" "src/ApiGateways/eSchool.GraphQL/eSchool.GraphQL.csproj"
11+
12+
COPY "src/Services/Enrolling/Enrolling.API/Enrolling.API.csproj" "src/Services/Enrolling/Enrolling.API/Enrolling.API.csproj"
13+
COPY "src/Services/Enrolling/Enrolling.Domain/Enrolling.Domain.csproj" "src/Services/Enrolling/Enrolling.Domain/Enrolling.Domain.csproj"
14+
COPY "src/Services/Enrolling/Enrolling.Infrastructure/Enrolling.Infrastructure.csproj" "src/Services/Enrolling/Enrolling.Infrastructure/Enrolling.Infrastructure.csproj"
15+
COPY "src/Services/Enrolling/Enrolling.UnitTests/Enrolling.UnitTests.csproj" "src/Services/Enrolling/Enrolling.UnitTests/Enrolling.UnitTests.csproj"
16+
COPY "src/Services/Enrolling/Enrolling.FunctionalTests/Enrolling.FunctionalTests.csproj" "src/Services/Enrolling/Enrolling.FunctionalTests/Enrolling.FunctionalTests.csproj"
17+
18+
COPY "src/Services/CertificateProcessing/CertificateProcessing.API/CertificateProcessing.API.csproj" "src/Services/CertificateProcessing/CertificateProcessing.API/CertificateProcessing.API.csproj"
19+
20+
COPY "src/Libraries/OpenTelemetry/OpenTelemetry.csproj" "src/Libraries/OpenTelemetry/OpenTelemetry.csproj"
21+
22+
COPY "src/Web/WebStatus/WebStatus.csproj" "src/Web/WebStatus/WebStatus.csproj"
23+
24+
COPY "src/Web/Frontend.Blazor/Frontend.Blazor.Server/Frontend.Blazor.Server.csproj" "src/Web/Frontend.Blazor/Frontend.Blazor.Server/Frontend.Blazor.Server.csproj"
25+
COPY "src/Web/Frontend.Blazor/Frontend.Blazor.Client/Frontend.Blazor.Client.csproj" "src/Web/Frontend.Blazor/Frontend.Blazor.Client/Frontend.Blazor.Client.csproj"
26+
COPY "src/Web/Frontend.Blazor/Frontend.Blazor.Shared/Frontend.Blazor.Shared.csproj" "src/Web/Frontend.Blazor/Frontend.Blazor.Shared/Frontend.Blazor.Shared.csproj"
27+
28+
COPY "docker-compose.dcproj" "docker-compose.dcproj"
29+
30+
RUN dotnet restore eSchool.sln -nowarn:msb3202,nu1503
31+
32+
COPY . .
33+
WORKDIR /src/src/Services/CertificateProcessing/CertificateProcessing.API
34+
RUN dotnet build --no-restore -c Release -o /app/build
35+
36+
FROM build AS publish
37+
RUN dotnet publish --no-restore -c Release -o /app/publish
38+
39+
FROM base AS final
40+
WORKDIR /app
41+
COPY --from=publish /app/publish .
42+
ENTRYPOINT ["dotnet", "CertificateProcessing.API.dll"]
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
using Microsoft.AspNetCore.Hosting;
2+
using Microsoft.Extensions.Hosting;
3+
4+
namespace CertificateProcessing.API
5+
{
6+
public class Program
7+
{
8+
public static void Main(string[] args)
9+
{
10+
CreateHostBuilder(args).Build().Run();
11+
}
12+
13+
public static IHostBuilder CreateHostBuilder(string[] args) =>
14+
Host.CreateDefaultBuilder(args)
15+
.ConfigureWebHostDefaults(webBuilder =>
16+
{
17+
webBuilder.UseStartup<Startup>();
18+
});
19+
}
20+
}
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
using Microsoft.AspNetCore.Builder;
2+
using Microsoft.AspNetCore.Hosting;
3+
using Microsoft.Extensions.Configuration;
4+
using Microsoft.Extensions.DependencyInjection;
5+
using Microsoft.Extensions.Hosting;
6+
using Microsoft.OpenApi.Models;
7+
8+
namespace CertificateProcessing.API
9+
{
10+
public class Startup
11+
{
12+
public Startup(IConfiguration configuration)
13+
{
14+
Configuration = configuration;
15+
}
16+
17+
public IConfiguration Configuration { get; }
18+
19+
// This method gets called by the runtime. Use this method to add services to the container.
20+
public void ConfigureServices(IServiceCollection services)
21+
{
22+
services.AddControllers();
23+
services.AddSwaggerGen(c =>
24+
{
25+
c.SwaggerDoc(
26+
"v1",
27+
new OpenApiInfo
28+
{
29+
Title = "CertificateRegistration.API",
30+
Version = "v1",
31+
});
32+
});
33+
}
34+
35+
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
36+
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
37+
{
38+
if (env.IsDevelopment())
39+
{
40+
app.UseDeveloperExceptionPage();
41+
}
42+
43+
app.UseSwagger();
44+
app.UseSwaggerUI(
45+
c => c.SwaggerEndpoint(
46+
"/swagger/v1/swagger.json", "CertificateRegistration.API v1"));
47+
48+
app.UseRouting();
49+
50+
app.UseAuthorization();
51+
52+
app.UseEndpoints(endpoints =>
53+
{
54+
endpoints.MapControllers();
55+
});
56+
}
57+
}
58+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"Logging": {
3+
"LogLevel": {
4+
"Default": "Information",
5+
"Microsoft": "Warning",
6+
"Microsoft.Hosting.Lifetime": "Information"
7+
}
8+
}
9+
}

0 commit comments

Comments
 (0)