Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chat and Charts #104

Open
wants to merge 16 commits into
base: master
Choose a base branch
from
Open

Chat and Charts #104

wants to merge 16 commits into from

Conversation

urumo
Copy link
Contributor

@urumo urumo commented Feb 1, 2025

No description provided.

urumo added 16 commits February 2, 2025 03:00
Introduced new configuration files `aspirate-state.json` and `manifest.json` to manage project settings, container images, secrets, and resource definitions. Added `docker-compose.yaml` to define and configure services for `aspire-dashboard`, `cache`, `nats`, `pg`, `clickhouse`, `smtpdev`, `argon-api`, and `argon-entry`, including their environment variables, volumes, ports, and restart policies.
Updated `aspirate-state.json` to change `outputFormat` from "compose" to "helm". Added Helm chart files: `Chart.yaml` and `values.yaml`. Created Kubernetes resources for various services including `argon-api`, `argon-entry`, `aspire-dashboard`, `cache`, `clickhouse`, `nats`, `pg`, and `smtpdev`. Resources include ConfigMaps, Secrets, Deployments, StatefulSets, and Services.
Introduced new configuration files `aspirate-state.json` and `manifest.json` to manage project settings, container images, secrets, and resource definitions. Added `docker-compose.yaml` to define and configure services for `aspire-dashboard`, `cache`, `nats`, `pg`, `clickhouse`, `smtpdev`, `argon-api`, and `argon-entry`, including their environment variables, volumes, ports, and restart policies.
Updated `aspirate-state.json` to change `outputFormat` from "compose" to "helm". Added Helm chart files: `Chart.yaml` and `values.yaml`. Created Kubernetes resources for various services including `argon-api`, `argon-entry`, `aspire-dashboard`, `cache`, `clickhouse`, `nats`, `pg`, and `smtpdev`. Resources include ConfigMaps, Secrets, Deployments, StatefulSets, and Services.
Modified docker-compose.yaml to comment out PostgreSQL env vars and simplify port mapping. Added ClickHouse packages to Argon.Api.csproj. Updated DatabaseFeature.cs with AddPooledClickhouse method. Enhanced ChannelGrain.cs and IChannelGrain.cs with GetMessages and SendMessage methods. Commented out GrainDirectory attribute in ChannelGrain.cs and ServerGrain.cs. Expanded Channel.cs with new enums and records. Introduced DevController for debug builds. Added empty ClickhouseContext class.
- Updated ClickhouseContext.cs to include new DbSet properties for ArgonMessage, Document, Image, Sticker, and Entity.
- Added AddPooledClickhouse<ClickhouseContext>() service in Program.cs.
- Added app.MapDefaultEndpoints() and app.MapGet("/") endpoints in Program.cs.
- Moved EntityType enum and record types from Channel.cs to ArgonMessage.cs with modifications.
- Added MessageId property and ForeignKey attributes to Entity, Sticker, Document, and Image records.
- Updated ArgonMessage record to initialize the Image list property.
- Updated ClickhouseContext to use dependency injection and DbSet properties.
- Repositioned FileId and added ArgonMessage navigation property in Sticker, Document, and Image records.
- Added migration to create necessary tables and define schema.
- Generated migration designer and model snapshot files.
Modified migration to use raw SQL for creating indexes with a
hash type on various tables. Updated appsettings.json to change
the ClickHouse connection string format for better compatibility.
Updated `docker-compose.yaml` to change `CLICKHOUSE_DB` from "postgres" to "argen". Modified `20250202183221_AddedClickhouseContext.cs` migration to use raw SQL for creating tables in ClickHouse. Updated `appsettings.json` to include `Database=argen` in the `clickhouse` connection string.

i voobshe naxuy etot bash fluent api kogda delaesh chto-to ne standartnoe
Cleaned up the migration file by removing commented-out code that was previously used to create the `Messages`, `Documents`, `Entities`, `Images`, and `Stickers` tables. Also removed the code for creating indexes on the `CreatorId` column for these tables. This change is part of a refactoring effort to eliminate unused code.
Ensure both ApplicationDbContext and ClickhouseContext are initialized before running the application. This change prepares both contexts for use, likely related to database connections or other initialization tasks.
- Add `IDbContextFactory<ClickhouseContext> click` parameter to `ChannelGrain` constructor
- Update `GetMessages` method in `ChannelGrain` to remove `NotImplementedException` and leave empty implementation
- Apply minor formatting changes to `State` property initialization in `ChannelGrain`
- Remove `ChannelUserChangedStateEvent` enum from `ChannelGrain.cs`
- Reformat `Text` property and add `[NotMapped]` `UserName` property to `ArgonMessage` record in `ArgonMessage.cs`
Renamed `DbSet` properties in `ClickhouseContext`:
- `Documents` to `MessageDocument`
- `Images` to `MessageImage`
- `Entities` to `MessageEntity`

Updated `ChannelGrain` class:
- Made `GetMessages` method asynchronous and added logic to fetch related entities and `UserName`
- Implemented `SendMessage` method to save new messages

Renamed and modified classes in `ArgonMessage.cs`:
- `Entity` to `MessageEntity`, removed `Overwrites`
- `Sticker`, removed `Overwrites`
- `Document` to `MessageDocument`, removed `Overwrites`
- `Image` to `MessageImage`, removed `Overwrites`

Updated `ArgonMessage` class:
- Changed property types for `Document`, `Image`, and `Entities`
- Removed `Overwrites` property
Removed ChannelId property from ArgonMessage record.
Changed ReplyToMessage property to nullable Guid?.
- Modified `DevController` to remove `userId` from `GetMessages` endpoint.
- Simplified `GetMessages` in `ChannelGrain` by removing `pgCtx` and `UserName` logic.
- Updated `SendMessage` in `ChannelGrain` to throw exception for non-text channels and fire `MessageSent` event.
- Updated `IChannelGrain` interface to reflect `SendMessage` changes.
- Changed `FileId` column type from `UUID` to `String` in migration file and `ClickhouseContextModelSnapshot`.
- Added `SendMessage` and `GetMessages` methods to `ServerInteraction` and `IServerInteraction`.
- Reformatted records in `ArgonMessage` and changed `FileId` type from `Guid` to `String`.
- Added new `MessageSent` event class in `Argon.Streaming.Events`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant