Initial commit

This commit is contained in:
2026-09-28 01:47:01 +04:00
commit d87f11edcd
70 changed files with 3173 additions and 0 deletions
@@ -0,0 +1,9 @@
// Bot-specific registrations moved to MemeVault.Bot.
// Infrastructure registration lives in MemeVault.Infrastructure.InfrastructureServiceExtensions.
// This file is kept as a placeholder for future Api-specific extensions.
namespace MemeVault.Api.Extensions;
public static class ServiceCollectionExtensions
{
// Example: Telegram init-data auth, rate limiting, etc.
}
+26
View File
@@ -0,0 +1,26 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<RootNamespace>MemeVault.Api</RootNamespace>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\MemeVault.Application\MemeVault.Application.csproj" />
<ProjectReference Include="..\MemeVault.Infrastructure\MemeVault.Infrastructure.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="MediatR" Version="12.4.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="10.0.12">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="10.0.3" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="prometheus-net.AspNetCore" Version="8.2.1" />
</ItemGroup>
</Project>
+28
View File
@@ -0,0 +1,28 @@
using Prometheus;
using MemeVault.Infrastructure;
var builder = WebApplication.CreateBuilder(args);
// ── Application ───────────────────────────────────────────────────────────────
builder.Services.AddMediatR(cfg =>
cfg.RegisterServicesFromAssembly(
typeof(MemeVault.Application.Commands.SaveMedia.SaveMediaCommand).Assembly));
// ── Infrastructure (DB + Redis) ───────────────────────────────────────────────
builder.Services.AddInfrastructure(builder.Configuration);
var app = builder.Build();
app.UseHttpMetrics();
app.MapGet("/health", () => Results.Ok(new { status = "ok" }));
// TODO: /api/media GET — список медиа пользователя
// TODO: /api/media POST — загрузить новое медиа (файл или текст)
// TODO: /api/media/{id} DELETE
// TODO: /api/tags GET — теги пользователя
// TODO: /api/collections GET/POST — коллекции
app.MapMetrics();
app.Run();
+17
View File
@@ -0,0 +1,17 @@
{
"Bot": {
"Token": "YOUR_BOT_TOKEN_HERE",
"WebhookHost": "https://your-domain.com"
},
"ConnectionStrings": {
"Postgres": "Host=db;Port=5432;Database=memevault;Username=memevault;Password=changeme"
},
"Redis": "redis:6379",
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning",
"Microsoft.EntityFrameworkCore.Database.Command": "Warning"
}
}
}