A modern web application that converts JSON files to CSV format with a beautiful and intuitive user interface.
- 🚀 Modern UI: Clean, responsive design with Tailwind CSS
- 📁 Multiple File Support: Upload and convert multiple JSON files at once
- 🖱️ Drag & Drop: Easy file upload through drag and drop
- 📊 File Preview: Preview selected files before conversion
- ⚡ Real-time Validation: Instant validation of JSON files
- 📥 Download Options: Download individual or all converted files
- 🛡️ Security: Secure file handling and validation
- 📱 Responsive: Works on all devices and screen sizes
- 🎨 Visual Feedback: Clear status indicators and error messages
- ❓ Help System: Built-in help guide for users
- 🔄 Safe Testing: Test files are preserved during testing
- PHP 8.4.6 or higher
- Web server (Apache/Nginx)
- Modern web browser
- Clone the repository:
git clone https://github.com/Ag-Tawfik/Json-to-csv.git
cd json-to-csv-converter- Ensure the
Excelsdirectory is writable:
chmod 755 Excels- Configure your web server to point to the project directory
- Open
index.phpin your web browser - Upload JSON files by:
- Dragging and dropping files into the upload zone
- Clicking "Browse Files" to select files
- Review the selected files
- Click "Convert Files" to start the conversion
- Download the converted CSV files
- Files must be valid JSON
- Maximum file size: 5MB per file
- Supported JSON structures:
- Simple key-value pairs
The project includes a comprehensive test suite to verify functionality:
- Run the test script:
php test.php-
Test files included:
test_files/en-simple.json: English language test filetest_files/tr-simple.json: Turkish language test file
-
Test Features:
- Safe file handling (original test files are preserved)
- Temporary file management
- Directory creation verification
- Filename sanitization
- JSON validation
- File processing and conversion
- Output verification
-
Test Results:
- Detailed test summary
- Pass/fail status for each test
- Error messages for failed tests
- Exit code indicates overall test status
json-to-csv-converter/
├── index.php # Main interface
├── script.php # Backend processing
├── test.php # Test suite
├── test_files/ # Test JSON files
│ ├── en-simple.json # English test file
│ └── tr-simple.json # Turkish test file
└── Excels/ # Output directory for CSV files
- File type validation
- File size limits
- Secure file handling
- Input sanitization
- Error handling
- Directory traversal prevention
- Safe temporary file management
- Original file preservation
The application provides clear error messages for:
- Invalid file types
- File size exceeded
- Invalid JSON format
- Upload errors
- Processing errors
- Test failures
- Directory permission issues
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
For support, please open an issue in the GitHub repository or contact the maintainers.
- Tailwind CSS for the UI framework
- Font Awesome for icons
- PHP 8.4.6 for modern features
- 1.0.0
- Initial release
- Basic JSON to CSV conversion
- Modern UI with Tailwind CSS
- Multiple file support
- Drag and drop functionality
- Safe test file handling
- Add support for more file formats
- Implement batch processing
- Add file compression
- Add progress tracking
- Implement user authentication
- Add file history
- Add more test cases