From 04e0cfdd07df71028d629361bcfd5f1a1ad36716 Mon Sep 17 00:00:00 2001 From: ramnique <30795890+ramnique@users.noreply.github.com> Date: Tue, 14 Jan 2025 15:17:24 +0530 Subject: [PATCH] update readme for local docker setup --- .env.example | 2 +- README.md | 80 +++++++++++++++++++++++++++++++++++++++++++--------- 2 files changed, 67 insertions(+), 15 deletions(-) diff --git a/.env.example b/.env.example index ed9003cf..d920e8c1 100644 --- a/.env.example +++ b/.env.example @@ -1,7 +1,7 @@ OPENAI_API_KEY= MONGODB_CONNECTION_STRING= AUTH0_SECRET= -AUTH0_BASE_URL= +AUTH0_BASE_URL=http://localhost:3000 AUTH0_ISSUER_BASE_URL= AUTH0_CLIENT_ID= AUTH0_CLIENT_SECRET= diff --git a/README.md b/README.md index 662c0f23..5c7c5683 100644 --- a/README.md +++ b/README.md @@ -1,33 +1,85 @@ -# RowBoat monorepo +# RowBoat Monorepo -This is the monorepo for RowBoat. +This guide will help you set up and run the RowBoat applications locally using Docker. -## Setup and Run +## Prerequisites -To set up and run RowBoat, follow these steps: +Before running RowBoat, ensure you have: -1. **Create a `.env` File:** +1. **Docker Desktop** + - [Download Docker Desktop](https://www.docker.com/products/docker-desktop) and ensure Docker Compose is included. - First, create a `.env` file in the root directory of the project. You can use the `.env.example` file as a template. Copy the contents of `.env.example` and replace the placeholder values with your actual configuration values. +2. **OpenAI API Key** + - Obtain from your OpenAI account. +3. **MongoDB** + - **Option 1**: Use an existing MongoDB deployment with your connection string. + - **Option 2**: Install MongoDB locally: + ```bash + brew tap mongodb/brew + brew install mongodb-community@8.0 + brew services start mongodb-community@8.0 + ``` + +4. **Auth0 Account and Application Setup** + - **Create an Auth0 Account**: Sign up at [Auth0](https://auth0.com). + - **Create a New Application**: Choose "Regular Web Applications" and name it "RowBoat". + - **Configure Application**: + - **Allowed Callback URLs**: In the Auth0 Dashboard, go to your "RowBoat" application settings and set `http://localhost:3000/api/auth/callback` as an Allowed Callback URL. + - **Get Credentials**: Note down Domain, Client ID, and Client Secret. + - **Secure Application**: Generate a session encryption secret: + ```bash + openssl rand -hex 32 + ``` + +## Local Development Setup + +1. **Clone the Repository** ```bash - cp .env.example .env + git clone git@github.com:rowboatlabs/rowboat.git + cd rowboat + git checkout dev ``` - Edit the `.env` file to include your specific API keys and secrets. +2. **Environment Configuration** + - Copy the `.env.example` file and rename it to `.env`: + ```bash + cp .env.example .env + ``` + - Update your `.env` file with the following configurations: -2. **Build and Run Service:** + ```ini + # OpenAI Configuration + OPENAI_API_KEY=your-openai-api-key - Use Docker Compose to build and run the RowBoat service: + # Auth0 Configuration + AUTH0_SECRET=your-generated-secret # Generated using openssl command + AUTH0_BASE_URL=http://localhost:3000 # Your application's base URL + AUTH0_ISSUER_BASE_URL=https://example.auth0.com # Your Auth0 domain + AUTH0_CLIENT_ID=your-client-id + AUTH0_CLIENT_SECRET=your-client-secret + # MongoDB Configuration (choose one based on your setup) + # For local MongoDB + MONGODB_CONNECTION_STRING=mongodb://host.docker.internal:27017/rowboat + # or, for remote MongoDB + MONGODB_CONNECTION_STRING=mongodb+srv://:@.mongodb.net/rowboat + ``` + +3. **Start the App** ```bash docker-compose up --build ``` - This command will build the Docker image and start the service. +4. **Access the App** + - Visit [http://localhost:3000](http://localhost:3000). -3. **Access the Application:** +## Troubleshooting - Once the service is running, you can access RowBoat via: +1. **MongoDB Connection Issues** + - Ensure local MongoDB service is running: `brew services list` + - Verify connection string and network connectivity. - - `http://localhost:3000` +2. **Container Start-up Issues** + - Remove all containers: `docker-compose down` + - Rebuild: `docker-compose up --build`