Skip to content

Commit 89fc958

Browse files
author
aligneddev
committed
fixed aurelia router, it's still not being served
1 parent 8926d6b commit 89fc958

8 files changed

Lines changed: 182 additions & 20 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Local-first Bike Tracking application built with .NET Aspire orchestration, .NET
2828
dotnet tool install csharpier -g
2929
```
3030

31-
run it with `dotnet csharpier format .` from the repo root to format all C# code.
31+
run it with `csharpier format .` from the repo root to format all C# code.
3232

3333
- Helpful editor integration: VS Code CSharpier extension (`csharpier.csharpier-vscode`)
3434

src/BikeTracking.Api/Application/Users/IdentityOptions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public sealed class ThrottleOptions
3232

3333
public sealed class OutboxOptions
3434
{
35-
public int PollIntervalSeconds { get; set; } = 5;
35+
public int PollIntervalSeconds { get; set; } = 10;
3636
public int MaxBatchSize { get; set; } = 50;
3737
public int InitialBackoffSeconds { get; set; } = 1;
3838
public int MaxBackoffSeconds { get; set; } = 30;

src/BikeTracking.Api/appsettings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"MaxSeconds": 30
2121
},
2222
"Outbox": {
23-
"PollIntervalSeconds": 5,
23+
"PollIntervalSeconds": 10,
2424
"MaxBatchSize": 50,
2525
"InitialBackoffSeconds": 1,
2626
"MaxBackoffSeconds": 30,

src/BikeTracking.AppHost/AppHost.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77
.WithHttpHealthCheck("/health")
88
.WithExternalHttpEndpoints();
99

10-
// AddViteApp was not working with Aurelia
10+
// AddViteApp was not working with Aurelia, so we use AddNodeApp to run the Vite preview server directly.
1111
var webFrontend = builder
1212
.AddNodeApp("frontend", "../BikeTracking.Frontend", "node_modules/vite/bin/vite.js")
1313
.WithNpm()
1414
.WithRunScript("preview")
1515
.WithHttpEndpoint(port: 4173, env: "PORT")
16-
.WithEnvironment("VITE_API_BASE_URL", "http://localhost:5436")
16+
.WithEnvironment("VITE_API_BASE_URL", "http://localhost:4173")
1717
.WithReference(apiService)
1818
.WaitFor(apiService);
1919

src/BikeTracking.Frontend/package.json

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,28 @@
1414
"react-dom": "^19.2.4"
1515
},
1616
"devDependencies": {
17-
"@eslint/js": "^9.39.4",
18-
"@types/node": "^24.12.0",
19-
"@types/react": "^19.2.14",
20-
"@types/react-dom": "^19.2.3",
21-
"@vitejs/plugin-react": "^6.0.0",
22-
"eslint": "^9.39.4",
23-
"eslint-plugin-react-hooks": "^7.0.1",
24-
"eslint-plugin-react-refresh": "^0.5.2",
25-
"globals": "^17.4.0",
26-
"typescript": "~5.9.3",
27-
"typescript-eslint": "^8.56.1",
28-
"vite": "^8.0.0"
29-
}
17+
"eslint": "^9.17.0",
18+
"globals": "^15.14.0",
19+
"@aurelia/testing": "latest",
20+
"stylelint": "^16.12.0",
21+
"stylelint-config-standard": "^36.0.1",
22+
"@aurelia/vite-plugin": "latest",
23+
"vite": "^7.3.1",
24+
"vite-plugin-node-polyfills": "^0.25.0",
25+
"@types/node": "^22.10.2",
26+
"typescript": "^5.7.2",
27+
"tslib": "^2.8.1",
28+
"typescript-eslint": "^8.18.1"
29+
},
30+
"scripts": {
31+
"lint:js": "eslint \"src/**/*.{js,ts}\"",
32+
"lint:css": "stylelint \"src/**/*.css\"",
33+
"lint": "npm run lint:js && npm run lint:css",
34+
"pretest": "npm run lint",
35+
"dev": "vite",
36+
"start": "vite",
37+
"build": "vite build",
38+
"preview": "npm run build && vite preview --host 0.0.0.0 --strictPort --port 4173"
39+
},
40+
"type": "module"
3041
}

src/BikeTracking.Frontend/src/pages/signup/signup-page.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1+
import { customElement } from '@aurelia/runtime-html';
2+
import template from './signup-page.html?raw';
13
import {
24
identifyUser,
35
signupUser,
46
type ErrorResponse,
57
type ThrottleResponse,
68
} from '../../services/users-api';
79

10+
@customElement({ name: 'signup-page', template })
811
export class SignupPage {
912
public signupName = '';
1013
public signupPin = '';
Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
* {
2+
box-sizing: border-box;
3+
}
4+
5+
body {
6+
margin: 0;
7+
padding: 1rem;
8+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
9+
background-color: #f5f5f5;
10+
color: #333;
11+
}
12+
13+
main {
14+
max-width: 800px;
15+
margin: 0 auto;
16+
}
17+
18+
h1 {
19+
text-align: center;
20+
color: #1a1a1a;
21+
margin-bottom: 2rem;
22+
}
23+
24+
h2 {
25+
color: #444;
26+
border-bottom: 2px solid #007bff;
27+
padding-bottom: 0.5rem;
28+
}
29+
30+
.identity-flow {
31+
display: grid;
32+
gap: 2rem;
33+
}
34+
35+
.card {
36+
background: white;
37+
border-radius: 8px;
38+
padding: 1.5rem;
39+
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
40+
}
41+
42+
form {
43+
display: flex;
44+
flex-direction: column;
45+
gap: 1rem;
46+
}
47+
48+
label {
49+
font-weight: 500;
50+
margin-bottom: 0.25rem;
51+
display: block;
52+
}
53+
54+
input {
55+
padding: 0.75rem;
56+
border: 1px solid #ddd;
57+
border-radius: 4px;
58+
font-size: 1rem;
59+
transition: border-color 0.2s;
60+
}
61+
62+
input:focus {
63+
outline: none;
64+
border-color: #007bff;
65+
box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
66+
}
67+
68+
button {
69+
padding: 0.75rem 1.5rem;
70+
background-color: #007bff;
71+
color: white;
72+
border: none;
73+
border-radius: 4px;
74+
font-size: 1rem;
75+
font-weight: 500;
76+
cursor: pointer;
77+
transition: background-color 0.2s;
78+
}
79+
80+
button:hover:not(:disabled) {
81+
background-color: #0056b3;
82+
}
83+
84+
button:disabled {
85+
background-color: #ccc;
86+
cursor: not-allowed;
87+
}
88+
89+
.errors {
90+
list-style: none;
91+
padding: 0;
92+
margin: 0;
93+
background-color: #f8d7da;
94+
border: 1px solid #f5c6cb;
95+
border-radius: 4px;
96+
padding: 1rem;
97+
color: #721c24;
98+
}
99+
100+
.errors li {
101+
margin-bottom: 0.5rem;
102+
}
103+
104+
.errors li:last-child {
105+
margin-bottom: 0;
106+
}
107+
108+
.success {
109+
background-color: #d4edda;
110+
border: 1px solid #c3e6cb;
111+
border-radius: 4px;
112+
padding: 1rem;
113+
color: #155724;
114+
margin: 0;
115+
}
116+
117+
.warning {
118+
background-color: #fff3cd;
119+
border: 1px solid #ffeaa7;
120+
border-radius: 4px;
121+
padding: 1rem;
122+
color: #856404;
123+
margin: 0;
124+
}
125+
126+
.intro {
127+
text-align: center;
128+
color: #666;
129+
margin-bottom: 2rem;
130+
font-size: 0.95rem;
131+
}

src/BikeTracking.Frontend/vite.config.ts

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,22 @@ import react from '@vitejs/plugin-react'
33

44
// https://vite.dev/config/
55
export default defineConfig({
6-
plugins: [react()],
7-
})
6+
server: {
7+
open: !process.env.CI,
8+
port: 9000,
9+
},
10+
preview: {
11+
port: 4173,
12+
host: '0.0.0.0',
13+
strictPort: true,
14+
},
15+
esbuild: {
16+
target: 'es2022'
17+
},
18+
plugins: [
19+
aurelia({
20+
useDev: true,
21+
}),
22+
nodePolyfills(),
23+
],
24+
});

0 commit comments

Comments
 (0)