├── .gitattributes ├── .gitignore ├── LICENSE ├── MicrofrontendTemplate ├── .gitignore ├── .template.config │ └── template.json ├── Microfrontend.sln ├── Portal │ ├── Portal.csproj │ ├── Properties │ │ └── launchSettings.json │ ├── appsettings.json │ ├── client │ │ ├── auth.js │ │ ├── components │ │ │ ├── App.js │ │ │ ├── Landing.js │ │ │ ├── Login.js │ │ │ └── Portal.js │ │ ├── index.js │ │ └── loader.js │ ├── package-lock.json │ ├── package.json │ ├── run.bat │ ├── server │ │ ├── Controllers │ │ │ └── LoginController.cs │ │ ├── Program.cs │ │ └── Startup.cs │ ├── tempkey.rsa │ ├── webpack.config.js │ └── wwwroot │ │ ├── 404.html │ │ ├── index.html │ │ └── landing.jpg ├── README.md ├── ReactDashboardApp │ ├── Properties │ │ └── launchSettings.json │ ├── README.md │ ├── ReactDashboardApp.csproj │ ├── appsettings.json │ ├── client │ │ ├── components │ │ │ ├── ActivitiesCard.js │ │ │ ├── Dashboard.js │ │ │ └── InfoCard.js │ │ └── index.js │ ├── package-lock.json │ ├── package.json │ ├── run.bat │ ├── server │ │ ├── Program.cs │ │ ├── Services │ │ │ └── MockLiveDataService.cs │ │ ├── Startup.cs │ │ └── ViewModels │ │ │ └── Dashboard.cs │ ├── webpack.config.js │ └── wwwroot │ │ └── index.html ├── ReactFormApp │ ├── Properties │ │ └── launchSettings.json │ ├── README.md │ ├── ReactFormApp.csproj │ ├── appsettings.json │ ├── client │ │ ├── components │ │ │ ├── AddressForm.js │ │ │ ├── BasicInfoForm.js │ │ │ ├── Form.js │ │ │ └── NewCustomerDialog.js │ │ └── index.js │ ├── package-lock.json │ ├── package.json │ ├── run.bat │ ├── server │ │ ├── Program.cs │ │ ├── Services │ │ │ ├── Customer.cs │ │ │ ├── CustomerFormData.cs │ │ │ └── CustomerRepository.cs │ │ ├── Startup.cs │ │ └── ViewModels │ │ │ ├── AddressForm.cs │ │ │ ├── CustomerForm.cs │ │ │ ├── NewCustomerForm.cs │ │ │ ├── PersonForm.cs │ │ │ └── PhoneForm.cs │ ├── webpack.config.js │ └── wwwroot │ │ └── index.html ├── ReactTodoApp │ ├── Properties │ │ └── launchSettings.json │ ├── README.md │ ├── ReactTodoApp.csproj │ ├── appsettings.json │ ├── client │ │ ├── components │ │ │ └── TodoList.js │ │ └── index.js │ ├── package-lock.json │ ├── package.json │ ├── run.bat │ ├── server │ │ ├── Program.cs │ │ ├── Startup.cs │ │ └── ViewModels │ │ │ └── TodoList.cs │ ├── webpack.config.js │ └── wwwroot │ │ └── index.html ├── Shared │ ├── IdentityServer │ │ ├── IdentityServerClient.cs │ │ ├── IdentityServerConfig.cs │ │ └── IdentityServerSettings.cs │ └── Shared.csproj ├── VueTodoApp │ ├── Properties │ │ └── launchSettings.json │ ├── README.md │ ├── VueTodoApp.csproj │ ├── appsettings.json │ ├── client │ │ ├── components │ │ │ └── TodoList.vue │ │ └── index.js │ ├── package-lock.json │ ├── package.json │ ├── run.bat │ ├── server │ │ ├── Program.cs │ │ ├── Startup.cs │ │ └── ViewModels │ │ │ └── TodoList.cs │ ├── webpack.config.js │ └── wwwroot │ │ └── index.html ├── global.json ├── heroku-deploy │ ├── Portal │ │ ├── Dockerfile │ │ ├── appsettings.json │ │ ├── build.bat │ │ ├── deploy.bat │ │ └── excludedfiles.txt │ ├── ReactDashboardApp │ │ ├── Dockerfile │ │ ├── appsettings.json │ │ ├── build.bat │ │ ├── deploy.bat │ │ └── excludedfiles.txt │ └── nginx │ │ ├── Dockerfile │ │ ├── deploy.bat │ │ └── nginx.conf ├── nginx │ ├── .gitignore │ ├── conf │ │ ├── fastcgi.conf │ │ ├── fastcgi_params │ │ ├── koi-utf │ │ ├── koi-win │ │ ├── mime.types │ │ ├── nginx.conf │ │ ├── scgi_params │ │ ├── uwsgi_params │ │ └── win-utf │ ├── contrib │ │ ├── README │ │ ├── geo2nginx.pl │ │ ├── unicode2nginx │ │ │ ├── koi-utf │ │ │ ├── unicode-to-nginx.pl │ │ │ └── win-utf │ │ └── vim │ │ │ ├── ftdetect │ │ │ └── nginx.vim │ │ │ ├── ftplugin │ │ │ └── nginx.vim │ │ │ ├── indent │ │ │ └── nginx.vim │ │ │ └── syntax │ │ │ └── nginx.vim │ ├── docs │ │ ├── CHANGES │ │ ├── CHANGES.ru │ │ ├── LICENSE │ │ ├── OpenSSL.LICENSE │ │ ├── PCRE.LICENCE │ │ ├── README │ │ └── zlib.LICENSE │ ├── html │ │ ├── 50x.html │ │ └── index.html │ ├── nginx.exe │ ├── run.bat │ └── stop.bat ├── package-lock.json └── run.bat ├── README.md ├── ReactTemplate ├── README.md ├── content │ ├── .gitignore │ ├── .template.config │ │ └── template.json │ ├── client │ │ ├── app.tsx │ │ ├── auth.ts │ │ ├── components │ │ │ ├── BasePage.tsx │ │ │ ├── Header.tsx │ │ │ ├── Sidebar.tsx │ │ │ ├── dashboard │ │ │ │ ├── InfoBox.tsx │ │ │ │ ├── RecentActivities.tsx │ │ │ │ ├── ServerUsage.tsx │ │ │ │ ├── Traffic.tsx │ │ │ │ └── Utilization.tsx │ │ │ └── table │ │ │ │ ├── InlineEdit.tsx │ │ │ │ └── Pagination.tsx │ │ ├── favicon.ico │ │ ├── images │ │ │ └── material_bg.png │ │ ├── routes.tsx │ │ ├── styles │ │ │ ├── app.css │ │ │ ├── styles.ts │ │ │ └── theme-default.ts │ │ └── views │ │ │ ├── App.tsx │ │ │ ├── AppLayout.tsx │ │ │ ├── Dashboard.tsx │ │ │ ├── FormPage.tsx │ │ │ ├── LoginPage.tsx │ │ │ └── TablePage.tsx │ ├── package-lock.json │ ├── package.json │ ├── projectName.csproj │ ├── projectName.sln │ ├── server │ │ ├── AuthServer.cs │ │ ├── Program.cs │ │ ├── Services │ │ │ ├── EmployeeService.cs │ │ │ ├── MockLiveDataService.cs │ │ │ └── employees.json │ │ └── ViewModels │ │ │ ├── AppLayout.cs │ │ │ ├── Dashboard.cs │ │ │ ├── Form.cs │ │ │ └── Table.cs │ ├── tsconfig.json │ ├── webpack.config.js │ └── wwwroot │ │ ├── 404.html │ │ ├── images │ │ └── avatar.png │ │ └── index.html ├── screenshot.gif └── template.nuspec └── _archive ├── HelloWorld ├── HelloWorld.cs ├── HelloWorld.csproj ├── HelloWorld.sln ├── Program.cs ├── Properties │ └── launchSettings.json ├── Startup.cs ├── package-lock.json ├── package.json ├── src │ ├── HelloWorld.jsx │ └── app.js ├── webpack.config.js └── wwwroot │ ├── bundle.js │ └── index.html ├── LiveChart ├── IISPublishingSteps.md ├── LiveChart.cs ├── LiveChart.csproj ├── LiveChart.sln ├── Program.cs ├── Properties │ └── launchSettings.json ├── Startup.cs ├── compilerconfig.json ├── compilerconfig.json.defaults ├── package-lock.json ├── package.json ├── src │ ├── LiveChart.jsx │ └── app.js ├── webpack.config.js └── wwwroot │ ├── bundle.js │ └── index.html ├── README.md ├── ReactTemplateTS ├── .editorconfig ├── README.md ├── content │ ├── .babelrc │ ├── .gitignore │ ├── .template.config │ │ └── template.json │ ├── client │ │ ├── app.tsx │ │ ├── auth.tsx │ │ ├── components │ │ │ ├── BasePage.tsx │ │ │ ├── Header.tsx │ │ │ ├── Sidebar.tsx │ │ │ ├── dashboard │ │ │ │ ├── InfoBox.tsx │ │ │ │ ├── RecentActivities.tsx │ │ │ │ ├── ServerUsage.tsx │ │ │ │ ├── Traffic.tsx │ │ │ │ └── Utilization.tsx │ │ │ └── table │ │ │ │ ├── InlineEdit.tsx │ │ │ │ └── Pagination.tsx │ │ ├── favicon.ico │ │ ├── images │ │ │ └── material_bg.png │ │ ├── routes.tsx │ │ ├── styles │ │ │ ├── app.css │ │ │ ├── styles.ts │ │ │ └── theme-default.ts │ │ └── views │ │ │ ├── App.tsx │ │ │ ├── AppLayout.tsx │ │ │ ├── Dashboard.tsx │ │ │ ├── FormPage.tsx │ │ │ ├── LoginPage.tsx │ │ │ └── TablePage.tsx │ ├── dotnetify_react_template.csproj │ ├── dotnetify_react_template.sln │ ├── images.d.ts │ ├── package.json │ ├── server │ │ ├── AuthServer.cs │ │ ├── Program.cs │ │ ├── Services │ │ │ ├── EmployeeService.cs │ │ │ ├── MockLiveDataService.cs │ │ │ └── employees.json │ │ ├── Startup.cs │ │ └── ViewModels │ │ │ ├── AppLayout.cs │ │ │ ├── Dashboard.cs │ │ │ ├── Form.cs │ │ │ └── Table.cs │ ├── tsconfig.json │ ├── webpack.config.js │ └── wwwroot │ │ └── index.html ├── screenshot.gif └── template.nuspec └── Routing ├── DotNetify.ServerSideRender.cs ├── Program.cs ├── Properties └── launchSettings.json ├── Routing.csproj ├── Routing.sln ├── Startup.cs ├── ViewModels ├── Index.cs ├── Page1.cs └── Page2.cs ├── compilerconfig.json ├── compilerconfig.json.defaults ├── package.json ├── src ├── Index.js ├── Index.jsx ├── Index.min.js ├── app.js └── app.server.js ├── webpack.config.js └── wwwroot ├── Index.html ├── Page1.js ├── Page1.jsx ├── Page1.min.js ├── Page2.js ├── Page2.jsx ├── Page2.min.js ├── Page3.html ├── bundle.js └── favicon.ico /MicrofrontendTemplate/.template.config/template.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dsuryd/dotNetify-react-template/c1f80d7cdb751069eaa5f7ed7e74680997be1eb9/MicrofrontendTemplate/.template.config/template.json -------------------------------------------------------------------------------- /MicrofrontendTemplate/Portal/Portal.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | netcoreapp3.1 4 | Portal 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | %(DistFiles.Identity) 39 | PreserveNewest 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /MicrofrontendTemplate/Portal/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:5000/", 7 | "sslPort": 0 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development" 16 | } 17 | }, 18 | "dev": { 19 | "commandName": "Project", 20 | "launchBrowser": true, 21 | "environmentVariables": { 22 | "ASPNETCORE_ENVIRONMENT": "Development" 23 | }, 24 | "applicationUrl": "http://localhost:5000/" 25 | }, 26 | "prod": { 27 | "commandName": "Project", 28 | "launchBrowser": true, 29 | "environmentVariables": { 30 | "ASPNETCORE_ENVIRONMENT": "Production" 31 | }, 32 | "applicationUrl": "http://localhost:5000/" 33 | } 34 | } 35 | } -------------------------------------------------------------------------------- /MicrofrontendTemplate/Portal/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "IdentityServer": { 3 | "Uri": "http://localhost:5000" 4 | } 5 | } -------------------------------------------------------------------------------- /MicrofrontendTemplate/Portal/client/auth.js: -------------------------------------------------------------------------------- 1 | const url = '/api/login'; 2 | 3 | export const signIn = (username, password) => { 4 | return fetch(url, { 5 | method: 'post', 6 | body: 'username=' + username + '&password=' + password, 7 | headers: { 'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8' } 8 | }) 9 | .then(response => { 10 | if (!response.ok) throw new Error(response.status); 11 | return response.json(); 12 | }) 13 | .then(token => window.sessionStorage.setItem('access_token', token.access_token)); 14 | }; 15 | 16 | export const signOut = () => { 17 | window.sessionStorage.removeItem('access_token'); 18 | window.location.href = '/'; 19 | }; 20 | 21 | export const validateToken = token => { 22 | return fetch(url + '/validate', { 23 | method: 'post', 24 | body: 'token=' + token, 25 | headers: { 'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8' } 26 | }).then(response => response.ok); 27 | }; 28 | 29 | export const getAccessToken = () => { 30 | return window.sessionStorage.getItem('access_token'); 31 | }; 32 | 33 | export const getAuthHeaders = _ => ({ 34 | headers: { Authorization: 'Bearer ' + getAccessToken() }, 35 | exceptionHandler: _ => signOut() 36 | }); 37 | -------------------------------------------------------------------------------- /MicrofrontendTemplate/Portal/client/components/App.js: -------------------------------------------------------------------------------- 1 | import { Fragment, useState, useEffect } from 'react'; 2 | import { getAccessToken, validateToken } from '../auth'; 3 | import Portal from './Portal'; 4 | import Landing from './Landing'; 5 | 6 | export const CompanyLogo = styled.a` 7 | display: flex; 8 | align-items: center; 9 | margin-left: 1rem; 10 | background-image: url(https://dotnetify.net/content/images/dotnetify-logo.png); 11 | background-size: 100% 100%; 12 | width: 200px; 13 | height: 39px; 14 | `; 15 | 16 | const App = _ => { 17 | const [ accessToken ] = useState(getAccessToken()); 18 | const [ validatingToken, setValidatingToken ] = useState(null); 19 | const [ loggedIn, setLoggedIn ] = useState(false); 20 | 21 | useEffect(() => { 22 | if (validatingToken === null) { 23 | setValidatingToken(!!accessToken); 24 | if (accessToken) { 25 | validateToken(accessToken).then(valid => { 26 | setLoggedIn(valid); 27 | setValidatingToken(false); 28 | }); 29 | } 30 | } 31 | }); 32 | 33 | if (validatingToken !== false) return ; 34 | return loggedIn ? : setLoggedIn(true)} />; 35 | }; 36 | 37 | export default App; 38 | -------------------------------------------------------------------------------- /MicrofrontendTemplate/Portal/client/components/Login.js: -------------------------------------------------------------------------------- 1 | import { useState } from 'react'; 2 | import { signIn } from '../auth'; 3 | import { Alert, Button, Form, Panel, PasswordField, TextField, VMContext, withTheme } from 'dotnetify-elements'; 4 | 5 | const outerPanelCss = ` 6 | width: 25rem; 7 | padding: 3rem; 8 | background-color: #f5f5f5; 9 | border-radius: 5px; 10 | box-shadow: 0 20px 40px -20px rgba(0,0,0,.5); 11 | `; 12 | 13 | const Login = ({ onAuthenticated }) => { 14 | const [ loginError, setLoginError ] = useState(); 15 | 16 | const handleLogin = ({ User, Password }) => { 17 | setLoginError(null); 18 | signIn(User, Password) 19 | .then(_ => { 20 | onAuthenticated(); 21 | }) 22 | .catch(error => { 23 | if (error.message == '401') setLoginError('Invalid username and/or password'); 24 | else setLoginError(`Unexpected error: ${error.message}`); 25 | }); 26 | }; 27 | 28 | return ( 29 | 30 | 31 |

Sign In To Get Started

32 |
33 | 34 | 35 | 36 | {loginError} 37 |