commit 07e4e6b381e24ea3c70aeeceaea090134fb2b63f Author: Nickk888 Date: Fri Oct 9 08:13:44 2026 +0200 first commit diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..fc5778f --- /dev/null +++ b/.dockerignore @@ -0,0 +1,26 @@ + class=""> **/.classpath + **/.dockerignore + **/.env + **/.git + **/.gitignore + **/.project + **/.settings + **/.toolstarget + **/.vs + **/.vscode + **/*.*proj.user + **/*.dbmdl + **/*.jfm + **/azds.yaml + **/bin + **/charts + **/docker-compose* + **/Dockerfile* + **/Docker + **/node_modules + **/npm-debug.log + **/obj + **/secrets.dev.yaml + **/values.dev.yaml + LICENSE + README.md \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..803c93d --- /dev/null +++ b/.gitignore @@ -0,0 +1,213 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. + +# User-specific files +*.rsuser +*.suo +*.user +*.userosscache +*.sln.docstates + +# Build results +[Bb]in/ +[Oo]bj/ +[Ee]xt/ +[Ll]og/ +[Ll]ogs/ + +# MSBuild Binary and Structured Log +*.binlog + +# MSBuild response files +!MSBuild.rsp +!Directory.Build.rsp + +# Visual Studio 14+ cache/options directory +.vs/ + +# Visual Studio 15+ auto generated files +Generated\ Files/ + +# Local History for Visual Studio +.localhistory/ + +# Visual Studio History (VSHistory) files +.vshistory/ + +# Backup folder for Package Reference Convert tool in Visual Studio 2017 +MigrationBackup/ + +# VS Code files for those working on multiple tools +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json +*.code-workspace + +# Local History for Visual Studio Code +.history/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUnit +*.VisualState.xml +TestResult.xml +nunit-*.xml + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ + +# ASP.NET Scaffolding +ScaffoldingReadMe.txt + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj +*.log +*.tlog +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Coverlet is a free, cross platform Code Coverage Tool +coverage*.json +coverage*.xml +coverage*.info + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# NuGet Symbol Packages +*.snupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx +*.appxbundle +*.appxupload + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!?*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*~.* +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# Microsoft Fakes +FakesAssemblies/ + +# CodeRush personal settings +.cr/personal + +# JetBrains Rider +*.sln.iml + +appsettings.Production.json +appsettings.Development.json diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/Bodies/NewDocumentBody.cs b/Bodies/NewDocumentBody.cs new file mode 100644 index 0000000..1ed3c12 --- /dev/null +++ b/Bodies/NewDocumentBody.cs @@ -0,0 +1,10 @@ +using System; +using Newtonsoft.Json; + +namespace PaperlessAI.Bodies; + +public class NewDocumentBody +{ + [JsonProperty("document_id")] + public int DocumentId { get; set; } +} diff --git a/Context/MyDbContext.cs b/Context/MyDbContext.cs new file mode 100644 index 0000000..a658568 --- /dev/null +++ b/Context/MyDbContext.cs @@ -0,0 +1,24 @@ +using System; +using Microsoft.EntityFrameworkCore; + +namespace PaperlessAI.Context; + +public class MyDbContext : DbContext +{ + public MyDbContext() + { + } + + public MyDbContext(DbContextOptions options) + : base(options) + { + } + + protected override void OnModelCreating(ModelBuilder modelBuilder) + { + modelBuilder + .UseCollation("utf8mb4_uca1400_ai_ci") + .HasCharSet("utf8mb4"); + } + +} diff --git a/Controllers/DocumentController.cs b/Controllers/DocumentController.cs new file mode 100644 index 0000000..e0d73e7 --- /dev/null +++ b/Controllers/DocumentController.cs @@ -0,0 +1,17 @@ +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; +using PaperlessAI.Bodies; + +namespace PaperlessAI.Controllers +{ + [Route("[controller]")] + [ApiController] + public class DocumentController : ControllerBase + { + [HttpPost] + public ActionResult AddNewDocument([FromBody]NewDocumentBody newDocument) + { + return Ok(); + } + } +} diff --git a/PaperlessAI.csproj b/PaperlessAI.csproj new file mode 100644 index 0000000..d6f3d5d --- /dev/null +++ b/PaperlessAI.csproj @@ -0,0 +1,17 @@ + + + + net10.0 + enable + enable + + + + + + + + + + + diff --git a/PaperlessAI.http b/PaperlessAI.http new file mode 100644 index 0000000..553cd2b --- /dev/null +++ b/PaperlessAI.http @@ -0,0 +1,6 @@ +@PaperlessAI_HostAddress = http://localhost:5276 + +GET {{PaperlessAI_HostAddress}}/weatherforecast/ +Accept: application/json + +### diff --git a/Program.cs b/Program.cs new file mode 100644 index 0000000..391135f --- /dev/null +++ b/Program.cs @@ -0,0 +1,28 @@ +using Microsoft.EntityFrameworkCore; +using PaperlessAI.Context; + +var builder = WebApplication.CreateBuilder(args); + +// Add services to the container. + +builder.Services.AddControllers(); + +builder.Services.AddDbContextPool(options => +{ + options.UseMySql( + builder.Configuration.GetConnectionString("MariaDbConnectionString"), + ServerVersion.Parse("12.0.2-mariadb") + ); +}); + +var app = builder.Build(); + +// Configure the HTTP request pipeline. + +app.UseHttpsRedirection(); + +app.UseAuthorization(); + +app.MapControllers(); + +app.Run(); diff --git a/Properties/launchSettings.json b/Properties/launchSettings.json new file mode 100644 index 0000000..6aedc56 --- /dev/null +++ b/Properties/launchSettings.json @@ -0,0 +1,23 @@ +{ + "$schema": "https://json.schemastore.org/launchsettings.json", + "profiles": { + "http": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": false, + "applicationUrl": "http://localhost:5276", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "https": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": false, + "applicationUrl": "https://localhost:7245;http://localhost:5276", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + } + } +} diff --git a/README.md b/README.md new file mode 100644 index 0000000..e69de29 diff --git a/Sequence Plan.png b/Sequence Plan.png new file mode 100644 index 0000000..7be8101 Binary files /dev/null and b/Sequence Plan.png differ diff --git a/appsettings.Template.json b/appsettings.Template.json new file mode 100644 index 0000000..eb10998 --- /dev/null +++ b/appsettings.Template.json @@ -0,0 +1,23 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Debug", + "Microsoft.AspNetCore": "Warning", + "Microsoft.Hosting.Lifetime": "Information", + "Microsoft.EntityFrameworkCore": "Information" + } + }, + "Application": { + "Version": "" + }, + "Settings": { + "MaxMediaDuration": 7200 + }, + "ConnectionStrings": { + "MariaDbConnectionString": "server=;user id=;password=;database=" + }, + "TokenGenerator": { + "MasterTokenHash": "" + }, + "AllowedHosts": "*" +}