This monorepo uses npm workspaces and turborepo
Prod: console.pagoda.co
Dev: core.dev.console.pagoda.co
Copy the following files as starting points, and complete them by obtaining secrets from fellow developers.
frontend/.env.local.example
→ frontend/.env.local
backend/.env.nest.local.example
→ backend/.env.nest.local
The recommend way to run this project is with VS Code and Dev Containers.
The Visual Studio Code Remote - Containers extension lets you use a Docker container as a full-featured development environment. It allows you to open any folder inside (or mounted into) a container and take advantage of Visual Studio Code's full feature set.
This will create a set of Docker containers with all required dependencies preconfigured by the Console team.
Otherwise, open the VS Code command palette and run Remote-Containers: Reopen in Container
.
Terminal > New Terminal
from the Menu Barnpm install
to install dependenciesnpm -w database run migrate:reset
to initialize the databaseRun > Start Debugging
or hit F5 to run both the frontend and backend live-reload modelocalhost:3000
and the backend is available at localhost:3001
. VS Code will automatically expose the port from the Dev Container to the rest of your machineIf you're running in to performance issues running/building the app inside the Dev Container, another option is run the app locally via nvm and Postgres directly through Docker
For now, you will need to make a change to your /etc/hosts
file to properly resolve connections to the database container.
See the following comment: https://github.com/near/pagoda-console/pull/18#issuecomment-1258366725
You can run a Postgres container with the appropriate default environment variables via either docker compose
or docker run
cd .devcontainer
docker compose up db
docker run -d --name console-db -p 5432:5432 -e POSTGRES_USER=pguser -e POSTGRES_PASSWORD=pgpass -e POSTGRES_DB=devconsole postgres:13-alpine
nvm
.nvm use
. This will install and activate the correct version of npm
and node
within your terminal session.npm install
to install dependecies.npm run dev
to start both the frontend and backend in live-reload modelocalhost:3000
and the backend is available at localhost:3001
.The default resource allocations for Docker are relatively low. If you plan to continue using VS Code Dev Containers, it is recommended to raise them significantly in Docker Desktop's preferences so that your development environment can benefit from the full power of your machine.
The node_modules
dir is mounted to a volume instead of the host for increased performance. Running rm -rf node_modules
may interrupt the mount, so opt for the following to wipe dependencies (context)
rm -rf node_modules/* node_modules/.*
Run npm install
from the root to install depenedencies for all packages
Note: for debugging the frontend, add the following line
breakpoint;
These breakpoints will take effect if browser devtools are open.
A debugging configuration is included at .vscode/launch.json
. Choose Run > Start Debugging (F5) to run both the frontend and backend, with breakpoint gutter support for the backend.
To run both the frontend and backend:
npm run dev
To compile and run the project:
npm start