|
1 | | -# valley-disco |
| 1 | +# Valley Disco CSV Processor |
| 2 | + |
| 3 | +A web application for processing Valley Disco CSV ticket data. This tool allows you to upload CSV files containing disco ticket information, process the data to add ticket counts and expand pupil information, and download the processed results. |
| 4 | + |
| 5 | +## 🌟 Features |
| 6 | + |
| 7 | +- **Drag & Drop Interface**: Simply drag your CSV file onto the upload area |
| 8 | +- **File Selection**: Or click to browse and select your CSV file |
| 9 | +- **Real-time Processing**: All processing happens in your browser - no data leaves your computer |
| 10 | +- **Auto-detection**: Automatically detects year groups from filename or processes all groups |
| 11 | +- **Detailed Logging**: See exactly what the processor is doing with your data |
| 12 | +- **Instant Download**: Get your processed CSV file immediately |
| 13 | + |
| 14 | +## 🚀 Live Demo |
| 15 | + |
| 16 | +Visit the live application: [https://timreddingpbx.github.io/valley-disco](https://timreddingpbx.github.io/valley-disco) |
| 17 | + |
| 18 | +## 📊 How It Works |
| 19 | + |
| 20 | +The application processes your CSV data in several steps: |
| 21 | + |
| 22 | +1. **Data Cleaning**: Removes any "Total" rows that may appear at the end of the CSV file |
| 23 | +2. **Ticket Counting**: Analyzes the "Pupils" column to count how many tickets each pupil group has |
| 24 | +3. **Pupil Expansion**: Extracts individual pupils from grouped entries based on the detected year groups |
| 25 | + |
| 26 | +### Input CSV Format |
| 27 | + |
| 28 | +Your CSV should contain at least these columns: |
| 29 | +- `Guest first name` |
| 30 | +- `Guest last name` |
| 31 | +- `Pupils` (containing pupil information like "Mila - Year 2 (2425)2NM & Roman - Reception (2425)Owls") |
| 32 | +- Other columns are preserved in the output |
| 33 | + |
| 34 | +### Output |
| 35 | + |
| 36 | +The processed CSV includes: |
| 37 | +- All original columns |
| 38 | +- `TicketCount`: Number of tickets for each pupil group |
| 39 | +- `Pupil`: Individual pupil extracted based on year group selection |
| 40 | + |
| 41 | +## 🛠️ Local Development |
| 42 | + |
| 43 | +To run this application locally: |
| 44 | + |
| 45 | +1. Clone the repository: |
| 46 | + ```bash |
| 47 | + git clone https://github.com/TimReddingPBX/valley-disco.git |
| 48 | + cd valley-disco |
| 49 | + ``` |
| 50 | + |
| 51 | +2. Start a local server: |
| 52 | + ```bash |
| 53 | + # Using Python 3 |
| 54 | + python3 -m http.server 8000 |
| 55 | + |
| 56 | + # Or using Node.js |
| 57 | + npx serve . |
| 58 | + |
| 59 | + # Or using PHP |
| 60 | + php -S localhost:8000 |
| 61 | + ``` |
| 62 | + |
| 63 | +3. Open your browser to `http://localhost:8000` |
| 64 | + |
| 65 | +## 📁 Project Structure |
| 66 | + |
| 67 | +``` |
| 68 | +valley-disco/ |
| 69 | +├── index.html # Main HTML page |
| 70 | +├── styles.css # Application styles |
| 71 | +├── app.js # Main application logic |
| 72 | +├── csv-parser.js # CSV parsing utilities |
| 73 | +├── package.json # Project metadata |
| 74 | +├── data/ # Sample CSV files |
| 75 | +├── src/ # Original Node.js scripts |
| 76 | +└── .github/workflows/ # GitHub Pages deployment |
| 77 | +``` |
| 78 | + |
| 79 | +## 🔧 Year Group Detection |
| 80 | + |
| 81 | +The application automatically detects which year groups to process based on the filename: |
| 82 | + |
| 83 | +- **Reception files**: Filenames containing "reception" → processes Reception pupils |
| 84 | +- **Years 1-3 files**: Filenames containing "1" and ("2" or "3") → processes Years 1, 2, and 3 |
| 85 | +- **Years 4-6 files**: Filenames containing "4" and ("5" or "6") → processes Years 4, 5, and 6 |
| 86 | +- **Unknown files**: If detection fails, processes all year groups (Reception through Year 6) |
| 87 | + |
| 88 | +## 📝 Original Node.js Version |
| 89 | + |
| 90 | +The original Node.js processing script is preserved in the `src/` directory. This web version maintains the same processing logic while making it accessible through a browser interface. |
| 91 | + |
| 92 | +## 🚀 Deployment |
| 93 | + |
| 94 | +This application is automatically deployed to GitHub Pages when changes are pushed to the main branch. The deployment is handled by GitHub Actions. |
| 95 | + |
| 96 | +### Setting up GitHub Pages for your fork: |
| 97 | + |
| 98 | +1. Fork this repository |
| 99 | +2. Go to your repository settings |
| 100 | +3. Navigate to "Pages" in the sidebar |
| 101 | +4. Set source to "GitHub Actions" |
| 102 | +5. Your site will be available at `https://yourusername.github.io/valley-disco` |
| 103 | + |
| 104 | +## 🔒 Privacy & Security |
| 105 | + |
| 106 | +- All data processing happens locally in your browser |
| 107 | +- No data is uploaded to any server |
| 108 | +- Your CSV files never leave your computer |
| 109 | +- The application works completely offline after initial load |
| 110 | + |
| 111 | +## 📄 License |
| 112 | + |
| 113 | +This project is licensed under the ISC License. |
| 114 | + |
| 115 | +## 🤝 Contributing |
| 116 | + |
| 117 | +Contributions are welcome! Please feel free to submit a Pull Request. |
| 118 | + |
| 119 | +## 📞 Support |
| 120 | + |
| 121 | +If you encounter any issues or have questions, please open an issue on GitHub. |
0 commit comments