874796c86094e4b4d0cdbf2c7ad817babed9335a
MyOffice
Layers Frontend <-> Backend <-> Services <-> Repositories <-> Database
1. MyOffice.SPA Frontend layer Angular
2. MyOffice.Web Backend layer ASP Core
3. MyOffice.Data.Services Services layer
5. MyOffice.Data.Models Models
6. MyOffice.Data.Repositories Database layer
7. MyOffice.DbContext AppDbContext EntityFramework Core
8. MyOffice.Migrations.Postgres Postgres Migrations
9. MyOffice.Migrations.Sqlite Sqlite Migrations
DataBase
- SQLite
- PostgreSql
- MS SQL
Develompent
- Local IIS
- Express IIS
Authentication & Authorization
- OpenIddict (replaces IdentityServer4)
- Custom UserStore + Identity V3 password hashes (legacy hashes rehashed on login)
- SPA: email/password via ROPC (kept); Authorization Code + PKCE configured for interactive OIDC
- Login with Google / Auth0 (
externalgrant) - Details: docs/AUTH.md, refactoring: docs/REFACTORING_PLAN.md
Build & Deploy
- Build with .bat
- Deploy to Linux
Get started
- Restore / build:
dotnet build MyOffice.Web/MyOffice.Web.csproj - SPA:
cd MyOffice.SPA && npm install && npm start(default http://localhost:4300) - Set startup project to
MyOffice.Web, run (API default http://localhost:9100) - Ensure
FrontEnd:Hostmatches the SPA origin (appsettings.json) - Tests:
dotnet test MyOffice.Tests/MyOffice.Tests.csproj - Empty DB is auto-filled with demo users (rates at Jan 1, sample accounts/items/motions):
user_UAH@user_UAH.userUAH/user_UAHuser_USD@user_USD.userUSD/user_USDuser_EUR@user_EUR.userEUR/user_EUR
add site to IIS
- add Site name:myproject Physical path:...\MyProject\MyProject.Web Port:9100
- Select 'IIS', Run Backend (F5)
Settings
- launchSettings.json
- appsettings appsettings.json appsettings.Development.json appsettings.Production.json
- Optional:
AutoMapper:LicenseKey(or envAUTOMAPPER_LICENSE_KEY) — free Community key from https://automapper.io if under ~$5M revenue. Empty works; you only get license warning logs.
External providers
- Auth0 appsettings ExternalProviders:Auth0
- Google appsettings ExternalProviders:Google
PowerShell scripts
- use 'Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass' to allow run *.ps1
- params.txt 2.1. publish_folder=_Published (folder to publish) 2.2. linux_user=root (linux user) 2.3. linux_host=192.168.1.215 (linux host) 2.4. linux_folder=/var/www/MyProject (folder in linux)
Build
- .\build.ps1 1.1. '.\build.ps1' - build Backend + Frontend 1.2. '.\build.ps1 dotnet' build Backend 1.3. '.\build.ps1 spa' build Frontend
Docker demo (SPA + API + Postgres + pgAdmin)
cd Dockerthen.\build.ps1(defaults :32080 / :32081 / :32082)- After code changes:
.\build.ps1 rebuild(or.\build.ps1 resetto wipe DB + re-seed) - Details: Docker/README.md
Proxmox (Gitea public scripts + release artifact)
- Maintainer:
.\proxmox\publish.ps1 -Tar→.\proxmox\release.ps1→.\proxmox\sync-public.ps1 -Push(or Gitea Actions) - User on Proxmox: set
GITEA_URL/GITEA_OWNER/REPO_RAW_BASE, runmyoffice.sh(see proxmox/README.md) - Proxy nginx to
http://<ct-ip>:9100 - Lab SSH (no Gitea):
.\proxmox\deploy.ps1 -TargetHost <ct-ip>