Skip to content

Commit

Permalink
Change project structure
Browse files Browse the repository at this point in the history
  • Loading branch information
dyatlov-a committed Oct 7, 2023
1 parent 98d6557 commit 3beb7a5
Show file tree
Hide file tree
Showing 73 changed files with 92 additions and 92 deletions.
6 changes: 3 additions & 3 deletions Inc.TeamAssistant.sln
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

Microsoft Visual Studio Solution File, Format Version 12.00
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Inc.TeamAssistant.Appraiser.Backend", "src\Inc.TeamAssistant.Appraiser.Backend\Inc.TeamAssistant.Appraiser.Backend.csproj", "{61649230-BDDC-4916-BD91-76125E1297C3}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Inc.TeamAssistant.Gateway", "src\Inc.TeamAssistant.Gateway\Inc.TeamAssistant.Gateway.csproj", "{61649230-BDDC-4916-BD91-76125E1297C3}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Inc.TeamAssistant.Appraiser.Domain", "src\Inc.TeamAssistant.Appraiser.Domain\Inc.TeamAssistant.Appraiser.Domain.csproj", "{9F662515-1BAD-4BCC-B8EC-184124B163C4}"
EndProject
Expand Down Expand Up @@ -28,11 +28,11 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Inc.TeamAssistant.Appraiser
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Inc.TeamAssistant.Appraiser.DataAccess", "src\Inc.TeamAssistant.Appraiser.DataAccess\Inc.TeamAssistant.Appraiser.DataAccess.csproj", "{BCAEF60E-28CD-4315-8A95-2737F4FC18B1}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Inc.TeamAssistant.Appraiser.Migrations", "src\Inc.TeamAssistant.Appraiser.Migrations\Inc.TeamAssistant.Appraiser.Migrations.csproj", "{6E3EBCF7-4BA6-4635-B242-D5812775301C}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Inc.TeamAssistant.Migrations", "src\Inc.TeamAssistant.Migrations\Inc.TeamAssistant.Migrations.csproj", "{6E3EBCF7-4BA6-4635-B242-D5812775301C}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "migrations", "migrations", "{7683BC47-3CD1-4F24-8571-EF8E61340045}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Inc.TeamAssistant.Appraiser.MigrationsRunner", "src\Inc.TeamAssistant.Appraiser.MigrationsRunner\Inc.TeamAssistant.Appraiser.MigrationsRunner.csproj", "{AD512F03-E2F2-49A2-BA51-54845B229B9E}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Inc.TeamAssistant.MigrationsRunner", "src\Inc.TeamAssistant.MigrationsRunner\Inc.TeamAssistant.MigrationsRunner.csproj", "{AD512F03-E2F2-49A2-BA51-54845B229B9E}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "_build", "build\_build.csproj", "{85267DA4-474D-48B5-AD01-A3BCF5695CB7}"
EndProject
Expand Down
16 changes: 8 additions & 8 deletions build/Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ public sealed class Build : NukeBuild
private AbsolutePath TestsDirectory => RootDirectory / "tests";
private AbsolutePath TestReportsDirectory => OutputDirectory / "test-reports";

private readonly string _migrationRunnerProject = "Inc.TeamAssistant.Appraiser.MigrationsRunner";
private readonly IEnumerable<string> _appProjects = new[] { "Inc.TeamAssistant.Appraiser.Backend" };
private readonly string _migrationRunnerProject = "Inc.TeamAssistant.MigrationsRunner";
private readonly IEnumerable<string> _appProjects = new[] { "Inc.TeamAssistant.Gateway" };

private IEnumerable<string> ProjectsForPublish => _appProjects.Concat(_migrationRunnerProject);

Expand Down Expand Up @@ -122,14 +122,14 @@ public sealed class Build : NukeBuild
.SetProcessWorkingDirectory(RootDirectory)
.SetPath(".")
.SetFile("cicd/dockerfile.app_component")
.SetTag(GetImageName("inc.teamassistant.appraiser")));
.SetTag(GetImageName("inc.teamassistant.gateway")));

DockerBuild(x => x
.DisableProcessLogOutput()
.SetProcessWorkingDirectory(RootDirectory)
.SetPath(".")
.SetFile("cicd/dockerfile.migrations_runner")
.SetTag(GetImageName("inc.teamassistant.appraiser.migrationsrunner")));
.SetTag(GetImageName("inc.teamassistant.migrationsrunner")));
});

