Skip to content

Commit

Permalink
Merge pull request #216 from hussaino03/dev
Browse files Browse the repository at this point in the history
setup docs
  • Loading branch information
hussaino03 authored Jan 1, 2025
2 parents 7a34a07 + 24f614e commit 14d15a1
Show file tree
Hide file tree
Showing 5 changed files with 94 additions and 56 deletions.
39 changes: 24 additions & 15 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,46 @@

Thank you for your interest in contributing to QuestLog! Here's how you can help:

## How to Contribute

1. Fork the repository
2. Create a new branch (`git checkout -b feature/your-feature`)
3. Make your changes
4. Run tests if applicable
5. Commit your changes (`git commit -am 'Add new feature'`)
6. Push to the branch (`git push origin feature/your-feature`)
7. Create a Pull Request

## Development Setup

1. Clone your fork:
```bash
git clone https://github.com/yourusername/QuestLog.git
cd QuestLog
```
2. Copy and configure environment variables:

2. Set up environment:
```bash
cp example.env .env
# Update .env with your values
# Copy the example environment file
cp example.env .env.test

# Required: Update only these values in .env.test
GOOGLE_CLIENT_ID=your_client_id_from_google_cloud_console
GOOGLE_CLIENT_SECRET=your_client_secret_from_google_cloud_console
REACT_APP_GOOGLE_CLIENT_ID=same_as_GOOGLE_CLIENT_ID
```
3. Build and start with Docker:

3. Start the application:
```bash
docker-compose up --build
docker-compose --env-file .env.test up --build
```

The application will be available at:
- Frontend: http://localhost:3000
- Backend API: http://localhost:3001

All other configuration values in example.env are pre-configured for development.

## How to Contribute

1. Fork the repository
2. Create a new branch (`git checkout -b feature/your-feature`)
3. Make your changes
4. Run tests if applicable
5. Commit your changes (`git commit -am 'Add new feature'`)
6. Push to the branch (`git push origin feature/your-feature`)
7. Create a Pull Request

## Pull Request Guidelines

- Keep your changes focused and atomic
Expand Down
38 changes: 14 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,8 @@ classDef database fill:#4479a1,stroke:#333,stroke-width:2px
## 🚀 Quick Start
### Prerequisites
- Node.js (v14.0.0 or later)
- npm (v6.0.0 or later)
- MongoDB account and database
- Google Cloud Platform account for OAuth
- Docker and Docker Compose
- Google OAuth credentials from Google Cloud Console

### Installation

Expand All @@ -153,36 +152,27 @@ classDef database fill:#4479a1,stroke:#333,stroke-width:2px
cd QuestLog
```

2. Set up environment variables:
2. Set up environment:
```bash
# Copy the example environment file
cp example.env .env

# Open .env and update all the required variables with your values
# Make sure to set:
# - MONGODB_URI for your database
# - Google OAuth credentials
# - Integration API keys
# - Other required variables
cp example.env .env.test

# Only required changes:
# - GOOGLE_CLIENT_ID=your_client_id_from_google_cloud_console
# - GOOGLE_CLIENT_SECRET=your_client_secret_from_google_cloud_console
# - REACT_APP_GOOGLE_CLIENT_ID=same_as_GOOGLE_CLIENT_ID
```

3. Build and start with Docker:
3. Start with Docker:
```bash
# Build and start all services
docker-compose up --build

# Or run in detached mode
docker-compose up -d
docker-compose --env-file .env.test up --build
```

4. Access the application:
- Frontend: `http://localhost:3000`
- Backend API: `http://localhost:3001`
- Frontend: http://localhost:3000
- Backend: http://localhost:3001

5. To stop the application:
```bash
docker-compose down
```
The example.env includes working test values for all other configurations. You only need to provide Google OAuth credentials to get started.

## 🔧 API Endpoints
- `POST /api/users`: Create or retrieve a user
Expand Down
18 changes: 16 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
version: '3.8'

services:
mongodb:
image: mongo:latest
ports:
- "27017:27017"
volumes:
- mongodb_data:/data/db
- ./mongo-init:/docker-entrypoint-initdb.d
environment:
- MONGO_INITDB_DATABASE=questlog_test

client:
build:
context: ./client
Expand All @@ -20,7 +30,7 @@ services:
ports:
- "3001:3001"
environment:
- MONGODB_URI=${MONGODB_URI}
- MONGODB_URI=${MONGODB_URI}
- CLIENT=${CLIENT}
- EMAIL_USER=${EMAIL_USER}
- EMAIL_APP_PASSWORD=${EMAIL_APP_PASSWORD}
Expand All @@ -34,4 +44,8 @@ services:
- TICKTICK_CLIENT_SECRET=${TICKTICK_CLIENT_SECRET}
- TICKTICK_REDIRECT_URL=${TICKTICK_REDIRECT_URL}
- GEMINI_API_KEY=$(GEMINI_API_KEY)

depends_on:
- mongodb

volumes:
mongodb_data:
43 changes: 28 additions & 15 deletions example.env
Original file line number Diff line number Diff line change
@@ -1,21 +1,34 @@
# Client environment variables
REACT_APP_GOOGLE_CLIENT_ID=<your google client id>
REACT_APP_PROD=http://localhost:3001/api
# Required Configuration
# ---------------------
# MongoDB Configuration
MONGO_INITDB_DATABASE=questlog_test
MONGODB_URI=mongodb://mongodb:27017/questlog_test

# Server environment variables
# Essential Client Variables
REACT_APP_GOOGLE_CLIENT_ID=test_google_client_id_for_development.apps.googleusercontent.com
REACT_APP_PROD=http://localhost:3001/api

# Essential Server Variables
CLIENT=http://localhost:3000
MONGODB_URI=<mongodb uri string>
EMAIL_USER=[email protected] for feedback form
EMAIL_APP_PASSWORD=your_app_specific_password
SESSION_SECRET=your session secret
GOOGLE_CLIENT_ID=your client id from google cloud console
GOOGLE_CLIENT_SECRET=your oauth password
SESSION_SECRET=development_session_secret_123
GOOGLE_CLIENT_ID=test_google_client_id_for_development.apps.googleusercontent.com
GOOGLE_CLIENT_SECRET=test_google_secret_for_development

# Optional Configuration
# ---------------------
# Email Integration
EMAIL_USER=[email protected]
EMAIL_APP_PASSWORD=test_password_123

TODOIST_CLIENT_ID=your client id
TODOIST_CLIENT_SECRET=your client secret
# Todoist Integration
TODOIST_CLIENT_ID=test_todoist_id_123
TODOIST_CLIENT_SECRET=test_todoist_secret_123
TODOIST_REDIRECT_URL=http://localhost:3001/api/auth/todoist/callback
TICKTICK_CLIENT_ID=your client id
TICKTICK_CLIENT_SECRET=your client secret

# TickTick Integration
TICKTICK_CLIENT_ID=test_ticktick_id_123
TICKTICK_CLIENT_SECRET=test_ticktick_secret_123
TICKTICK_REDIRECT_URL=http://localhost:3001/api/auth/ticktick/callback

GEMINI_API_KEY=your model key
# AI Integration
GEMINI_API_KEY=test_gemini_key_123
12 changes: 12 additions & 0 deletions mongo-init/init.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
db = db.getSiblingDB('questlog_test');

// Minimal test user for development
db.users.insertMany([
{
googleId: 'test_123',
email: '[email protected]',
name: 'Test User',
picture: 'https://via.placeholder.com/150',
createdAt: new Date()
}
]);

0 comments on commit 14d15a1

Please sign in to comment.