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

View File

@ -45,27 +45,40 @@ Before you begin, ensure you have the following installed on your system:
### Setup
1. **Clone the repository**
```bash
git clone https://github.com/OpenCut-app/OpenCut.git
cd OpenCut
```
2. **Start backend services**
From the project root, start the PostgreSQL and Redis services:
## Getting Started
1. Fork the repository
2. Clone your fork locally
3. Navigate to the web app directory: `cd apps/web`
4. Install dependencies: `bun install`
5. Start the development server: `bun run dev`
## Development Setup
### Prerequisites
- Node.js 18+
- Bun (latest version)
- Docker (for local database)
### Local Development
1. Start the database and Redis services:
```bash
# From project root
docker-compose up -d
```
3. **Set up environment variables**
Navigate into the web app's directory and create a `.env` file from the example:
2. Navigate to the web app directory:
```bash
cd apps/web
```
3. Copy `.env.example` to `.env.local`:
```bash
# Unix/Linux/Mac
cp .env.example .env.local
@ -76,40 +89,52 @@ Before you begin, ensure you have the following installed on your system:
Copy-Item .env.example .env.local
```
_The default values in the `.env` file should work for local development._
4. Configure required environment variables in `.env.local`:
4. **Install dependencies**
Install the project dependencies using `bun` (recommended) or `npm`.
**Required Variables:**
```bash
# With bun
bun install
# Database (matches docker-compose.yaml)
DATABASE_URL="postgresql://opencut:opencutthegoat@localhost:5432/opencut"
# Or with npm
npm install
# Generate a secure secret for Better Auth
BETTER_AUTH_SECRET="your-generated-secret-here"
BETTER_AUTH_URL="http://localhost:3000"
# Redis (matches docker-compose.yaml)
UPSTASH_REDIS_REST_URL="http://localhost:8079"
UPSTASH_REDIS_REST_TOKEN="example_token"
# Development
NODE_ENV="development"
```
5. **Run database migrations**
Apply the database schema to your local database:
**Generate BETTER_AUTH_SECRET:**
```bash
# With bun
bun run db:push:local
# Unix/Linux/Mac
openssl rand -base64 32
# Or with npm
npm run db:push:local
# 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
```
6. **Start the development server**
**Optional Variables (for Google OAuth):**
```bash
# With bun
bun run dev
# Or with npm
npm run dev
# 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).
## Contributing

View File

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