Skip to content

Conversation

@Hell1213
Copy link
Contributor

@Hell1213 Hell1213 commented Nov 7, 2025

Description

This PR adds an automated development setup script that simplifies local development by running all three services (backend, frontend, and sync server) in a single tmux session.

Key Features:

  • Automated setup with comprehensive prerequisite validation
  • Single command to start all services: ./development/setup.sh
  • Graceful shutdown script: ./development/stop.sh
  • Auto-installs missing dependencies (Go modules, npm packages)
  • Validates environment files before starting
  • Detailed documentation with troubleshooting guide

This significantly reduces setup friction for new contributors and makes local development faster and more convenient.

Checklist

  • Ran npx prettier --write . (for formatting)
  • Ran gofmt -w . (for Go backend)
  • Ran npm test (for JS/TS testing)
  • Added unit tests, if applicable
  • Verified all tests pass
  • Updated documentation, if needed

Additional Notes

What's included:

  1. development/setup.sh - Main setup script with:

    • Prerequisite checks (Go, Node.js, npm, Docker, tmux)
    • Environment file validation
    • Automatic dependency installation
    • Tmux session management with 3-pane layout
  2. development/stop.sh - Clean shutdown script that:

    • Kills the tmux session
    • Stops Docker containers
  3. development/README.md - Comprehensive guide with:

    • Prerequisites and installation links
    • Step-by-step OAuth setup instructions
    • Environment variable configuration
    • Troubleshooting section
    • Tmux command reference
  4. Updated main README.md - Added Development Setup section linking to the new scripts

Improvements over existing approach:

  • More robust error handling with actionable error messages
  • Automatic dependency management
  • Better user experience with progress feedback
  • Includes both start and stop scripts
  • More comprehensive documentation
  • Handles edge cases (session already exists, missing dependencies, etc.)

Testing:
Tested on Linux with all prerequisites installed. Script successfully:

  • Validates all prerequisites
  • Checks environment files
  • Installs dependencies
  • Starts all three services in separate tmux panes
  • Handles existing sessions gracefully

- Add setup.sh script to start all services in tmux session
- Add stop.sh script for graceful shutdown
- Add comprehensive development/README.md with setup instructions
- Include prerequisite checks for Go, Node.js, npm, Docker, and tmux
- Validate environment files before starting services
- Auto-install dependencies if missing
- Update main README.md with development setup section

Fixes CCExtractor#155
@Hell1213
Copy link
Contributor Author

Hell1213 commented Nov 7, 2025

hey @its-me-abhishek ,this is my first contribution to CCExtractor/ccsync. the workflows are currently waiting for approval could you please approve it ?

@ShivaGupta-14
Copy link
Contributor

@Hell1213 Great solution! This is much more robust than the script I was working on for #155. The auto-install and stop.sh script are excellent additions.

@Hell1213
Copy link
Contributor Author

Hell1213 commented Nov 7, 2025

@Hell1213 Great solution! This is much more robust than the script I was working on for #155. The auto-install and stop.sh script are excellent additions.

thanks @ShivaGupta-14 ,I'm just waiting for a review !!

Copy link
Collaborator

@its-me-abhishek its-me-abhishek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix these, will merge later


- **Backend**: See [backend/README.md](backend/README.md)
- **Frontend**: See [frontend/README.md](frontend/README.md)
- **Full Stack**: Use `docker-compose up`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should have been Syncserver instead, docker-compose up syncserver


### Backend Environment (`backend/.env`)

Create a file at `backend/.env` with the following content:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be ./backend/.env. it is easy to get confused and may end up creating a backend directory here itself

@@ -0,0 +1,200 @@
# CCSync Development Setup

This directory contains scripts to automate local development setup for CCSync.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also maybe Add a note that the backend shall be run in a separate user only (preferably root user)

if [ ! -f "$ROOT_DIR/backend/.env" ]; then
echo "Error: backend/.env file not found."
echo "Please create it with required environment variables."
echo "See development/README.md for details."
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please also add a reference to the website

- Change backend/.env to ./backend/.env to avoid confusion
- Add note about running backend in separate user environment
- Clarify sync server startup command in service URLs
- Add CCSync documentation website references in setup.sh error messages
- Add documentation link for OAuth credential setup
@Hell1213
Copy link
Contributor Author

Hell1213 commented Nov 7, 2025

hey @its-me-abhishek
All requested changes have been addressed:
=> Clarified sync server startup command
=> Changed to ./backend/.env for clarity
=> Added note about running backend in separate user environment
=> Added documentation website references

Ready for review. Thank you!

@its-me-abhishek its-me-abhishek merged commit 443c445 into CCExtractor:main Nov 7, 2025
4 checks passed
@its-me-abhishek
Copy link
Collaborator

Tested this and works great! Thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Setup Script (Frontend, Backend, Syncserver via Tmux)

3 participants