Merge pull request #215 from Chirag-varu/main

Better README and docker-compose port error solved
This commit is contained in:
Maze
2025-07-12 15:22:51 +02:00
committed by GitHub
2 changed files with 71 additions and 46 deletions

115
README.md
View File

@ -45,70 +45,95 @@ Before you begin, ensure you have the following installed on your system:
### Setup ### Setup
1. **Clone the repository** ## Getting Started
```bash 1. Fork the repository
git clone https://github.com/OpenCut-app/OpenCut.git 2. Clone your fork locally
cd OpenCut 3. Navigate to the web app directory: `cd apps/web`
``` 4. Install dependencies: `bun install`
5. Start the development server: `bun run dev`
2. **Start backend services** ## Development Setup
From the project root, start the PostgreSQL and Redis services:
```bash ### Prerequisites
docker-compose up -d
```
3. **Set up environment variables** - Node.js 18+
Navigate into the web app's directory and create a `.env` file from the example: - Bun (latest version)
- Docker (for local database)
```bash ### Local Development
cd apps/web
1. Start the database and Redis services:
# Unix/Linux/Mac ```bash
cp .env.example .env.local # From project root
docker-compose up -d
```
# Windows Command Prompt 2. Navigate to the web app directory:
copy .env.example .env.local
# Windows PowerShell ```bash
Copy-Item .env.example .env.local cd apps/web
``` ```
_The default values in the `.env` file should work for local development._ 3. Copy `.env.example` to `.env.local`:
4. **Install dependencies** ```bash
Install the project dependencies using `bun` (recommended) or `npm`. # Unix/Linux/Mac
cp .env.example .env.local
```bash # Windows Command Prompt
# With bun copy .env.example .env.local
bun install
# Or with npm # Windows PowerShell
npm install Copy-Item .env.example .env.local
``` ```
5. **Run database migrations** 4. Configure required environment variables in `.env.local`:
Apply the database schema to your local database:
```bash **Required Variables:**
# With bun
bun run db:push:local
# Or with npm ```bash
npm run db:push:local # Database (matches docker-compose.yaml)
``` DATABASE_URL="postgresql://opencut:opencutthegoat@localhost:5432/opencut"
6. **Start the development server** # Generate a secure secret for Better Auth
BETTER_AUTH_SECRET="your-generated-secret-here"
BETTER_AUTH_URL="http://localhost:3000"
```bash # Redis (matches docker-compose.yaml)
# With bun UPSTASH_REDIS_REST_URL="http://localhost:8079"
bun run dev UPSTASH_REDIS_REST_TOKEN="example_token"
# Or with npm # Development
npm run dev NODE_ENV="development"
``` ```
**Generate BETTER_AUTH_SECRET:**
```bash
# Unix/Linux/Mac
openssl rand -base64 32
# Windows PowerShell (simple method)
[System.Web.Security.Membership]::GeneratePassword(32, 0)
# Cross-platform (using Node.js)
node -e "console.log(require('crypto').randomBytes(32).toString('base64'))"
# Or use an online generator: https://generate-secret.vercel.app/32
```
**Optional Variables (for Google OAuth):**
```bash
# Only needed if you want to test Google login
GOOGLE_CLIENT_ID="your-google-client-id"
GOOGLE_CLIENT_SECRET="your-google-client-secret"
```
5. Run database migrations: `bun run db:migrate` from (inside apps/web)
6. Start the development server: `bun run dev` from (inside apps/web)
The application will be available at [http://localhost:3000](http://localhost:3000). The application will be available at [http://localhost:3000](http://localhost:3000).

View File

@ -52,7 +52,7 @@ services:
dockerfile: ./apps/web/Dockerfile dockerfile: ./apps/web/Dockerfile
restart: unless-stopped restart: unless-stopped
ports: ports:
- "3000:3000" - "3100:3000" # app is running on 3000 so we run this at 3100
environment: environment:
- NODE_ENV=production - NODE_ENV=production
- DATABASE_URL=postgresql://opencut:opencutthegoat@db:5432/opencut - DATABASE_URL=postgresql://opencut:opencutthegoat@db:5432/opencut