- Node 18:
brew install node
or other method - Docker:
brew install --cask docker
or other method - Optional
- Rust:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
or other method
- Rust:
::: warning Note
Yarn has a bug that can cause some Nx commands to fail every other run (like yarn nx build backend
). This monorepo has a patched release of Yarn 4.0.0-rc.13.
:::
Clone this repository with degit to scaffold a fresh monorepo without git history, or fork it.
npm install -global degit
degit troncali/nest-vue project-name
cd project-name
yarn install
git clone --depth 1 https://github.com/YOUR-USERNAME/nest-vue project-name
cd project-name
yarn install
You could also configure your new project to pull future updates from this repository, but be careful when merging changes.
Yarn has a guide for working with PnP packages in Visual Studio Code.
TLDR: yarn dlx @yarnpkg/sdks vscode
.
:::tip
Declutter files that are rarely changed by installing the recommended Peek Hidden Files
extension. Open the command palette (⌘⇧P) and select "Toggle Excluded Files" to show/hide the files listed in .vscode/settings.json
:::
Some minimal setup is required to run apps and containers in your local environment.
- Copy
.env-template
to.env
and modify variable values as needed.cp .env-template .env
- Create Docker secret files for
DB_USERNAME
,DB_PASSWORD
,BACKEND_SESSION_KEY_1
, andNGINX_STAGING_AUTH
.
echo "username" > ./apps/docker/secrets/DB_USERNAME
echo "password" > ./apps/docker/secrets/DB_PASSWORD
yarn dlx --quiet @fastify/secure-session > ./apps/docker/secrets/BACKEND_SESSION_KEY_1
htpasswd -c ./apps/docker/secrets/NGINX_STAGING_AUTH username
- Run
yarn docker:dev-certs
for self-signed SSL certificates for local development.- For the domain to be something other than
localhost
, edit./apps/docker/src/nginx/dev-certs/dev-domains.ext
and changeDNS.1
, etc.
- For the domain to be something other than
- Add the certificate
./apps/docker/src/nginx/dev-certs/fullchain.pem
to trusted certificates.- See this article's section on "Trusting Certificates on System" for OS-specific steps
Run yarn build backend
and yarn build frontend
for initial builds.
After project setup, run yarn docker:dev
, yarn start backend
, and yarn start frontend
in separate terminal tabs.
nx
will automatically rebuildbackend
andfrontend
on saved file changes- The backend will be available at
https://localhost:3001/api/
(proxied throughnginx
with changes reflected on refresh) - The frontend will be separately available at
http://localhost:3001/
(live changes on save)
When the local setup is working, set up deployments to a remote host.