Skip to main content

Publix Mobile Chat Repository Overview

This document summarizes the layout of the s0pmobai-publix-mobile-chat-api repository so that contributors can quickly locate services, pipelines, configurations, and shared assets. The repo hosts both the conversational services stack and the accompanying admin UI.

Key Technologies

  • Backend: .NET 8, ASP.NET Core Web API, Azure Functions isolated worker, xUnit tests
  • Frontend: Next.js 15 (App Router), React 19, Tailwind CSS 4 preview, Jest/Testing Library
  • CI/CD: Azure DevOps pipelines referencing the S0AIDXXX-AI Delivery template catalog
  • Observability: Application Insights (pre-wired for the Function App)

Top-Level Layout

ROOT
├─ README.md
├─ build/ # Azure DevOps pipeline definitions
├─ deploy/ # Infrastructure pipeline stubs
├─ docs/ # Repository documentation (this file lives here)
└─ src/
├─ services/ # .NET service solution and unit tests
└─ ui/ # Next.js admin console

Repository Root

  • README.md - generic scaffold description with links to Publix engineering guidance.
  • .gitignore, .git/ - standard Git metadata.
  • Hidden OS artifacts (for example .DS_Store) should be ignored.

Pipelines and Automation (build/, deploy/)

build/

  • azure-pipelines.pr-ai-agent.yml
    • Runs the AI PR Agent template with required Azure OpenAI service credentials.
  • azure-pipelines.webapi.pr-validation.yml
    • Uses the shared dotnet-build template to restore, build, test, and run SonarQube analysis for the .NET solution.
    • Inputs include buildPath: **/*.sln and test glob **/*.UnitTests.csproj; artifacts are not published in this PR validation flavor.
  • azure-pipelines.webapi.build-and-canary.yml
    • Placeholder pipeline that currently echoes "hello world"; intended to extend for build-and-canary deployments of the Web API.
  • azure-pipelines.ui.pr-validation.yml
    • Invokes the shared node-build template targeting src/ui/s0pmobai-admin-site.
    • Runs lint, build, Jest unit tests, and SonarQube with coverage ingestion from coverage/lcov.info.

deploy/

  • azure-pipelines.infra.tf-ut.yml
    • Empty stub reserved for future infrastructure-as-code Terraform unit testing.

Backend Services (src/services/Publix.S0PMOBAI)

Publix.S0PMOBAI/
├─ Publix.S0PMOBAI.sln # Solution composing service projects and test projects
├─ src/
│ ├─ Publix.S0PMOBAI.Domain/ # Domain model library (net8.0)
│ ├─ Publix.S0PMOBAI.Application/ # Application services layer, references Domain
│ ├─ Publix.S0PMOBAI.Infrastructure/ # Infrastructure adapters, references Application & Domain
│ ├─ Publix.S0PMOBAI.WebAPI/ # ASP.NET Core Web API host
│ └─ Publix.S0PMOBAI.FunctionApp/ # Azure Functions isolated worker
└─ tests/
├─ Publix.S0PMOBAI.Domain.UnitTests/
├─ Publix.S0PMOBAI.Application.UnitTests/
├─ Publix.S0PMOBAI.Infrastructure.UnitTests/
├─ Publix.S0PMOBAI.FunctionApp.UnitTests/
└─ Publix.S0PMOBAI.WebAPI.UnitTests/ (skeleton)

