Documentation can be found in the docs sub-directory.
- Node.JS - LTS
- No need to install additional tools via Chocolatey.
- Git
- .NET SDK
- SQL Server 2019 Express
- Run the custom setup and install a new instance.
- When installing features, you can uncheck the box that installs Machine Learning features.
- During setup, name your instance
DevSql
.
- VS Code
- SQL Server Management Studio
- PowerShell Core
# verify if npm dependencies are installed
npm list -g --depth 0
# install the latest versions
npm i -g @angular-devkit/schematics-cli @angular/cli cypress
# install cypress binaries
cypress install
# verify if dotnet-ef tool is installed
dotnet tool list --global
# install if no present
dotnet tool install --global dotnet-ef
# install the latest version if present
dotnet tool update --global dotnet-ef
-
Clone this repository to your local environment with
git clone https://github.com/JaimeStill/offline-platform
-
Open a PowerShell terminal at the location where this repository is cloned.
-
Run the following to initialize a project using the app platform:
# install dependencies npm i # build the schematics npm run build # initialize a project schematics .:platform {name} --serverName={serverName} --debug=false # example schematics .:platform demo --serverName=Demo --debug=false
For a list of all of the available options, see src/platform/schema.json.
Once the project is initialized, you will need to do the following:
-
Change directory into the folder created for your project.
-
Run
npm i --offline
to install dependencies.- This will install
node_modules
dependencies from thenode_cache
directory.
- This will install
-
Run
npm run build
to build thecore
library.
You can find all of the available scripts in the package.json
of the workspace. The following is a description of the available scripts:
Script | Executes | Description |
---|---|---|
npm run build |
ng build core |
Build the core library used by the Angular apps |
npm run restore |
dotnet restore ./server -s nuget-packages |
Restores NuGet packages from the cached nuget-packages folder in each server project. |
npm run seed |
dotnet run --project ./server/{Project}.DbCli -- "Dev" |
Seed the dev database using the DbCli server project. The seeding logic is executed in server/{Project}.DbCli/Program.cs , which initializes services and calls their Seed method. |
npm run start-server |
dotnet run --project ./server/{Project}.Web |
Starts the .NET server for the workspace |
npm run update-db |
dotnet ef database update -s ./server/{Project}.Web |
Apply the latest EF migrations to the database |
npm run start-docs |
ng serve docs |
Starts the Angular documentation project built into the workspace |
npm run start-{app} |
ng serve {app} |
Starts the specified Angular application |
npm run watch |
ng build core --watch |
Builds the core library and watches for changes. This enables hot reloading for the library when modifications are made during development. |
npm run watch-server |
dotnet watch run --project ./server/{Project}.Web |
Starts the .NET server for the workspace in watch mode. Any modifications to the server files will trigger a rebuild and reload automatically. |
To add content to the
docs
project, add Markdown files to the/server/{Project}.Web/wwwroot/docs
directory in any folder structure you prefer.
-
From the root of the project workspace (where the
angular.json
file is located), open a PowerShell terminal. -
Run the following command:
ng g {relative path to platform/src}:collection.json {name} --port={port}
# example
ng g ../../../platform/src:collection.json items --port=3001
For a list of all of the available options, see src/app/schema.json
This will create a new folder with the name provided in the ./client
directory of your workspace.
After the app is added to the workspace, you need to add the debug URL to the CorsOrigins
array specified in the ./server/{Project}.Web/appsettings.Development.json
file. See appsettings.Development.json.
You can run the newly added app by executing npm run start-{name}
. For example, npm run start-items
.