Running the app

Both client and server are implemented in a single monorepo. The full code is available on Github:

Open source code

You can fork or clone the repository to get started:

git clone https://github.com/typeonce-dev/paddle-payments-full-stack-typescript-app.git

The project uses pnpm as package manager. You can install pnpm globally using npm:

npm install -g pnpm

Using pnpm you can install the dependencies by running install inside the root folder:

A single pnpm install command will install all the packages for apps and packages (client and server dependencies).

pnpm install

Environment variables

server, client and docker-compose.yml are configured to use environment variables to store sensitive information like secret keys and tokens.

Each folder contains a .env.example file with a list of the environment variables required to run the app. You need to create a .env file inside each folder and add the values for each variable.

Local postgres database with docker

To run the app locally, you need a postgres database connection. You can use docker to run local containers with postgres and pgadmin.

The docker-compose.yml file inside the root folder is configured to run a postgres database using an official postgres image (16-alpine). All you need to do is run compose up inside the root folder:

docker compose up

Make sure Docker is installed and running on your machine. You can also install and open Docker Desktop if you prefer.

This will start the postgres database and expose it on port 5432. You can also access the database using pgadmin by opening http://localhost:5050/ in your browser.

Docker Desktop showing the two containers running: postgres database and pgadmin.
Docker Desktop showing the two containers running: postgres database and pgadmin.

Running the app

Once you have the postgres database running, you can run the app using the dev script:

pnpm run dev

This command will start both server and client apps at the same time:

  • Client app: http://localhost:5173/
  • Server app: http://localhost:3000/