|
| 1 | +# CodePatchwork GitHub Migration Guide |
| 2 | + |
| 3 | +This document provides instructions for migrating the CodePatchwork project to GitHub. Follow these steps to complete the migration process. |
| 4 | + |
| 5 | +## Prerequisites |
| 6 | + |
| 7 | +Before starting the migration process, ensure you have: |
| 8 | + |
| 9 | +1. A GitHub account |
| 10 | +2. [Git](https://git-scm.com/) installed on your computer |
| 11 | +3. The GitHub repository already created at: https://github.com/hexawolf/CodePatchwork |
| 12 | +4. A local copy of the CodePatchwork project |
| 13 | + |
| 14 | +## Step 1: Prepare Your Environment Variables |
| 15 | + |
| 16 | +Before migrating to GitHub, create a `.env.example` file that shows the required environment variables without actual values. This helps other contributors set up their environment correctly. |
| 17 | + |
| 18 | +``` |
| 19 | +# PostgreSQL Database |
| 20 | +DATABASE_URL=postgres://username:password@localhost:5432/codepatchwork |
| 21 | +
|
| 22 | +# Firebase Configuration |
| 23 | +VITE_FIREBASE_API_KEY=your-api-key |
| 24 | +VITE_FIREBASE_PROJECT_ID=your-project-id |
| 25 | +VITE_FIREBASE_APP_ID=your-app-id |
| 26 | +VITE_FIREBASE_MESSAGING_SENDER_ID=your-messaging-sender-id |
| 27 | +``` |
| 28 | + |
| 29 | +## Step 2: Run the Migration Script |
| 30 | + |
| 31 | +We've provided a migration script to simplify the process. This script will: |
| 32 | + |
| 33 | +- Initialize a Git repository (if one doesn't exist) |
| 34 | +- Add all files to Git |
| 35 | +- Create an initial commit |
| 36 | +- Set up the GitHub remote |
| 37 | + |
| 38 | +Run the script with: |
| 39 | + |
| 40 | +```bash |
| 41 | +./scripts/github-migration.sh |
| 42 | +``` |
| 43 | + |
| 44 | +## Step 3: Push to GitHub |
| 45 | + |
| 46 | +After running the migration script, push the code to GitHub: |
| 47 | + |
| 48 | +```bash |
| 49 | +# Push to the main branch |
| 50 | +git push -u origin main |
| 51 | +``` |
| 52 | + |
| 53 | +## Step 4: Create a Version Tag |
| 54 | + |
| 55 | +To tag this as version 1.0.0: |
| 56 | + |
| 57 | +```bash |
| 58 | +# Create an annotated tag |
| 59 | +git tag -a v1.0.0 -m "First stable release" |
| 60 | + |
| 61 | +# Push the tag to GitHub |
| 62 | +git push origin v1.0.0 |
| 63 | +``` |
| 64 | + |
| 65 | +## Step 5: Configure GitHub Repository Settings |
| 66 | + |
| 67 | +After pushing your code, configure your GitHub repository settings: |
| 68 | + |
| 69 | +1. **Branch Protection:** Go to Settings > Branches and add protection rules for the main branch |
| 70 | +2. **GitHub Pages:** If you want to set up a project website, configure GitHub Pages in Settings > Pages |
| 71 | +3. **GitHub Actions:** Check that the CI workflow is properly set up in the Actions tab |
| 72 | + |
| 73 | +## Step 6: Set Up GitHub Secrets |
| 74 | + |
| 75 | +To enable CI/CD with Firebase, add the following secrets to your GitHub repository: |
| 76 | + |
| 77 | +1. Go to Settings > Secrets and variables > Actions |
| 78 | +2. Add the following repository secrets: |
| 79 | + - `VITE_FIREBASE_API_KEY` |
| 80 | + - `VITE_FIREBASE_PROJECT_ID` |
| 81 | + - `VITE_FIREBASE_APP_ID` |
| 82 | + |
| 83 | +## Database Schema Issues |
| 84 | + |
| 85 | +If you encounter database schema issues when deploying to a new environment, run the database migration script: |
| 86 | + |
| 87 | +```bash |
| 88 | +node scripts/fix-database-schema.js |
| 89 | +``` |
| 90 | + |
| 91 | +## Next Steps |
| 92 | + |
| 93 | +After migration, consider: |
| 94 | + |
| 95 | +- Setting up project boards for task management |
| 96 | +- Creating issue templates |
| 97 | +- Adding more detailed documentation in the Wiki |
| 98 | +- Setting up automated releases |
| 99 | +- Creating a development branch for ongoing work |
| 100 | + |
| 101 | +--- |
| 102 | + |
| 103 | +Congratulations! Your project is now on GitHub and ready for collaboration. |
0 commit comments