PDMLab / aspnet-react-vite-tailwind

ASP.NET Core + React + vite + Tailwind CSS template

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ASP.NET Core + React + vite + Tailwind CSS template

Template based on this blog post.

Usage

After first checkout

yarn
cd src/AspNetReactViteTailwind
dotnet restore
cd ui
yarn

Starting dev environment

# from repository root folder
yarn start

This will bring up a tmux window with panes for the ASP.NET Server and the vite dev server.

ASP.NET will open https://localhost:5001/ in your default browser.

Then browse to https://localhost:5001/app:

Known issues

  • Not tested on Windows
  • JetBrains Rider code completion does not work for TailwindCSS 3 JIT mode in .cshtml files currently.

Renaming solution / project / folders

Of course, you want to rename the projects files to match our needs.

You can use these commands, e.g. AspNetReactViteTailwind gets renamed to MyApp:

Rename all references inside the files

macOS

LC_ALL=C find . -type f -name '*.*' -not \( -path './node_modules/*' -o -path './src/AspNetReactViteTailwind/node_modules/*' -o -path './assets' \) -exec sed -i '' 's|AspNetReactViteTailwind|MyApp|g' {} \;

Linux

LC_ALL=C find . -type f -name '*.*' -not \( -path './node_modules/*' -o -path './src/AspNetReactViteTailwind/node_modules/*' -o -path './assets' \) -exec sed -i 's/AspNetReactViteTailwind/MyApp/g' {} \;

Rename files and folders

macOS and Linux

find . -depth -name "*AspNetReactViteTailwind*" | \
while IFS= read -r ent; do mv $ent ${ent%AspNetReactViteTailwind*}MyApp${ent##*AspNetReactViteTailwind}; done

About

ASP.NET Core + React + vite + Tailwind CSS template

License:MIT License


Languages

Language:HTML 35.5%Language:C# 22.8%Language:TypeScript 22.4%Language:CSS 10.3%Language:JavaScript 9.0%