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
2 changes: 2 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,7 @@ jobs:
run: dotnet restore src/Evently.Server/Evently.Server.csproj
- name: Build
run: dotnet build --no-restore src/Evently.Server/Evently.Server.csproj
- name: Run .NET Unit Tests
run: dotnet test tests/Evently.Server.Test/Evently.Server.Test.csproj
- name: Test Docker Image
run: docker build --tag=expo-connect/latest --file=src/Evently.Server/Dockerfile .
27 changes: 15 additions & 12 deletions Evently.slnx
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
<Solution>
<Folder Name="/Solution Items/">
<File Path=".editorconfig" />
<File Path=".gitignore" />
<File Path="Makefile" />
</Folder>
<Folder Name="/src/">
<Project Path="src\evently.client\evently.client.esproj" Type="{54A90642-561A-4BB1-A94E-469ADEE60C69}">
<Configuration Solution="Release|Any CPU" Project="Debug|Any CPU" />
</Project>
<Project Path="src\Evently.Server\Evently.Server.csproj" Type="Classic C#" />
</Folder>
<Solution>
<Folder Name="/Solution Items/">
<File Path=".editorconfig"/>
<File Path=".gitignore"/>
<File Path="Makefile"/>
</Folder>
<Folder Name="/src/">
<Project Path="src\evently.client\evently.client.esproj">
<Configuration Solution="Release|Any CPU" Project="Debug|Any CPU"/>
</Project>
<Project Path="src\Evently.Server\Evently.Server.csproj"/>
</Folder>
<Folder Name="/tests/">
<Project Path="tests\Evently.Server.Test\Evently.Server.Test.csproj" Type="Classic C#"/>
</Folder>
</Solution>
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ test:
dotnet test ./tests/Evently.Server.Test/VisualPatron.Server.Test.csproj

add-migration:
dotnet ef migrations add RenameAccountId --project=src/Evently.Server --context=AppDbContext --output-dir=Common/Adapters/Data/Migrations
dotnet ef migrations add ColCollation --project=src/Evently.Server --context=AppDbContext --output-dir=Common/Adapters/Data/Migrations
Copy link

Copilot AI Aug 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The migration name 'ColCollation' is generic and doesn't clearly describe what the migration does. Consider using a more descriptive name that explains the specific changes being made.

Suggested change
dotnet ef migrations add ColCollation --project=src/Evently.Server --context=AppDbContext --output-dir=Common/Adapters/Data/Migrations
dotnet ef migrations add SetUserNameCollationToCaseInsensitive --project=src/Evently.Server --context=AppDbContext --output-dir=Common/Adapters/Data/Migrations

Copilot uses AI. Check for mistakes.

update-migration:
dotnet ef database update --project=src/Evently.Server --context=AppDbContext
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ protected override void BuildModel(ModelBuilder modelBuilder)

b.HasIndex("GatheringId");

b.ToTable("Bookings");
b.ToTable("Bookings", (string)null);

