This is a template web application solution for the Datasilk stack. It contains a .NET API, authentication library, Dapper data access layer, PostgreSQL schema, and a React + Vite + TailwindCSS web client.
You can go from git clone to a running local dashboard in less than 60 seconds:
git clone https://github.com/Datasilk/Framework
cd Framework
setup.batsetup.bat prompts for a project prefix, PostgreSQL credentials, ports, and SendGrid defaults, then handles renaming, dependency installs, database creation, and schema deployment automatically. After it finishes, run the API server and Vite dev proxy, create the first admin account, and log into the dashboard.
- Datasilk.API - ASP.NET Core API controllers. Contains user management APIs.
- Datasilk.Auth - Authentication services, JWT setup, and account controller.
- Datasilk.Data - Dapper-based data access layer with auth repositories and entities.
- Datasilk.SQL - PostgreSQL schema scripts (tables, indexes, functions, sequences).
- Datasilk.Web.Server - ASP.NET Core web host that serves the API and SPA fallback.
- Datasilk.Web.Client - React + Vite + TailwindCSS front-end application.
- .NET 9 SDK or later - https://dotnet.microsoft.com/download
- PostgreSQL - a running server and a database login that can create/read/write the application database.
- Node.js LTS - required for the web client build tooling and the setup gulp tasks.
- npm - installed with Node.js.
- Git - for cloning the repository.
- Visual Studio 2022 or
dotnetCLI - for building and running the .NET projects.
-
Clone the repository.
git clone https://github.com/Datasilk/Framework cd Framework -
Run
setup.batfrom the root of the cloned folder. The script customizes the solution and all associated projects. It will prompt for:- The project prefix to use (e.g.
MyCompany). - The PostgreSQL database name (defaults to the prefix).
- PostgreSQL username and password.
- API HTTP and HTTPS ports (defaults: 7790 and 7791).
- React app (Vite) port (default: 7792).
- Whether Vite should use HTTP by default (Y/N).
- Default SendGrid from email address and name.
The script performs the following steps:
- Replaces
Datasilk/datasilkidentifiers in project files, namespaces, and content with the chosen prefix. - Renames solution folders and the
.slnfile to match the prefix. - Updates connection strings/ports in
appsettings.json,appsettings.Development.json,launchSettings.json, andvite.config.js. - Generates a 32-character JWT secret.
- Creates the web client
.envfile. - Runs
npm installfrom the renamed web client folder (<Prefix>.Web.Client) to install React/Vite dependencies. - Generates
<Prefix>.SQL/deploy.sqlfrom the schema files. - Creates the PostgreSQL database if it does not exist and runs
deploy.sqlto deploy the schema.
- The project prefix to use (e.g.
-
Build and run the solution (this takes a few seconds):
-
Open
<Prefix>.slnin Visual Studio and start the Web.Server project. -
Or run from the command line:
cd <Prefix>.Web.Server dotnet run
The first account you create is automatically promoted to admin, so you can sign up at the landing page and log straight into the dashboard.
-
-
The web client is served by the .NET SPA proxy. If you need to run Vite directly for development, run from the web client folder:
cd <Prefix>.Web.Client npm run dev
-
Run
npm installfromDatasilk.Web.Client(or<Prefix>.Web.Clientafter setup). -
Run
Datasilk.SQL/deploy.sql(or<Prefix>.SQL/deploy.sqlafter setup) while connected to a default database such astemplate1. The script creates the application database if it does not exist.psql -U <username> -d template1 -f <Prefix>.SQL/deploy.sql
-
Open
Datasilk.sln(or<Prefix>.slnafter setup) in Visual Studio or rundotnet runfromDatasilk.Web.Server(or<Prefix>.Web.Serverafter setup).