Skip to content

Commit 89595d7

Browse files
authored
Merge pull request #1 from fdonnet/svelte-ui
SvelteKit UI as JS example
2 parents 778ec57 + c067d72 commit 89595d7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+6041
-5
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@
88
- Optional security UI for quick bootstrapping (Blazor, and components in auto mode).
99
- **Designed to manage subscriptions and multi-tenants.**
1010

11+
## News
12+
13+
SvelteKit Frontend added. (not working in Aspire with fnm), so:
14+
15+
`npm install, npm run dev in svelte-link-ui folder`
16+
1117
## Goal
1218

1319
This project allows you to choose any OAuth provider and remain independent in terms of your security design. You can add any frontend (Blazor, Next.js, SvelteKit) or backend APIs in front or behind this security layer. For a full SPA, you can modify Yarp to be a full BFF (Backend for Frontend).

UbikLink.AppHost/Program.cs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
var serviceBus = builder.AddConnectionString("messaging");
3030

3131
//RabbitMQ (local)
32-
var rabbitmq = builder.AddRabbitMQ("ubiklink-rabbitmq", rabbitUser, rabbitPassword)
32+
var rabbitmq = builder.AddRabbitMQ("ubiklink-rabbitmq", rabbitUser, rabbitPassword, 58842)
3333
.WithManagementPlugin()
3434
.WithLifetime(ContainerLifetime.Persistent);
3535

@@ -42,7 +42,7 @@
4242
//var cache = builder.AddAzureRedis("cache");
4343

4444
//Redis cache (local)
45-
var cache = builder.AddRedis("cache")
45+
var cache = builder.AddRedis("cache", 6379)
4646
.WithLifetime(ContainerLifetime.Persistent);
4747

4848
//Security API
@@ -101,4 +101,11 @@
101101
.WithEnvironment("Messaging__RabbitUser", rabbitUser)
102102
.WithEnvironment("Messaging__RabbitPassword", rabbitPassword);
103103

104+
//Add npm sevltekit project (not work with fnm.... because of path)
105+
//builder.AddNpmApp("svelte-ui", "../svelte-link-ui","dev")
106+
// .WithEnvironment("BROWSER", "none")
107+
// .WithHttpEndpoint(env: "PORT")
108+
// .WithExternalHttpEndpoints()
109+
// .PublishAsDockerFile();
110+
104111
await builder.Build().RunAsync();

UbikLink.AppHost/Properties/launchSettings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"profiles": {
33
"https": {
44
"commandName": "Project",
5-
"launchBrowser": false,
5+
"launchBrowser": true,
66
"environmentVariables": {
77
"ASPNETCORE_ENVIRONMENT": "Development",
88
"DOTNET_ENVIRONMENT": "Development",

UbikLink.AppHost/Realm/ubik-realm.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"realm": "ubik",
44
"notBefore": 0,
55
"defaultSignatureAlgorithm": "RS256",
6-
"revokeRefreshToken": false,
6+
"revokeRefreshToken": true,
77
"refreshTokenMaxReuse": 0,
88
"accessTokenLifespan": 660,
99
"accessTokenLifespanForImplicitFlow": 900,

UbikLink.AppHost/UbikLink.AppHost.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
<PackageReference Include="Aspire.Hosting.Azure.Redis" Version="9.0.0" />
1717
<PackageReference Include="Aspire.Hosting.Azure.ServiceBus" Version="9.0.0" />
1818
<PackageReference Include="Aspire.Hosting.Keycloak" Version="9.0.0-preview.5.24551.3" />
19+
<PackageReference Include="Aspire.Hosting.NodeJs" Version="9.0.0" />
1920
<PackageReference Include="Aspire.Hosting.PostgreSQL" Version="9.0.0" />
2021
<PackageReference Include="Aspire.Hosting.RabbitMQ" Version="9.0.0" />
2122
<PackageReference Include="Aspire.Hosting.Redis" Version="9.0.0" />

UbikLink.Security.UI/Properties/launchSettings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"https": {
1515
"commandName": "Project",
1616
"dotnetRunMessages": true,
17-
"launchBrowser": true,
17+
"launchBrowser": false,
1818
"inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}",
1919
"applicationUrl": "https://localhost:7043;http://localhost:5076",
2020
"environmentVariables": {

best-schema.png

19 KB
Loading

svelte-link-ui/.env.local

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
OIDC_ISSUER=http://localhost:8080/realms/ubik
2+
OIDC_CLIENT_ID=ubik_app
3+
OIDC_CLIENT_SECRET=Ye6Y36ocA4SaGqYzd0HgmqMhVaM2jlkE
4+
OIDC_AUDIENCE=account
5+
OIDC_REDIRECT_URI=http://localhost:5173/login/auth/callback
6+
REDIS_PORT=6379
7+
REDIS_HOST=localhost
8+
BACKEND_PROXY_URL=http://localhost:5235
9+
TOKEN_STORE_SECRET=Ye6Y36ocA4SaGqYzd0babaHgmqMhVaM2jlkE
10+
RABBIT_MQ_CONNECTION=amqp://guest:guest@localhost:58842

svelte-link-ui/.gitignore

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
node_modules
2+
3+
# Output
4+
.output
5+
.vercel
6+
.netlify
7+
.wrangler
8+
/.svelte-kit
9+
/build
10+
11+
# OS
12+
.DS_Store
13+
Thumbs.db
14+
15+
# Env
16+
.env
17+
.env.*
18+
!.env.example
19+
!.env.test
20+
21+
# Vite
22+
vite.config.js.timestamp-*
23+
vite.config.ts.timestamp-*

svelte-link-ui/.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
engine-strict=true

0 commit comments

Comments
 (0)