Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 14 additions & 5 deletions .claude/settings.local.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,24 @@
"Bash(npm run build:*)",
"WebFetch(domain:chakra-ui.com)",
"Bash(npm run lint)",
"Bash(git branch:*)",
"Bash(git checkout:*)",
"mcp__chakra-ui__get_theme",
"mcp__chakra-ui__customize_theme",
"Bash(npx @chakra-ui/cli typegen:*)",
"Bash(npm run dev:*)",
"Bash(dotnet build)",
"WebFetch(domain:www.chakra-ui.com)",
"Bash(dotnet run:*)",
"Bash(cp:*)",
"WebFetch(domain:atlassian.design)",
"WebFetch(domain:atlaskit.atlassian.com)",
"mcp__chakra-ui__get_component_props",
"mcp__puppeteer__puppeteer_screenshot",
"Bash(npm install:*)",
"Bash(git add:*)",
"Bash(git commit:*)",
"Bash(git push:*)",
"Bash(gh pr create:*)",
"Bash(gh pr view:*)"
"Bash(mkdir:*)",
"mcp__chakra-ui__list_components",
"mcp__chakra-ui__get_component_example"
],
"deny": []
}
Expand Down
27 changes: 20 additions & 7 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,24 +21,37 @@ ThingConnect.Pulse is a full-stack web application with:

## Development Commands

### Frontend (run from `thingconnect.pulse.client/`)
**IMPORTANT**: For development, run backend and frontend servers separately for optimal development experience.

### Frontend Development (run from `thingconnect.pulse.client/`)
```bash
npm run dev # Start development server (Vite)
npm run dev # Start Vite development server (https://localhost:49812 or similar)
npm run build # Build for production (TypeScript compile + Vite build)
npm run lint # Run ESLint
npm run format # Format code with Prettier
npm run preview # Preview production build
```

### Backend (run from `ThingConnect.Pulse.Server/`)
### Backend Development (run from `ThingConnect.Pulse.Server/`)
```bash
dotnet run # Start development server
dotnet build # Build the project
dotnet run # Start ASP.NET Core API server (https://localhost:7286)
dotnet build # Build the backend project
dotnet watch # Start with hot reload for development
```

### Full Stack (run from solution root)
### Development Workflow
1. **Terminal 1**: Start backend server from `ThingConnect.Pulse.Server/`
```bash
dotnet run
```
2. **Terminal 2**: Start frontend server from `thingconnect.pulse.client/`
```bash
npm run dev
```

### Production Build (run from solution root)
```bash
dotnet run --project ThingConnect.Pulse.Server # Starts both backend and frontend via SPA proxy
dotnet run --project ThingConnect.Pulse.Server # Serves built frontend via SPA proxy
```

## Development Setup
Expand Down
30 changes: 11 additions & 19 deletions ThingConnect.Pulse.Server/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,46 +42,38 @@ public static void Main(string[] args)
};
});

// CORS - Restrict to specific origins for security
builder.Services.AddCors(options =>
{
options.AddPolicy("AllowReactApp", policy =>
{
policy.WithOrigins("https://localhost:5173", "http://localhost:5173", "https://localhost:49813", "http://localhost:49813")
.AllowAnyMethod()
.AllowAnyHeader()
.AllowCredentials();
});
});

builder.Services.AddControllers();
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
builder.Services.AddEndpointsApiExplorer();
builder.Services.AddSwaggerGen();

var app = builder.Build();

app.UseDefaultFiles();
app.UseStaticFiles();

// Configure the HTTP request pipeline.
if (app.Environment.IsDevelopment())
{
app.UseSwagger();
app.UseSwaggerUI();
}
else
{
// Only serve static files in production
app.UseDefaultFiles();
app.UseStaticFiles();
}

app.UseHttpsRedirection();

app.UseCors("AllowReactApp");

app.UseAuthentication();
app.UseAuthorization();


app.MapControllers();

app.MapFallbackToFile("/index.html");
// Only serve SPA fallback in production
if (!app.Environment.IsDevelopment())
{
app.MapFallbackToFile("/index.html");
}

app.Run();
}
Expand Down
9 changes: 3 additions & 6 deletions ThingConnect.Pulse.Server/Properties/launchSettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
"launchBrowser": true,
"launchUrl": "swagger",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development",
"ASPNETCORE_HOSTINGSTARTUPASSEMBLIES": "Microsoft.AspNetCore.SpaProxy"
"ASPNETCORE_ENVIRONMENT": "Development"
},
"dotnetRunMessages": true,
"applicationUrl": "http://localhost:5099"
Expand All @@ -16,8 +15,7 @@
"launchBrowser": true,
"launchUrl": "swagger",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development",
"ASPNETCORE_HOSTINGSTARTUPASSEMBLIES": "Microsoft.AspNetCore.SpaProxy"
"ASPNETCORE_ENVIRONMENT": "Development"
},
"dotnetRunMessages": true,
"applicationUrl": "https://localhost:7286;http://localhost:5099"
Expand All @@ -27,8 +25,7 @@
"launchBrowser": true,
"launchUrl": "swagger",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development",
"ASPNETCORE_HOSTINGSTARTUPASSEMBLIES": "Microsoft.AspNetCore.SpaProxy"
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"Container (Dockerfile)": {
Expand Down
Binary file modified ThingConnect.Pulse.Server/pulse.db
Binary file not shown.
Loading