# sridharravva/react-crud-with-asp.net-core-web-api architecture

> Architecture diagram of the GitHub repository sridharravva/react-crud-with-asp.net-core-web-api, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-10-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sridharravva/react-crud-with-asp.net-core-web-api
- Repository: https://github.com/sridharravva/react-crud-with-asp.net-core-web-api

## Overview

##### Project type and purpose
- This is a full-stack CRUD application.
- Frontend: React.js app (create-react-app structure) using Redux for state management and Material-UI for form design.
- Backend: ASP.NET Core 3.0 Web API exposing CRUD endpoints backed by Entity Framework Core and a relational database.
- Use case: Manage DCandidate records (create, read, update, delete) from a React SPA via HTTP calls to the Web API.

##### File structure
A. Top-level
- WebAPI/ – .NET Core Web API solution
- react-app/ – React single-page application
B. WebAPI folder
- WebAPI.sln – Visual Studio solution
- Controllers/ – DCandidateController.cs + WeatherForecastController.cs (API endpoints)
- Models/ – DCandidate.cs, DonationDBContext.cs (EF Core entities & DbContext)
- Migrations/ – EF Core code-first migrations
- appsettings.json & appsettings.Development.json – configuration (DB connection, CORS)
- Startup.cs & Program.cs – middleware and host configuration
C. react-app folder
- public/ – index.html, manifest.json, static assets
- src/
– components/ – UI components (DCandidateForm, DCandidates list, useForm hook)
– actions/ – Redux action creators and API wrapper (api.js, dCandidate.js, store.js)
– reducers/ – Redux reducers (dCandidate.js, combined in index.js)
– App.js – root component, routes and layout
– index.js – React DOM bootstrap, store provider, service worker registration