Target PushImages => _ => _
Expand All @@ -142,10 +142,10 @@ public sealed class Build : NukeBuild
.DisableProcessLogOutput());

DockerPush(s => s
.SetName(GetImageName("inc.teamassistant.appraiser"))
.SetName(GetImageName("inc.teamassistant.gateway"))
.DisableProcessLogOutput());
DockerPush(s => s
.SetName(GetImageName("inc.teamassistant.appraiser.migrationsrunner"))
.SetName(GetImageName("inc.teamassistant.migrationsrunner"))
.DisableProcessLogOutput());
});

Expand All @@ -154,8 +154,8 @@ public sealed class Build : NukeBuild
.Executes(() =>
{
var appDirectory = "/home/inc_teamassistant_appraiser/prod";
var appraiserImage = GetImageName("inc.teamassistant.appraiser");
var migrationsRunnerImage = GetImageName("inc.teamassistant.appraiser.migrationsrunner");
var appraiserImage = GetImageName("inc.teamassistant.gateway");
var migrationsRunnerImage = GetImageName("inc.teamassistant.migrationsrunner");

using var client = new SshClient(ServerName, ServerUsername, ServerPassword);

Expand Down
12 changes: 6 additions & 6 deletions cicd/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,22 @@ services:
- 80:80
- 443:443
depends_on:
- appraiser_backend
- gateway
networks:
- team_assistant
restart: unless-stopped
volumes:
- /home/inc_teamassistant_appraiser/nginx.conf:/etc/nginx/nginx.conf
- /home/inc_teamassistant_appraiser/ssl/:/ssl/

appraiser_backend:
image: dyatlovhome/inc.teamassistant.appraiser:latest
gateway:
image: dyatlovhome/inc.teamassistant.gateway:latest
environment:
- ASPNETCORE_ENVIRONMENT=Production
- TelegramBotOptions__AccessToken=
- CheckInOptions__AccessToken=
- ReviewerOptions__AccessToken=
container_name: appraiser_backend
container_name: gateway
expose:
- 8080
# ports:
Expand All @@ -32,7 +32,7 @@ services:
restart: unless-stopped

migrate:
image: dyatlovhome/inc.teamassistant.appraiser.migrationsrunner:latest
image: dyatlovhome/inc.teamassistant.migrationsrunner:latest
container_name: migrate
command: [ "migrate", "Host=database;Port=5432;Database=appraiser;User Id=postgres;Password=[hidden]" ]
depends_on:
Expand All @@ -42,7 +42,7 @@ services:
- team_assistant

# create:
# image: dyatlovhome/inc.teamassistant.appraiser.migrationsrunner:latest
# image: dyatlovhome/inc.teamassistant.migrationsrunner:latest
# container_name: create
# command: [ "create", "Host=database;Port=5432;User Id=postgres;Password=[hidden]", "[hidden]" ]
# depends_on:
Expand Down
4 changes: 2 additions & 2 deletions cicd/dockerfile.app_component
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ RUN mkdir -p ${APP_DIR} \
&& chmod 700 ${APP_DIR}

# copy already builded project
COPY --chown=${APP_USER}:${APP_USER} ./output/Inc.TeamAssistant.Appraiser.Backend ${APP_DIR}
COPY --chown=${APP_USER}:${APP_USER} ./output/Inc.TeamAssistant.Gateway ${APP_DIR}
WORKDIR ${APP_DIR}

# post install commands
Expand All @@ -29,4 +29,4 @@ RUN rm -f *.sh *.crt \
# Run app as non root user
USER ${APP_USER}

ENTRYPOINT ["dotnet", "Inc.TeamAssistant.Appraiser.Backend.dll"]
ENTRYPOINT ["dotnet", "Inc.TeamAssistant.Gateway.dll"]
4 changes: 2 additions & 2 deletions cicd/dockerfile.migrations_runner
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ RUN mkdir -p ${APP_DIR} \
&& chmod 700 ${APP_DIR}

# copy already builded project
COPY --chown=${APP_USER}:${APP_USER} ./output/Inc.TeamAssistant.Appraiser.MigrationsRunner ${APP_DIR}
COPY --chown=${APP_USER}:${APP_USER} ./output/Inc.TeamAssistant.MigrationsRunner ${APP_DIR}
WORKDIR ${APP_DIR}

# post install commands
Expand All @@ -24,5 +24,5 @@ RUN rm -f *.sh \
# Run app as non root user
USER ${APP_USER}

ENTRYPOINT ["dotnet", "Inc.TeamAssistant.Appraiser.MigrationsRunner.dll"]
ENTRYPOINT ["dotnet", "Inc.TeamAssistant.MigrationsRunner.dll"]
CMD []
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Inc.TeamAssistant.Primitives;

namespace Inc.TeamAssistant.Appraiser.Backend;
namespace Inc.TeamAssistant.Gateway;

internal static class CheckInMessages
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Inc.TeamAssistant.Appraiser.Backend;
namespace Inc.TeamAssistant.Gateway;

internal static class CommandList
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Inc.TeamAssistant.Appraiser.Model;
using Microsoft.AspNetCore.Mvc;

namespace Inc.TeamAssistant.Appraiser.Backend.Controllers;
namespace Inc.TeamAssistant.Gateway.Controllers;

[ApiController]
[Route("sessions")]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Inc.TeamAssistant.CheckIn.Model;
using Microsoft.AspNetCore.Mvc;

namespace Inc.TeamAssistant.Appraiser.Backend.Controllers;
namespace Inc.TeamAssistant.Gateway.Controllers;

[ApiController]
[Route("check-in")]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Inc.TeamAssistant.Appraiser.Model;
using Microsoft.AspNetCore.Mvc;

namespace Inc.TeamAssistant.Appraiser.Backend.Controllers;
namespace Inc.TeamAssistant.Gateway.Controllers;

[ApiController]
[Route("resources")]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System.Text;
using FluentValidation;

namespace Inc.TeamAssistant.Appraiser.Backend.Extensions;
namespace Inc.TeamAssistant.Gateway.Extensions;

internal static class ValidationExceptionExtensions
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Inc.TeamAssistant.Appraiser.Backend.Hubs;
namespace Inc.TeamAssistant.Gateway.Hubs;

public interface IMessagesHubClient
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Microsoft.AspNetCore.SignalR;

namespace Inc.TeamAssistant.Appraiser.Backend.Hubs;
namespace Inc.TeamAssistant.Gateway.Hubs;

public sealed class MessagesHub : Hub<IMessagesHubClient>
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Inc.TeamAssistant.Primitives;

namespace Inc.TeamAssistant.Appraiser.Backend;
namespace Inc.TeamAssistant.Gateway;

internal static class Messages
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@model Inc.TeamAssistant.Appraiser.Backend.Pages.Models.MetaStaticViewModel
@model Inc.TeamAssistant.Gateway.Pages.Models.MetaStaticViewModel

<title>@Html.Raw(Model.Title)</title>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using Inc.TeamAssistant.Primitives;
using Microsoft.AspNetCore.Mvc.RazorPages;

namespace Inc.TeamAssistant.Appraiser.Backend.Pages.Models;
namespace Inc.TeamAssistant.Gateway.Pages.Models;

internal sealed class HostPageModel : PageModel
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Inc.TeamAssistant.Appraiser.Backend.Pages.Models;
namespace Inc.TeamAssistant.Gateway.Pages.Models;

public sealed record MetaStaticViewModel(string Title, string Description, string Keywords, string Author)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Inc.TeamAssistant.Languages;
using Inc.TeamAssistant.Primitives;

namespace Inc.TeamAssistant.Appraiser.Backend.Pages.Models;
namespace Inc.TeamAssistant.Gateway.Pages.Models;

public sealed record OpenGraphStaticViewModel(LanguageId LanguageId, string Title, string Description, string ImageName)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@model Inc.TeamAssistant.Appraiser.Backend.Pages.Models.OpenGraphStaticViewModel
@model Inc.TeamAssistant.Gateway.Pages.Models.OpenGraphStaticViewModel

<meta property="og:locale" content="@Model.GetLocale()">
<meta property="og:title" content="@Html.Raw(Model.Title)">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
@page

@namespace Inc.TeamAssistant.Appraiser.Backend.Pages
@namespace Inc.TeamAssistant.Gateway.Pages
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers

@model Inc.TeamAssistant.Appraiser.Backend.Pages.Models.HostPageModel
@model Inc.TeamAssistant.Gateway.Pages.Models.HostPageModel

<!DOCTYPE html>
<html lang="@Model.CurrentLanguageId.Value">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
using Inc.TeamAssistant.Appraiser.Application;
using Inc.TeamAssistant.Appraiser.Application.Contracts;
using Inc.TeamAssistant.Appraiser.Backend;
using Inc.TeamAssistant.Appraiser.Backend.Hubs;
using Inc.TeamAssistant.Appraiser.Backend.Services;
using Inc.TeamAssistant.Appraiser.Backend.Services.CheckIn;
using Inc.TeamAssistant.Appraiser.DataAccess;
using Inc.TeamAssistant.WebUI.Services;
using Inc.TeamAssistant.Appraiser.Notifications;
Expand All @@ -15,6 +11,10 @@
using Inc.TeamAssistant.Languages;
using Inc.TeamAssistant.Users;
using Inc.TeamAssistant.DialogContinuations;
using Inc.TeamAssistant.Gateway;
using Inc.TeamAssistant.Gateway.Hubs;
using Inc.TeamAssistant.Gateway.Services;
using Inc.TeamAssistant.Gateway.Services.CheckIn;
using Inc.TeamAssistant.Reviewer.Application;
using Inc.TeamAssistant.Reviewer.Application.Contracts;
using Inc.TeamAssistant.Reviewer.DataAccess;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://json.schemastore.org/launchsettings.json",
"profiles": {
"Inc.TeamAssistant.Appraiser.Backend": {
"Inc.TeamAssistant.Gateway": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Inc.TeamAssistant.Appraiser.Application.Contracts;
using Prometheus;

namespace Inc.TeamAssistant.Appraiser.Backend.Services;
namespace Inc.TeamAssistant.Gateway.Services;

internal sealed class AssessmentSessionMetrics : IAssessmentSessionMetrics
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using Inc.TeamAssistant.Appraiser.Primitives;
using MediatR;

namespace Inc.TeamAssistant.Appraiser.Backend.Services;
namespace Inc.TeamAssistant.Gateway.Services;

internal sealed class AssessmentSessionsService : IAssessmentSessionsService
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using Inc.TeamAssistant.CheckIn.Model.Queries.GetLocations;
using MediatR;

namespace Inc.TeamAssistant.Appraiser.Backend.Services.CheckIn;
namespace Inc.TeamAssistant.Gateway.Services.CheckIn;

internal sealed class CheckInService : ICheckInService
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Inc.TeamAssistant.CheckIn.Model;
using Inc.TeamAssistant.CheckIn.Model.Queries.GetLocations;

namespace Inc.TeamAssistant.Appraiser.Backend.Services.CheckIn;
namespace Inc.TeamAssistant.Gateway.Services.CheckIn;

internal sealed class DummyLocationBuilder : ILocationBuilder
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using Inc.TeamAssistant.Languages;
using Inc.TeamAssistant.Primitives;

namespace Inc.TeamAssistant.Appraiser.Backend.Services;
namespace Inc.TeamAssistant.Gateway.Services;

internal sealed class ClientInfoService : IClientInfoService
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Inc.TeamAssistant.Appraiser.Primitives;
using Inc.TeamAssistant.Primitives;

namespace Inc.TeamAssistant.Appraiser.Backend.Services.CommandFactories;
namespace Inc.TeamAssistant.Gateway.Services.CommandFactories;

public sealed record CommandContext(
string Cmd,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
using Inc.TeamAssistant.Appraiser.Model.Commands.ReVoteEstimate;
using Inc.TeamAssistant.Appraiser.Model.Queries.ShowParticipants;

namespace Inc.TeamAssistant.Appraiser.Backend.Services.CommandFactories;
namespace Inc.TeamAssistant.Gateway.Services.CommandFactories;

internal sealed class CommandProvider : ICommandProvider
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using MediatR;

namespace Inc.TeamAssistant.Appraiser.Backend.Services.CommandFactories;
namespace Inc.TeamAssistant.Gateway.Services.CommandFactories;

internal sealed class ComplexCommandFactory : ICommandFactory
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
using Inc.TeamAssistant.DialogContinuations;
using MediatR;

namespace Inc.TeamAssistant.Appraiser.Backend.Services.CommandFactories;
namespace Inc.TeamAssistant.Gateway.Services.CommandFactories;

internal sealed class DynamicCommandFactory : ICommandFactory
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using MediatR;

namespace Inc.TeamAssistant.Appraiser.Backend.Services.CommandFactories;
namespace Inc.TeamAssistant.Gateway.Services.CommandFactories;

public interface ICommandFactory
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
using Inc.TeamAssistant.Languages;
using MediatR;

namespace Inc.TeamAssistant.Appraiser.Backend.Services.CommandFactories;
namespace Inc.TeamAssistant.Gateway.Services.CommandFactories;

internal sealed class StaticCommandFactory : ICommandFactory
{
Expand Down
Loading

0 comments on commit 3beb7a5

Please sign in to comment.