Skip to content
This repository has been archived by the owner on Apr 8, 2023. It is now read-only.

Commit

Permalink
Improve developer experience for application cold boot around docker …
Browse files Browse the repository at this point in the history
…images being initialized. (#187)
  • Loading branch information
benjaminsampica authored Dec 6, 2022
1 parent 16bcda6 commit ed1bd0f
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 37 deletions.
34 changes: 19 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,27 @@ A new season begins every May and continues until the end of December. At the en

# Getting Started

Click [here](./docs/running-locally.md) to be taken to how to run the app locally.
Ensure you've installed all necessary prerequisites before running the project.

Running & contributing to Dynamo League Blazor requires the following:
- .NET 7 SDK
## Prerequisites:
Things you will need before running the application:
- .NET 7 SDK (Installing Visual Studio 2022 and selecting .NET 7 in the modules will do this, or you can go to their [website](https://dotnet.microsoft.com/en-us/download/dotnet) and download the SDK via their instructions)
- IIS Express
- Docker (Linux)
- WASM tools (can be installed via `dotnet workload install wasm-tools`)

By default, two test accounts are created with administrator permissions with the following login information:

Username: `[email protected]`
Password: `hunter2`
Team - Space Force

Username: `[email protected]`
Password: `hunter2`
Team - The Donald
- Docker (in Linux mode)
- WASM tools (can be installed via `dotnet workload install wasm-tools` in the command line)

## Running locally:
1) Load the solution in Visual Studio or Rider.
2) Set the `DynamoLeagueBlazor.Server` as the start up project.
3) Run the application.
4) Wait for everything to setup (this can take a while on first run), once this is done it should open a new tab in your default browser.
5) Login with one of the two accounts:
- Team - Space Force
- Username: `[email protected]`
- Password: `hunter2`
- Team - The Donald
- Username: `[email protected]`
- Password: `hunter2`

# Contributing

Expand Down
18 changes: 0 additions & 18 deletions docs/running-locally.md

This file was deleted.

11 changes: 7 additions & 4 deletions src/Server/Program.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Coravel;
using DotNet.Testcontainers.Configurations;
using Duende.IdentityServer.Services;
using DynamoLeagueBlazor.Server.Areas.Identity;
using DynamoLeagueBlazor.Server.Features.Admin.Shared;
Expand Down Expand Up @@ -29,8 +30,9 @@
{
var builder = WebApplication.CreateBuilder(args);

builder.Logging.ClearProviders();

var loggerConfiguration = new LoggerConfiguration()
.MinimumLevel.Is(LogEventLevel.Information)
.MinimumLevel.Override("Microsoft", LogEventLevel.Warning)
.MinimumLevel.Override("System", LogEventLevel.Warning)
.MinimumLevel.Override("Duende", LogEventLevel.Error)
Expand All @@ -39,16 +41,15 @@

if (builder.Environment.IsDevelopment())
{
loggerConfiguration.MinimumLevel.Is(LogEventLevel.Verbose);
loggerConfiguration.WriteTo.Debug();
}
else
{
loggerConfiguration.MinimumLevel.Is(LogEventLevel.Information);
loggerConfiguration.WriteTo.File("logs/log.log", rollingInterval: RollingInterval.Day, outputTemplate: "{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} {Name} [{Level:u3}] {Message:lj}{NewLine}{Exception}");
}


builder.Logging.ClearProviders();

Log.Logger = loggerConfiguration.CreateLogger();

builder.Host.UseSerilog();
Expand All @@ -57,6 +58,8 @@
var connectionString = builder.Configuration.GetConnectionString("DefaultConnection");
if (builder.Environment.IsDevelopment())
{
var logger = LoggerFactory.Create(logging => logging.AddSerilog(Log.Logger)).CreateLogger<Program>();
TestcontainersSettings.Logger = logger;
connectionString = await MsSqlContainerFactory.CreateAsync();
}

Expand Down

0 comments on commit ed1bd0f

Please sign in to comment.