Skip to content
Universal-StandardPublic

About

CAROMAR stand for "Copy A Repository Or Merge All Repositories"

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

CAROMAR

Copy A Repository Or Merge All Repositories

Netlify Status Deploy to Netlify

A powerful web application that allows users to efficiently manage GitHub repositories by either forking individual repositories or merging multiple repositories into a single repository with organized folder structure.

CAROMAR Interface

πŸš€ Quick Deploy

Deploy CAROMAR to Netlify with one click:

Deploy to Netlify

πŸ“– Full Deployment Guide


Features

πŸ” GitHub Authentication

  • Secure GitHub Personal Access Token integration
  • User profile validation and display
  • Token storage for session persistence

πŸ” Repository Discovery

  • Search repositories by GitHub username
  • Support for both personal and other users' repositories
  • Comprehensive repository information display
  • Language detection and visual indicators

πŸ“‹ Repository Selection

  • Interactive repository grid with checkboxes
  • Bulk selection controls (Select All/Deselect All)
  • Real-time selection counter and status updates

πŸš€ Two Operation Modes

1. Fork Individual Repositories

  • Fork each selected repository individually to your GitHub account
  • Preserves original repository structure and history
  • Batch processing with progress tracking
  • Error handling for failed forks

2. Merge into Single Repository

  • Creates a new destination repository and provides validated, credential-free local git commands to add each selected repo as its own folder
  • Each source repository becomes a main folder
  • Maintains separation while creating unified access
  • Custom naming for the merged repository

πŸ“Š Progress Tracking

  • Real-time progress bars during operations
  • Detailed status messages
  • Comprehensive results display with success/error reporting
  • Direct links to newly created repositories

🎨 User Experience

  • Responsive design for desktop and mobile devices
  • Modern, clean interface with GitHub-inspired styling
  • Intuitive workflow with step-by-step guidance
  • Error notifications and success confirmations

πŸ”’ Security

  • Per-token and per-IP rate limiting on every API route
  • Prototype-pollution guard on all request bodies
  • Configurable CORS origin allowlist (ALLOWED_ORIGINS)
  • Content-Type enforcement on state-changing endpoints
  • See SECURITY.md for the full policy

Installation & Setup

Prerequisites

  • Node.js (v18 or higher)
  • npm (v9 or higher)
  • GitHub Personal Access Token

Local Development

  1. Clone the repository:

    git clone https://github.com/Universal-Standard/CAROMAR.git
    cd CAROMAR
  2. Install dependencies:

    npm install
  3. Set up environment variables (optional):

    cp .env.example .env
    # Edit .env with your configuration
  4. Validate deployment configuration:

    npm run validate
  5. Start the application:

    npm start
  6. Open your browser: Navigate to http://localhost:3000

Development Mode

For development with auto-restart on file changes:

npm run dev

Deployment

Deploy to Netlify (Recommended)

Option 1: One-Click Deploy

  1. Click the "Deploy to Netlify" button above
  2. Configure your site name
  3. Deploy!

Option 2: Manual Deploy with CLI

# Install Netlify CLI
npm install -g netlify-cli

# Login to Netlify
netlify login

# Deploy
netlify deploy --prod

Option 3: GitHub Integration

  1. Push to GitHub
  2. Connect repository in Netlify Dashboard
  3. Automatic deployments on every push

πŸ“– See Netlify Deployment Guide for detailed instructions


Usage Guide

Step 1: Authentication

  1. Visit the CAROMAR web application
  2. Click "Create Personal Access Token" to generate a GitHub token
  3. Enter your token and click "Validate Token"
  4. Your GitHub profile will be displayed once validated

