This full stack application is deisgned to demonstrate .NET minimal APIs and Javascript fetch API.
The frontend is a Typescript SPA bundled with Vite. Backend is a .NET WebAPI that provides endpoints to manage the database records.
The application allows users to manage todo tasks.
-
Clone the repository
- using HTTPS
https://github.com/nwdorian/TodoSplash.git
- using SSH
git@github.com:nwdorian/TodoSplash.git
- using GitHub CLI
gh repo clone nwdorian/TodoSplash
- using HTTPS
-
Configure
appsettings.json- replace the connection string (optional)
- details in Database initialization section
- replace the connection string (optional)
-
Run the application
- navigate to the project root directory
cd ./TodoSplash - run command:
npm start- details in Startup process section
- navigate to the project root directory
- The backend is developed with .NET 10 using "minimal APIs" and Vertical Slice Architecture (VSA).
- VSA removes abstractions and layers required by Clean Architecture (CA) architecture.
- Merging CA layers and keeping related components close together shits the focus to the use case and speeds up development process.
- Website for consuming the API is developed with Typescript and Vite as bundler.
- All user interaction is done on the same page, improving the user experience.
- Typescript is configured to
strictmode, disallowing usage ofanytype.
- API responses return a problem details response defined by RFC 9457 standard.
ResultandErrortypes along withFluentValidationenable mapping problems to a structured problem details response.- This approach enables API consumers to easily handle error messages by providing a consistent response structure.
- Instead of wrapping critical paths into try-catch blocks, a global exception handler is used.
- Implemented with
IExceptionHandlerintroduced in .NET 8 - Uses
IProblemDetailsServiceto return exception information in a problem details response, aligned with the response structure of application errors.
- Connection string can be changed in
appsettings.jsonConnectionStrings-TodoSplashDb
- Default connection string is provided with
TodoSplashDbdatabase name and Windows Authentication. - SQL Server local database is created on startup by applying EF Core migrations.
- Database is created if it doesn't already exist.
- Database is seeded with 4 todo tasks when not running in
Productionenvironment. - Seeding will be skipped is records already exist in the database.
npm startscript was created for a single command startup.- The script executes the following actions
npm install- install npm dependenciestsc- Typescript files compilation to Javascriptvite build- minifies the code and outputs the build artifacts towwwrootfolderdotnet run- restores, builds and runs the .NET WebAPI
- After the startup process the application can be accessed on
http://localhost:5280
Contributions are welcome! Please fork the repository and create a pull request with your changes. For major changes, please open an issue first to discuss what you would like to change.
This project is licensed under the MIT License. See the LICENSE file for details.
For any questions or feedback, please open an issue.