A full-stack web application built with ASP.NET Core and React for managing text files through a web interface.
This application provides a simple yet functional file management system that allows users to create, read, update, and delete text files. It also includes special functionality for numbering and formatting text content.
- ASP.NET Core 3.1 - Web API framework
- C# - Primary programming language
- .NET Core 3.1 - Runtime environment
- React 16.11.0 - UI library
- TypeScript 3.6.4 - Type-safe JavaScript
- Redux - State management
- React Router - Navigation
- Bootstrap & Reactstrap - UI styling
-
File Operations
- Create new text files
- Open and read existing files
- Update file content
- Delete files
-
Text Processing
- Automatic symbol/character numbering
- Line numbering functionality
- Text formatting capabilities
-
API Endpoints
GET /api/datafile/health- Health check endpointGET /api/datafile?filename={name}- Get or create filePOST /api/datafile?filename={name}- Update file contentDELETE /api/datafile?filename={name}- Delete filePOST /api/datafile/setsymbols?filename={name}- Number symbols in file
/workspace
├── userWebApi/ # Main application directory
│ ├── Controllers/ # API controllers
│ │ └── DataFileController.cs # File operations API
│ ├── Model/ # Data models
│ │ └── UserData.cs # User and data models
│ ├── ClientApp/ # React frontend
│ │ ├── src/
│ │ │ ├── App.tsx # Root component
│ │ │ ├── components/
│ │ │ │ └── Home.tsx # Main file management UI
│ │ │ └── custom.css # Custom styles
│ │ ├── public/ # Static assets
│ │ └── package.json # Frontend dependencies
│ ├── Program.cs # Application entry point
│ ├── Startup.cs # Application configuration
│ └── userWebApi.csproj # Project file
└── userWebApi.sln # Solution file
- .NET Core 3.1 SDK
- Node.js (v12 or higher recommended)
- npm (comes with Node.js)
-
Clone the repository
git clone <repository-url> cd workspace
-
Restore .NET dependencies
dotnet restore
-
Install frontend dependencies
cd userWebApi/ClientApp npm install cd ../..
-
Start the backend server
cd userWebApi dotnet run -
In a separate terminal, start the React development server
cd userWebApi/ClientApp npm start
The application will be available at:
- Backend API:
https://localhost:5001 - Frontend:
http://localhost:3000
cd userWebApi
dotnet publish -c ReleaseThe built files will be in userWebApi/bin/Release/netcoreapp3.1/publish/
curl http://localhost:51001/api/datafile/healthcurl "http://localhost:51001/api/datafile?filename=myfile"curl -X POST "http://localhost:51001/api/datafile?filename=myfile" \
-H "Content-Type: application/json" \
-d '{"fileName":"myfile","fileContent":"Hello World"}'curl -X DELETE "http://localhost:51001/api/datafile?filename=myfile"Configuration files are located in the userWebApi directory:
appsettings.json- Production settingsappsettings.Development.json- Development settings
Files are stored in the \temp directory by default. This can be modified in the DataFileController.cs file.
cd userWebApi/ClientApp
npm testcd userWebApi/ClientApp
npm run lintcd userWebApi/ClientApp
npm run buildThe application follows these principles:
- SOLID principles - Clean, maintainable code structure
- DRY (Don't Repeat Yourself) - Reusable components and functions
- KISS (Keep It Simple, Stupid) - Straightforward, readable code
- RESTful API design - Standard HTTP methods and status codes
- Component-based architecture - Modular React components
When contributing to this project, please ensure:
- Code follows SOLID, DRY, and KISS principles
- Proper error handling is implemented
- Code is well-documented
- Tests are written for new features
- Best practices for C# and TypeScript/React are followed
This project is for educational/demonstration purposes.
For issues, questions, or contributions, please refer to the project repository.