Project Highlights

  • Domain (Publix.S0PMOBAI.Domain)
    • Target: net8.0.
    • Currently empty aside from project scaffolding; intended to host core entities and value objects.
  • Application (Publix.S0PMOBAI.Application)
    • Target: net8.0; references Domain.
    • Placeholder for business logic, mediators, and use cases.
  • Infrastructure (Publix.S0PMOBAI.Infrastructure)
    • Target: net8.0; references Application and Domain.
    • Future home for persistence, integrations, and cross-cutting adapters.
  • Web API (Publix.S0PMOBAI.WebAPI)
    • ASP.NET Core minimal hosting pattern with Swagger enabled in development.
    • Program.cs configures controllers, Swagger, HTTPS redirection, and authorization middleware.
    • Default WeatherForecastController and WeatherForecast DTO remain as placeholders.
    • Configuration: appsettings.Development.json tunes logging for local runs.
  • Function App (Publix.S0PMOBAI.FunctionApp)
    • Azure Functions isolated worker (Microsoft.Azure.Functions.Worker 2.0.0) with Application Insights telemetry enabled.
    • Program.cs wires up builder, exposes a test-friendly IFunctionsApplicationRunner, and configures Application Insights.
    • host.json enables sampling and Live Metrics filters.

Shared Testing Layout (tests/)

  • Each layer has a corresponding xUnit project targeting net8.0 with Microsoft.NET.Test.Sdk, coverlet.collector, and xunit.runner.visualstudio pre-configured.
  • Publix.S0PMOBAI.FunctionApp.UnitTests references the Function App to facilitate isolated worker testing.
  • Test classes are placeholders (UnitTest1.cs) and should be replaced with meaningful test suites as features are developed.

Frontend Admin Site (src/ui/s0pmobai-admin-site)

  • Tech Stack

    • Next.js 15 App Router, React 19, TypeScript 5, Tailwind CSS 4 (via @tailwindcss/postcss), Recharts.
    • Testing via Jest 29, @testing-library/react, and @testing-library/jest-dom.
  • Key Directories

    • app/
      • layout.tsx - Defines the root HTML shell, font loading (Geist), theme initialization script, and renders NavBar + ThemeProvider.
      • page.tsx - Dashboard landing page that renders DashboardOverview with mock data.
      • globals.css - Global styles (Tailwind + custom variables).
    • shared/
      • providers/ThemeProvider.tsx - React context for light/dark theme toggling, synced with local storage and data-theme attribute.
      • ui/ - Reusable UI widgets (ThemeToggle, Calendar).
      • lib/classNames.ts - Utility for conditional class composition.
    • widgets/
      • Feature-specific bundles with colocated model and ui subfolders (e.g., dashboard, navigation).
      • dashboard/ includes DashboardOverview component, sample data generator, and type definitions.
      • navigation/ contains the NavBar component and supporting link models.
    • tests/
      • unit/ placeholder for Jest-based unit tests (currently empty).
    • public/
      • Static assets (e.g., publix.svg referenced by the nav bar).
    • coverage/
      • Output from the latest Jest run (lcov, summary, HTML report).
  • Configuration Files

    • package.json - Scripts for dev, build, start, lint, test, and test:watch.
    • next.config.ts, eslint.config.mjs, jest.config.ts, jest.setup.ts, postcss.config.mjs, tsconfig.json - Standard Next.js/Tailwind/Jest configuration.
    • next-env.d.ts - Next.js TypeScript definitions (auto-generated).

Documentation (docs/)

  • This folder is the home for internal documentation that can be surfaced in the team wiki.
  • repository-structure.md (current document) should be updated as the solution evolves.

Getting Started Pointers

  • Restore & Build backend locally
    • dotnet restore src/services/Publix.S0PMOBAI/Publix.S0PMOBAI.sln
    • dotnet build src/services/Publix.S0PMOBAI/Publix.S0PMOBAI.sln
  • Run backend tests
    • dotnet test src/services/Publix.S0PMOBAI/Publix.S0PMOBAI.sln
  • Start the Web API
    • dotnet run --project src/services/Publix.S0PMOBAI/src/Publix.S0PMOBAI.WebAPI
  • Start the Function App
    • func start (requires Azure Functions Core Tools v4) after publishing or dotnet run via the isolated worker.
  • Run the admin UI
    • npm install (once) inside src/ui/s0pmobai-admin-site
    • npm run dev for local development