b.HasData(
new
Expand Down Expand Up @@ -199,7 +199,7 @@ protected override void BuildModel(ModelBuilder modelBuilder)

b.HasKey("CategoryId");

b.ToTable("Categories");
b.ToTable("Categories", (string)null);

b.HasData(
new
Expand Down Expand Up @@ -266,7 +266,7 @@ protected override void BuildModel(ModelBuilder modelBuilder)

b.HasKey("GatheringId");

b.ToTable("Gatherings");
b.ToTable("Gatherings", (string)null);

b.HasData(
new
Expand Down Expand Up @@ -448,7 +448,7 @@ protected override void BuildModel(ModelBuilder modelBuilder)

b.HasIndex("CategoryId");

b.ToTable("GatheringCategoryDetails");
b.ToTable("GatheringCategoryDetails", (string)null);

b.HasData(
new
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
using Evently.Server.Common.Domains.Models;
using Microsoft.Extensions.Options;
using System.Text.RegularExpressions;

namespace Evently.Server.Common.Extensions;

public static partial class ServiceContainerExtensions {
public static class ServiceContainerExtensions {
public static IOptions<Settings> LoadAppConfiguration(this IServiceCollection services,
ConfigurationManager configuration) {
// load .env variables, in addition to appsettings.json that is loaded by default
Expand All @@ -20,8 +19,4 @@ public static IOptions<Settings> LoadAppConfiguration(this IServiceCollection se
IOptions<Settings> options = Options.Create(settings);
return options;
}


[GeneratedRegex("postgres://(.*):(.*)@(.*):(.*)/(.*)")]
private static partial Regex HerokuDbRegex();
}
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,18 @@ public async Task<ActionResult<Booking>> CreateBooking([FromBody] BookingReqDto
[HttpPut("{bookingId}", Name = "UpdateBooking")]
public async Task<ActionResult> UpdateBooking(string bookingId,
[FromBody] BookingReqDto bookingReqDto) {
bool isExist = await bookingService.Exists(bookingId);
if (!isExist) {
Booking? booking = await bookingService.GetBooking(bookingId);
if (booking is null) {
return NotFound();
}

Booking booking = await bookingService.UpdateBooking(bookingId, bookingReqDto);
bool isAuth = await this.IsResourceOwner(booking.AttendeeId);
logger.LogInformation("isAuth: {}", isAuth);
if (!isAuth) {
return Forbid();
}

booking = await bookingService.UpdateBooking(bookingId, bookingReqDto);
return Ok(booking);
}

Expand Down
11 changes: 8 additions & 3 deletions src/evently.client/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ This template provides a minimal setup to get React working in Vite with HMR and

Currently, two official plugins are available:

- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react) uses [Babel](https://babeljs.io/) for Fast Refresh
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react)
uses [Babel](https://babeljs.io/) for Fast Refresh
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc)
uses [SWC](https://swc.rs/) for Fast Refresh

## Expanding the ESLint configuration

Expand Down Expand Up @@ -39,7 +41,10 @@ export default tseslint.config([
]);
```

You can also install [eslint-plugin-react-x](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-x) and [eslint-plugin-react-dom](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom) for React-specific lint rules:
You can also
install [eslint-plugin-react-x](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-x)
and [eslint-plugin-react-dom](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom)
for React-specific lint rules:

```js
// eslint.config.js
Expand Down
32 changes: 16 additions & 16 deletions src/evently.client/evently.client.esproj
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
<Project Sdk="Microsoft.VisualStudio.JavaScript.Sdk/1.0.2125207">
<Target Name="InstallWithPnpm" BeforeTargets="BeforeBuild">
<Exec Command="pnpm install"/>
</Target>
<PropertyGroup>
<ShouldRunNpmInstall>false</ShouldRunNpmInstall>
<StartupCommand>pnpm run dev</StartupCommand>
<JavaScriptTestRoot>src\</JavaScriptTestRoot>
<JavaScriptTestFramework>Vitest</JavaScriptTestFramework>
<!-- Allows the build (or compile) script located on package.json to run on Build -->
<ShouldRunBuildScript>false</ShouldRunBuildScript>
<!-- Must include BuildCommand - weird bug with msft where if wwwroot folder contains exisiting files, npm run build will not automatically run if <BuildCommand /> is excluded. -->
<BuildCommand>pnpm run build</BuildCommand>
<PublishCommand>pnpm run build</PublishCommand>
<!-- Folder where production build objects will be placed -->
<BuildOutputFolder>$(MSBuildProjectDirectory)\dist</BuildOutputFolder>
</PropertyGroup>
<Target Name="InstallWithPnpm" BeforeTargets="BeforeBuild">
<Exec Command="pnpm install"/>
</Target>
<PropertyGroup>
<ShouldRunNpmInstall>false</ShouldRunNpmInstall>
<StartupCommand>pnpm run dev</StartupCommand>
<JavaScriptTestRoot>src\</JavaScriptTestRoot>
<JavaScriptTestFramework>Vitest</JavaScriptTestFramework>
<!-- Allows the build (or compile) script located on package.json to run on Build -->
<ShouldRunBuildScript>false</ShouldRunBuildScript>
<!-- Must include BuildCommand - weird bug with msft where if wwwroot folder contains exisiting files, npm run build will not automatically run if <BuildCommand /> is excluded. -->
<BuildCommand>pnpm run build</BuildCommand>
<PublishCommand>pnpm run build</PublishCommand>
<!-- Folder where production build objects will be placed -->
<BuildOutputFolder>$(MSBuildProjectDirectory)\dist</BuildOutputFolder>
</PropertyGroup>
</Project>
8 changes: 4 additions & 4 deletions src/evently.client/index.html
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<!doctype html>
<html lang="en" data-theme="dark">
<html data-theme="dark" lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<link href="/vite.svg" rel="icon" type="image/svg+xml" />
<meta
name="viewport"
content="height=device-height, width=device-width, initial-scale=1.0, minimum-scale=1.0"
name="viewport"
/>
<title>Evently</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
<script src="/src/main.tsx" type="module"></script>
</body>
</html>
19 changes: 18 additions & 1 deletion src/evently.client/public/vite.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
32 changes: 16 additions & 16 deletions src/evently.client/src/lib/assets/GoogleIcon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading