This provides instructions for setting up and developing the application.
To add your own package for the client
and server
:
-
Create a new folder with a name in the
packages
directory (e.g.,packages/my-tsconfig
). -
Add your code to that folder (e.g.,
packages/my-tsconfig/tsconfig.base.json
). -
Install the package for your app (e.g.,
client
) using the following command:pnpm -F client add my-tsconfig --workspace
The package will now be available, and you can import it just like any other npm package.
To start a development server for the client:
pnpm dev
To create a production version of your client app:
pnpm build
You can preview the production build using npm run preview
.
Note: For deployment, you may need to install an adapter for your target environment.
To run the PostgreSQL container:
docker compose up -d
The -d
flag runs the container in the background (detached mode).
To connect to the PostgreSQL database inside the Docker container:
docker exec -u postgres -it fc_db psql -d frontend_community
To create a migration template in the server workspace:
NAME=<migration_file_name> pnpm -F server create-migration
The -F
flag filters the workspace by name.
To list all volumes:
docker volume ls
To inspect a specific volume:
docker volume inspect <volume_name>
Last updated: Sep 4, 2023
We didn't set up a CI/CD pipeline yet, so you'll have to manually build the client and server apps.
-
Log in to the server using SSH
-
Run
git pull
to get the latest changes from the repository -
Run
pnpm build
to build the client and server apps -
Run
docker compose up -d
to run the database container if it's not already runningRun this command to see if the database is up and running. If it is you'll get in to the database shell.
docker exec -u postgres -it fc_db psql -d frontend_community
- Run PM2 with the following command. This should take two ports: (8895: client, 3001: server)
pm2 start npm --name fc -- run prod --watch