A full-stack application with .NET backend and React frontend for managing persons with CRUD operations.
├── Backend/ # .NET Web API
│ ├── Controllers/ # API Controllers
│ ├── Models/ # Entity models
│ ├── Services/ # Business logic services
│ └── Data/ # Database context
└── Frontend/ # React TypeScript application
└── src/
├── components/ # React components
├── services/ # API service layer
└── types/ # TypeScript types
- RESTful API with CRUD operations for Person entity
- In-memory database (Entity Framework Core)
- Service layer for business logic
- CORS enabled for React frontend
- Id (int)
- FirstName (string)
- LastName (string)
- Email (string)
- Age (int)
GET /api/persons- Get all personsGET /api/persons/{id}- Get person by IDPOST /api/persons- Create new personPUT /api/persons/{id}- Update existing personDELETE /api/persons/{id}- Delete person
-
Navigate to the Backend directory:
cd Backend -
Run the application:
dotnet run
-
The API will be available at
http://localhost:5000andhttps://localhost:5001
- List of all persons in a table
- Add new person form
- Edit existing person (inline form update)
- Delete person with confirmation
- Responsive design
- App.tsx - Main application component with state management
- PersonList.tsx - Displays persons in a table with edit/delete actions
- PersonForm.tsx - Form for creating and updating persons
-
Navigate to the Frontend directory:
cd Frontend -
Install dependencies (if not already done):
npm install
-
Run the development server:
npm run dev
-
The application will be available at
http://localhost:5173
Terminal 1 (Backend):
cd Backend
dotnet runTerminal 2 (Frontend):
cd Frontend
npm run devCreate a file named start.ps1 in the root directory:
# Start backend
Start-Process powershell -ArgumentList "-NoExit", "-Command", "cd Backend; dotnet run"
# Wait a bit for backend to start
Start-Sleep -Seconds 5
# Start frontend
Start-Process powershell -ArgumentList "-NoExit", "-Command", "cd Frontend; npm run dev"Run: .\start.ps1
- Start both backend and frontend
- Open your browser to
http://localhost:5173 - Add a new person using the form
- View the person in the list
- Edit the person by clicking "Edit"
- Delete the person by clicking "Delete"
- .NET 10.0
- ASP.NET Core Web API
- Entity Framework Core (In-Memory)
- C# 13
- React 19
- TypeScript
- Vite
- CSS3
- The backend uses an in-memory database, so data will be lost when the application stops
- CORS is configured to allow requests from
http://localhost:3000andhttp://localhost:5173 - The API runs on port 5000 (HTTP) and 5001 (HTTPS) by default
- The React app runs on port 5173 by default (Vite)