A todo list app written with ASP.NET Core SPA with React using Typescript customized to run with Vite instead of react-scripts
.
You'll need:
npm
oryarn
. If you're usingyarn
, then you'll need to update the.csproj
file to useyarn
instead ofnpm
.- .NET 7 SDK with your IDE of choice.
- An instance of SQL Server to connect to. You can utilize SQL Server Express LocalDB for testing purposes.
- If you want to switch to another DB provider, you need to install the relevant NuGet package and change the DbContext option in Program.cs. You'll also need to regenerate the migrations via
dotnet-ef
.
- If you want to switch to another DB provider, you need to install the relevant NuGet package and change the DbContext option in Program.cs. You'll also need to regenerate the migrations via
Do this first!
- Clone this repo
- Restore the NuGet packages
dotnet restore
- Run the secrets manager init method to update the project's SecretId
dotnet user-secrets init
- Copy the content of
appsettings.Example.json
to the secrets file and tweak as needed.- Windows:
%APPDATA%\Microsoft\UserSecrets\<user_secrets_id>\secrets.json
- Linux/macOS:
~/.microsoft/usersecrets/<user_secrets_id>/secrets.json
- Windows:
- Run the DB Seed routine to populate the DB with sample data
dotnet run seed=True
- Change directory into the
ClientApp
folder. - Restore packages.
- NPM:
npm install
- Yarn:
yarn
Make sure you've done API Setup and Front-end SPA Setup first!
Ensure that you're in the repo's root and run
dotnet run
This will start the development server listening on http://localhost:5001. Upon receiving a request, it will automatically launch Vite and spin up the frontend site. Note: Closing the dotnet
process will also abort vite, but not vice-versa!
You can find the swagger endpoint at http://localhost:5001/swagger. From here, you can test-drive the API endpoints.
This project is licensed under the MIT License.
Please feel free to submit pull requests or fork this repo!
Robert Cato <saiwolf@swmnu.net>