Quickstart

How to get the Conduit (RealWorld) app running locally.

This guide will walk you through setting up the reference implementation of the Bedstack architecture: the Conduit (RealWorld) app.

Prerequisites

Ensure you have the following installed on your machine:

  • Bun (v1.1 or higher)
  • Docker (for running the PostgreSQL database)
  • Git

Clone the Repository

Clone the Bedstack monorepo which contains the conduit application:

git clone https://github.com/yamcodes/bedstack.git
cd bedstack

Install Dependencies

Bedstack uses Bun's built-in package manager. Run the following command in the root directory:

bun install

Environment Variables

The application requires some environment variables to connect to the database and sign JWTs. Bedstack uses ArkEnv to ensure these are valid at startup. Copy the example file:

cp apps/conduit/.env.example apps/conduit/.env

Database Setup

We use Docker Compose to spin up a local PostgreSQL instance.

# Start the database container
bun run --cwd apps/conduit db:start

Once the database is running, apply the schema and seed it with initial data:

# Push the schema to the DB
bun run --cwd apps/conduit db:push

# Seed with initial data
bun run --cwd apps/conduit db:seed

Run the Application

Now you can start the development server:

bun run --cwd apps/conduit dev

The API is now available at http://localhost:3000/api. You can also visit http://localhost:3000/swagger to explore the interactive API documentation.

On this page