Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidEggenberger committed Nov 4, 2024
2 parents bc1aeae + 3e080ef commit a59c209
Showing 1 changed file with 30 additions and 21 deletions.
51 changes: 30 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,42 +14,51 @@ This repository builds upon <a href="https://github.com/DavidEggenberger/Modular

## Architecture

Please visit the <a href="https://github.com/DavidEggenberger/ModularMonolith.SaaS.Template">ModularMonolith.SaaS.Template</a> repo for more information.
Because this repo builts upon the <a href="https://github.com/DavidEggenberger/ModularMonolith.SaaS.Template">ModularMonolith.SaaS.Template</a> repo please visit it for information about the architecture.

## Running CrispyCollab
CrispyCollab's WebServer (it also serves the Blazor WebAssembly client) relies on a Redis instance to store cached values and on a SQL Server to store the application's data. Running CrispyCollab therefore requires these two Infrastructure components to be running as well.
## Running and Using CrispyCollab
### TailwindCSS
If you want to start building with the template and adding your own tailwind classes you must run the following commands from the Source directory:
```
npm install -D tailwindcss
npx tailwindcss init
npx tailwindcss -i ./TailwindSource.css -o ./Web/Server/wwwroot/dist/output.css --watch
```

### Infrastructure
The most convient way to run a Redis and SQL Server instance is through Docker. To do so run this command from the root folder
(where CrispyCollab.sln file is located):
The most convient way to run an SQL Server instance is through Docker. To do so run this command from the root folder (where CrispyCollab.sln file is located):
```
docker-compose -f docker-compose.infrastructure.yml up
```

The SQL Server must be setup before CrispyCollab can be started. Open the Package Manager Console inside Visual Studio and execute the following commands:
The SQL Server must be setup before the template can be successfully run. Because the EF Core migrations were already created they only must be applied to the database. Open the Package Manager Console inside Visual Studio and execute the following two commands:
```
update-database -context ApplicationDbContext
update-database -context IdentityDbContext
update-database -context TenantIdentityDbContext
update-database -context SubscriptionsDbContext
```
These commands will create two seperate databases on the same server (the configuration strings are read from Web/WebServer/appsettings). The identity database storeas all the users informations and the application database all the other data.
These commands will create two seperate shemes with their respective tables on the same database (the configuration string is read from Web/Server/appsettings.Development.json).

### Web
Before running the WebServer (it serves also the Blazor WebAssembly client) configuration values must be set. They are then accessible through the IConfiguration interface for which ASP.NET Core automatically registers an implementation in the inversion-of-control (DI) container (assuming the configuration resides in appsettings.json or secrets.json). Especially the Infrastructure layer relies on the configuration values (e.g. database connection strings, Stripe API Key). It is highly recommended to keep the following secrets out of source control. For local development right click on the WebServer project and then click on manage user secrets. The opened secrets.json file should then updated to hold the following configuration (the values can be retrieved by following the respective links):
Before running the Web.Server project (its the project to be started because it also serves the Blazor WebAssembly client) the configuration values must be set. It is highly recommended to keep the following secrets out of source control. For local development right click on the Web.Server project and then click on manage user secrets. The opened secrets.json file should then updated to hold the following configuration (the values can be retrieved by following the respective links):

```json
{
"StripeKey": "to register a stripe account and retrieve the API Key visit: https://dashboard.stripe.com/login",
"SocialLogins": {
"Google": {
"ClientId": "https://chsakell.com/2019/07/28/asp-net-core-identity-series-external-provider-authentication-registration-strategy",
"ClientSecret": ""
}
,
"EFCoreConfiguration": {
"SQLServerConnectionString_Dev": "Server=127.0.0.1,1433;Database=ModularMonolith;User Id=SA;Password=YourSTRONG!Passw0rd;Encrypt=False;"
},
"SubscriptionsConfiguration": {
"StripeProfessionalPlanId": "_"
},
"TenantIdentityConfiguration": {
"GoogleClientId": "_",
"GoogleClientSecret": "_",
"MicrosoftClientId": "_",
"MicrosoftClientSecret": "_",
"LinkedinClientId": "_",
"LinkedinClientSecret": "_"
}
}
```

With the configuration set, the WebServer can either be started through Visual Studio (e.g. for debugging) or by running this command from the root folder
(where CrispyCollab.sln file is located):
```
docker-compose -f docker-compose.web.yml up
```
With the configuration set, the Web.Server project can be started through Visual Studio.

0 comments on commit a59c209

Please sign in to comment.