Getting Started

Using the Template

You've got a few options

npx degit barelyhuman/thestack <your-project-name>

Note: Replace <your-project-name> with the folder/project-name you'd like to setup

$ cp .env.example .env

Package Management

You are free to use any package manager but the template comes with pnpm as the preferred package manager. If you do not wish to continue with that then you can switch to a different one using the following steps.

  1. Delete the pnpm-lock.yaml file
  2. Delete "packageManager": "pnpm@8.3.1" from package.json.
  3. Run the install command of your preferred package manager
  4. Make sure you add the lock file generated by your selected package manager.
npm install
# or
yarn install
# or whatever else exists at this point

Starting the Server

Prerequisites

If you decided to keep the redis and rate limiter implementation and want to use a local redis instance then run the following before running the Dev or Prod modes

$ docker compose up # run in foreground
$ docker compose up -d # run the service in the background

The scripts to start the server in both dev and prod mode are already in place.

Dev Mode (Will watch for changes and restart)

npm run dev
# or
yarn dev
# or
pnpm run dev

Run/Prod Mode

npm run start
# or
yarn start
# or
pnpm run start