A simple example of using nuxt for front-end development and ServiceStack for backend development
Modeled after https://github.com/nuxt/example-auth0, with a few additions (separation of backend from frontend, http proxy in dev mode, role-based visibility and functionality ...)
# cd into the 'frontend' directory
$ cd frontend
# install dependencies
$ npm install # Or yarn install
To run ServiceStack, you'll need .NET Core 3.1
# start the ServiceStack backend in a terminal (from within the frontend directory)
$ npm run server
Alternatively, you can edit this script in 'package.json' to run dotnet watch, etc ...
# serve with hot reload at localhost:3000, uses http-proxy to connect to ServiceStack api at localhost:5000
# make sure the backend is started first (use a API_URL env variable for a different api location)
$ npm run dev
# build for production and launch server (make sure the API_URL env variable is set)
$ npm run build
$ npm start
Generate as a static project and merge the files into the ServiceStack asp.net project (generates and copies dist to wwwroot)
# (Optional) run the server so that required API calls are resolved during the generate process
npm run server
# generate the static app
npm run generate
Typically static pages would be generated against a remote API, in which case, setting an API_URL env variable in the command above would make sense, and there is no need to ever run a local version of the backend locally.
Furthermore, you could then separate the backend into it's own repo and split up nicely the dev effort between both for larger projects.
09/28/2020
01/08/2018
auth
module (a simpler implementation as a result)12/15/2017
10/23/2017
06/10/2017