This repository contains two main projects:
- Backend: ASP.NET Core Web API (serves APIs in Development and frontend + API's in Production).
- Frontend: Astro application (served via dev server in development; built and served from
wwwrootin production).
/docs-next
├──ClientApp/ # Astro frontend
├──Server/ # ASP.NET Core Backend
└──...
cd Source/SuperOffice.DocsNext
dotnet restoreFrontend
cd Source/SuperOffice.DocsNext/ClientApp
npm installYou can either
-
Manually clone or copy files of
SuperOfficeDocs/superoffice-docsandSuperOfficeDocs/contributionrepos intoClientApp/src/external-content -
Use following script to clone or update the required external GitHub repositories into the
ClientApp/src/external-content/directory. If a repository folder already exists, script will fetch and reset it to the latest commit on themainbranch.cd Source/SuperOffice.DocsNext/ClientApp/build node setup-external-repos.js
From docs-next/Source/SuperOffice.DocsNext:
dotnet runBy default API runs at: http://localhost:5215/api. Any non-API request is proxied to the frontend dev server.
From docs-next/Source/SuperOffice.DocsNext/ClientApp:
npm run devBy default Frontend dev server runs at: http://localhost:4321. The backend proxies requests to it, so you only need to visit: http://localhost:5215
/api/... → handled by backend.
Any other path → served by Astro dev server.
To manage the content during development, npm command to run dev server with reduced content was introduced. This is useful when you only need to run the development server without the content from superoffice-docs. It uses a pre-defined enviornment variable (PARTIAL_BUILD) to disable content collections from rendering.
npm run dev:partial- Build Backend (includes frontend)
From root:
dotnet publish -c Release -o out- Run Published App
cd out
dotnet docs-next.dllAPI: https://localhost:5001/api/... Frontend: served from wwwroot
To reduce build time when testing a build, npm command to do partial builds was introduced. This is useful when you only need to build the frontend without the content from superoffice-docs. It uses a pre-defined enviornment variable (PARTIAL_BUILD) to disable content collections from building.
npm run build:partialIn development, run both servers:
dotnet run (backend + proxy)
npm run dev (frontend)
In production run only the backend. It serves the built frontend automatically from wwwroot.