marinasundstrom / YourBrand

Prototype enterprise system for e-commerce and consulting services
85 stars 13 forks source link

Portal site shows just as blank site #36

Open rwxzig opened 3 weeks ago

rwxzig commented 3 weeks ago

Hello, I am interested to learn this architecture further, so I have tried to run this project locally and going through the code. After fixing some references, I realized that it is trying to connect to some RabbitMQ service, and after running the RabbitMQ through docker with the following commands:

docker run -it --rm --name rabbitmq -p 5672:5672 -p 15672:15672 rabbitmq:3.13-management

I am able to run the project, but when I go to the portal page, it is just blank.

I modified Program.cs in YourBrand.AppHost as follows, but it is still blank:

Was:

var messaging = builder.AddRabbitMQ("messaging", userName: username, password: password, port: 5672)
    .WithHttpEndpoint(port: 15672, targetPort: 15672, name: "management")
    .WithBindMount("../../data/rabbitmq", "/var/lib/rabbitmq");

Is now:

var messaging = builder.AddRabbitMQ("messaging")
                       .WithDataVolume()
                       .WithManagementPlugin()
                       .PublishAsContainer();

And added aspire-manifest.json in the same project,

{
    "$schema": "https://json.schemastore.org/aspire-8.0.json",
    "resources": {
        "messaging": {
            "type": "container.v0",
            "connectionString": "rabbitmq://localhost:{messaging-password.value}@{messaging.bindings.tcp.host}:{messaging.bindings.tcp.port}",
            "image": "docker.io/library/rabbitmq:3.13-management",
            "volumes": [
                {
                    "name": "management",
                    "target": "/var/lib/rabbitmq",
                    "readOnly": false
                }
            ],
            "env": {
                "RABBITMQ_DEFAULT_USER": "guest",
                "RABBITMQ_DEFAULT_PASS": "{messaging-password.value}"
            },
            "bindings": {
                "tcp": {
                    "scheme": "tcp",
                    "protocol": "tcp",
                    "transport": "tcp",
                    "targetPort": 5672
                },
                "management": {
                    "scheme": "http",
                    "protocol": "tcp",
                    "transport": "http",
                    "targetPort": 15672
                }
            }
        },
        "messaging-password": {
            "type": "parameter.v0",
            "value": "{messaging-password.inputs.value}",
            "inputs": {
                "value": {
                    "type": "string",
                    "secret": true,
                    "default": {
                        "generate": {
                            "minLength": 22,
                            "special": false
                        }
                    }
                }
            }
        }
    }
}

I have seeded the databases, and when I run IdentityManagement project alone, I am able to sign in in Duende and see the claims and all that, but when I run through Aspire, it just shows as blank.

My question is if it is possible to write an initial setup guide, including the setup of the components that it is depended on. And by that I don't mean to include installation or setup, but just perhaps mention that it is running in such port or such address, and expects connection in such and such way.

marinasundstrom commented 1 day ago

@rwxzig Thanks for showing interest in my project. You are pointing out something that I should do: Writing instructions.

I initially ran all this in my custom Docker Compose setup with each project running manually. Switched to Aspire a couple of months ago.

I have not tried setting everything upp from scratch. But you should get indications in the Aspire Dashboard. https://localhost:17125/

Or check the browser console.

The Portal is running at: https://localhost:5174/

You need to seed at least the IdentityService and

AppService for the Portal to run. Then the services you want to run.

I don't know whether "Set up" is needed. I think that is seeded.

"Sync data" simply sends notifications to all services to create Tenants, Users, and Organisations. For when you have recreated and re-seeded service databases.

Screenshot 2024-10-15 at 22 15 25

I will have to investigate how to run set this project up as a clean slate.