Step 2: Find Repositories

  1. Enter a GitHub username (yours or another user's)
  2. Click "Search Repositories" to load their repositories
  3. Browse the repository grid with detailed information

Step 3: Select Operation Mode

Choose between two operation modes:

Fork Individual Repositories:

  • Select repositories you want to fork
  • Each will be forked individually to your account
  • Maintains original repository structure

Merge into Single Repository:

  • Select multiple repositories to combine
  • Enter a name for the merged repository
  • Creates the destination repository and provides local/manual merge steps for adding each selected repo as a folder

Step 4: Execute Action

  1. Select your desired repositories using checkboxes
  2. Use "Select All" or "Deselect All" for bulk operations
  3. Click the "Execute" button to start the process
  4. Monitor progress with real-time status updates

Step 5: Review Results

  • View detailed results of the operation
  • Access direct links to newly created repositories
  • For merge operations, complete the provided local/manual git steps before treating the merge as finished
  • Review any errors or issues encountered

GitHub Token Setup

To use CAROMAR, you need a GitHub Personal Access Token:

  1. Go to GitHub Settings > Developer settings > Personal access tokens
  2. Click "Generate new token (classic)"
  3. Select appropriate scopes:
    • βœ… repo (for repository access)
    • βœ… user (for user information)
  4. Copy the generated token
  5. Enter it in the CAROMAR application

Security Note: Your token is stored locally in your browser and used only for GitHub API calls. It's never sent to external servers.


API Endpoints

The application provides several REST API endpoints:

Authentication & User

  • GET /api/user - Get authenticated user information
  • GET /api/validate-token - Validate GitHub token and permissions

Repository Management

  • GET /api/search-repos - Search repositories for a user
  • POST /api/fork-repo - Fork a specific repository
  • POST /api/create-merged-repo - Create merged repository
  • GET /api/repo-content - Get repository content preview

Analytics & Comparison

  • POST /api/analyze-repos - Analyze repository statistics
  • POST /api/compare-repos - Compare multiple repositories

System

  • GET /api/health - Health check endpoint
  • GET /api/metrics - Performance metrics

πŸ“– See API Documentation for detailed API documentation


Technology Stack

Frontend

  • HTML5, CSS3, Vanilla JavaScript
  • EJS templating engine
  • Responsive design
  • Real-time progress tracking

Backend

  • Node.js (v18+)
  • Express.js
  • Serverless-ready architecture
  • RESTful API design

Infrastructure

  • Netlify Functions (Serverless)
  • Netlify CDN (Static assets)
  • GitHub REST API v3 integration

Development

  • Jest (Testing)
  • ESLint (Linting)
  • Nodemon (Development)

Project Structure

CAROMAR/
β”œβ”€β”€ .github/
β”‚   β”œβ”€β”€ ISSUE_TEMPLATE/       # Bug/feature report templates
β”‚   β”œβ”€β”€ PULL_REQUEST_TEMPLATE.md
β”‚   └── workflows/
β”‚       β”œβ”€β”€ ci.yml            # Lint, test, and deployment validation
β”‚       └── codeql.yml        # Static security analysis
β”œβ”€β”€ docs/                     # Full documentation set
β”‚   β”œβ”€β”€ README.md             # Documentation index
β”‚   β”œβ”€β”€ guides/                # quickstart.md, setup.md, development.md
β”‚   β”œβ”€β”€ deployment/            # netlify.md, environment.md
β”‚   └── api/                   # endpoints.md
β”œβ”€β”€ public/                   # Static assets (served from CDN)
β”‚   β”œβ”€β”€ css/
β”‚   β”‚   β”œβ”€β”€ style.css         # Application styling
β”‚   β”‚   └── icons-fallback.css # Icon fallbacks
β”‚   β”œβ”€β”€ js/
β”‚   β”‚   β”œβ”€β”€ app.js            # Simplified reference frontend
β”‚   β”‚   └── enhanced-app.js   # Full-featured frontend (used in production)
β”‚   β”œβ”€β”€ robots.txt            # SEO crawler rules
β”‚   └── sitemap.xml           # SEO sitemap
β”œβ”€β”€ views/
β”‚   └── index.ejs             # Main HTML template
β”œβ”€β”€ functions/
β”‚   └── server.js             # Netlify serverless wrapper
β”œβ”€β”€ utils/
β”‚   β”œβ”€β”€ analytics.js          # Repository analytics
β”‚   β”œβ”€β”€ comparison.js         # Repository comparison
β”‚   β”œβ”€β”€ logger.js             # Logging utility
β”‚   β”œβ”€β”€ validation.js         # Input validation
β”‚   β”œβ”€β”€ performance.js        # Performance monitoring
β”‚   └── security.js           # Security utilities (rate limiting, sanitization, CORS)
β”œβ”€β”€ scripts/
β”‚   β”œβ”€β”€ validate-deployment.js # Pre-deploy validation
β”‚   └── monitor-deployment.js  # Post-deploy health monitoring
β”œβ”€β”€ tests/
β”‚   β”œβ”€β”€ app.test.js
β”‚   β”œβ”€β”€ merge-contract.test.js
β”‚   β”œβ”€β”€ security.test.js
β”‚   β”œβ”€β”€ server.test.js
β”‚   β”œβ”€β”€ token-security.test.js
β”‚   └── utils.test.js
β”œβ”€β”€ server.js                 # Express application
β”œβ”€β”€ package.json               # Dependencies & scripts
β”œβ”€β”€ package-lock.json
β”œβ”€β”€ netlify.toml               # Netlify configuration
β”œβ”€β”€ .nvmrc                     # Node version
β”œβ”€β”€ jest.config.js
β”œβ”€β”€ eslint.config.js
β”œβ”€β”€ .env.example
β”œβ”€β”€ .gitignore
β”œβ”€β”€ README.md                  # This file
β”œβ”€β”€ CHANGELOG.md
β”œβ”€β”€ CONTRIBUTING.md
β”œβ”€β”€ SECURITY.md
└── LICENSE

Development

Available Scripts

npm start              # Start production server
npm run dev            # Start development server with auto-reload
npm test               # Run tests
npm run test:watch     # Run tests in watch mode
npm run test:coverage  # Generate coverage report
npm run lint           # Check code quality
npm run lint:fix       # Fix linting issues
npm run build          # Build for production
npm run validate       # Validate deployment configuration
npm run monitor        # Health-check a deployed instance
npm run predeploy      # Pre-deployment checks (lint + test)

Running Tests

# Run all tests
npm test

# Run with coverage
npm run test:coverage

# Watch mode for development
npm run test:watch

Contributing

We welcome contributions! Please follow these steps:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

πŸ“– See CONTRIBUTING.md for detailed guidelines


Documentation

Quick Links:

Project Documentation:


License

This project is licensed under the MIT License - see the LICENSE file for details.


Support

Get Help

If you encounter any issues or have questions:

  1. Check Documentation:

  2. Search Issues:

  3. Create New Issue:

    • Report a bug
    • Include error messages and steps to reproduce

Community

  • GitHub Discussions: Ask questions and share ideas
  • Issue Tracker: Report bugs and request features

Acknowledgments

  • GitHub API for repository management capabilities
  • Netlify for serverless hosting platform
  • Font Awesome for icons
  • Express.js for backend framework
  • Modern web standards for responsive design

Status

βœ… Production Ready
βœ… Deployment Tested
βœ… Fully Documented
βœ… Security Hardened (rate limiting, prototype-pollution guard, CORS allowlist, and CSP wired in and exercised by tests β€” see CHANGELOG.md)


Built with ❀️ by Universal-Standard

About

CAROMAR stand for "Copy A Repository Or Merge All Repositories"

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages