Project Ollama is an AI-powered email assistant built with .NET 9 and a React front-end. It exposes a small HTTP API that can classify incoming emails, generate responses and interact with multiple AI providers.
- .NET 9 SDK
- Node.js 18+
- Use
dotnet user-secretsto store your API keys outside the repository. The filesecrets.example.jsonshows the required structure. Example:dotnet user-secrets set "AzureOpenAi:ApiKey" "<your-key>" dotnet user-secrets set "AzureOpenAi:Endpoint" "<your-endpoint>"
- Edit
appsettings.jsonto select the AI provider via theAiProvideroption. Supported providers areOllama,AzureOpenAi,GroqandDockerModel. Each provider has its own section with model names and connection details.
Run the API and the React UI separately:
# start the ASP.NET backend
dotnet runIn another terminal:
cd EmailUI
npm install
npm startThe React dev server proxies API calls to http://localhost:5130.
To build the React UI and serve it from ASP.NET:
cd EmailUI
npm install
npm run build:deploy
cd ..
dotnet runStatic files will be copied to wwwroot and hosted by the backend.
POST /ai/mail– Analyze an email and return a JSON action.GET /ai/health– Check the selected AI provider status.POST /ai/generate– General completion endpoint withprompt,modelandtemperaturefields.
Example request:
curl -X POST http://localhost:5130/ai/mail \
-H "Content-Type: application/json" \
-d '{"emailContent":"Your email text"}'See EmailUI/README.md for details on the front‑end project.