##### README for additional insights
- Highlights: CRUD web methods, CORS enabled, real-time form validation, Redux integration, Material-UI design.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Client Side
    subgraph "Client: React SPA"
        direction TB
        UI["UI Components"]:::frontend
        Form["DCandidateForm"]:::frontend
        List["DCandidates List"]:::frontend
        Hook["useForm Hook"]:::frontend
        AppComp["App.js"]:::frontend
        Index["index.js"]:::frontend
        SW["serviceWorker.js"]:::frontend
        StoreCfg["Redux Store"]:::store
        Actions["Redux Actions"]:::store
        Reducer["Redux Reducer"]:::store
        APIClient["axios API Client"]:::api
        Public["Public Assets"]:::frontend
    end

    %% Server Side
    subgraph "Server: ASP.NET Core Web API"
        direction TB
        Sol["WebAPI.sln"]:::backend
        CtrlDC["DCandidateController"]:::backend
        CtrlWF["WeatherForecastController"]:::backend
        Models["Models & DbContext"]:::backend
        DCandidateEntity["DCandidate.cs"]:::backend
        DbContext["DonationDBContext"]:::backend
        Migrations["Migrations"]:::backend
        Config["Startup & Program"]:::backend
        AppSettings["appsettings.json"]:::backend
        csproj["WebAPI.csproj"]:::backend
        Launch["launchSettings.json"]:::backend
    end

    %% Database
    subgraph "Database"
        direction TB
        SQL["SQL Database"]:::database
    end

    %% Connections
    UI -->|"dispatch Redux action"| StoreCfg
    Form --> UI
    List --> UI
    Hook --> Form
    Actions --> StoreCfg
    Reducer --> StoreCfg
    StoreCfg -->|"calls"| APIClient
    APIClient -->|"HTTP Request (JSON)"| CtrlDC
    CtrlDC -->|"uses EF Core"| DbContext
    CtrlDC -->|"returns JSON"| APIClient
    DbContext -->|"SQL Query"| SQL
    Config --> CtrlDC
    Config --> DbContext

    AppComp --> UI
    Index --> AppComp
    SW --> Index
    Public --> UI

    Sol --> CtrlDC
    Sol --> CtrlWF
    Sol --> Models
    Sol --> Migrations
    Sol --> Config
    Sol --> AppSettings
    Sol --> csproj
    Sol --> Launch

    %% Click Events - Client
    click UI "https://github.com/sridharravva/react-crud-with-asp.net-core-web-api/tree/master/react-app/src/components"
    click Form "https://github.com/sridharravva/react-crud-with-asp.net-core-web-api/blob/master/react-app/src/components/DCandidateForm.js"
    click List "https://github.com/sridharravva/react-crud-with-asp.net-core-web-api/blob/master/react-app/src/components/DCandidates.js"
    click Hook "https://github.com/sridharravva/react-crud-with-asp.net-core-web-api/blob/master/react-app/src/components/useForm.js"
    click AppComp "https://github.com/sridharravva/react-crud-with-asp.net-core-web-api/blob/master/react-app/src/App.js"
    click Index "https://github.com/sridharravva/react-crud-with-asp.net-core-web-api/blob/master/react-app/src/index.js"
    click SW "https://github.com/sridharravva/react-crud-with-asp.net-core-web-api/blob/master/react-app/src/serviceWorker.js"
    click StoreCfg "https://github.com/sridharravva/react-crud-with-asp.net-core-web-api/blob/master/react-app/src/actions/store.js"
    click Actions "https://github.com/sridharravva/react-crud-with-asp.net-core-web-api/blob/master/react-app/src/actions/dCandidate.js"
    click APIClient "https://github.com/sridharravva/react-crud-with-asp.net-core-web-api/blob/master/react-app/src/actions/api.js"
    click Reducer "https://github.com/sridharravva/react-crud-with-asp.net-core-web-api/blob/master/react-app/src/reducers/dCandidate.js"
    click Public "https://github.com/sridharravva/react-crud-with-asp.net-core-web-api/tree/master/react-app/public"
    click Sol "https://github.com/sridharravva/react-crud-with-asp.net-core-web-api/blob/master/WebAPI/WebAPI.sln"

    %% Click Events - Server
    click CtrlDC "https://github.com/sridharravva/react-crud-with-asp.net-core-web-api/blob/master/WebAPI/WebAPI/Controllers/DCandidateController.cs"
    click CtrlWF "https://github.com/sridharravva/react-crud-with-asp.net-core-web-api/blob/master/WebAPI/WebAPI/Controllers/WeatherForecastController.cs"
    click DCandidateEntity "https://github.com/sridharravva/react-crud-with-asp.net-core-web-api/blob/master/WebAPI/WebAPI/Models/DCandidate.cs"
    click DbContext "https://github.com/sridharravva/react-crud-with-asp.net-core-web-api/blob/master/WebAPI/WebAPI/Models/DonationDBContext.cs"
    click Migrations "https://github.com/sridharravva/react-crud-with-asp.net-core-web-api/tree/master/WebAPI/WebAPI/Migrations/"
    click AppSettings "https://github.com/sridharravva/react-crud-with-asp.net-core-web-api/blob/master/WebAPI/WebAPI/appsettings.json"
    click Config "https://github.com/sridharravva/react-crud-with-asp.net-core-web-api/blob/master/WebAPI/WebAPI/Startup.cs"
    click csproj "https://github.com/sridharravva/react-crud-with-asp.net-core-web-api/blob/master/WebAPI/WebAPI/WebAPI.csproj"
    click Launch "https://github.com/sridharravva/react-crud-with-asp.net-core-web-api/blob/master/WebAPI/WebAPI/Properties/launchSettings.json"

    %% Styles
    classDef frontend fill:#D0E6FF,stroke:#0366D6,color:#0366D6
    classDef store fill:#E6FFE6,stroke:#28A745,color:#28A745
    classDef api fill:#F0E6FF,stroke:#6F42C1,color:#6F42C1
    classDef backend fill:#FFE6CC,stroke:#D73A49,color:#D73A49
    classDef database fill:#FFF5E6,stroke:#DBAB09,color:#DBAB09
```
