An automated booking system for TU Delft X fitness slots with both a web-based React interface and a native Python GUI.
- Two user interface options:
- Modern React web application
- Native Python Tkinter GUI
- Calendar for date selection
- Customizable time slot selection with priority ordering
- Automatic retry mechanism with adjustable interval
- Visual feedback on booking status
- Secure credential management through environment variables
- Python 3.9 or higher
- Chrome browser installed
- TU Delft account credentials
- Node.js and npm (for the React web app)
- Conda (for managing Python dependencies)
Important: Set up the conda environment before proceeding with installation.
# Install Miniconda or Anaconda if you don't have it already
# Verify installation
conda --version
# Create the environment
conda create -n xscript python=3.9
# Activate the environment
conda activate xscriptYou should see (xscript) at the beginning of your command prompt, indicating the environment is active.
With your conda environment activated:
# Clone the repository
git clone https://github.com/omar-elamin/X-Script.git
cd X-Script
# Install Python dependencies
pip install -r requirements.txt
# Install Node.js dependencies
npm install
# Create a .env file with your credentials
# Example:
# TU_USERNAME=your_username
# TU_PASSWORD=your_password# Make sure your conda environment is activated
conda activate xscript
# Run the Python application
python main.py# Make sure your conda environment is activated
conda activate xscript
# Start the application (either method works)
npm start -- -p 8008
# OR
./run.bat # Windows onlyOpen your browser and navigate to http://localhost:8008
The run.bat script automates the process of starting the React web application:
- Checks for Node.js and npm installations
- Installs npm dependencies if needed
- Starts the Next.js application on port 8008
Important: You must manually activate your conda environment first:
conda activate xscript
.\run.bat- Select a date using the calendar
- Check the time slots you want to book
- Arrange the priority order using the ↑↓ arrows
- Set your preferred retry interval (default: 300 seconds)
- Click "Book Selected Slots" to start the booking process
- Use "Stop Retrying" to cancel the automatic retry process
- Select a date using the calendar
- Check the time slots you want to book
- Drag and drop to arrange priority order
- Set your preferred retry interval
- Click "Book Selected Slots" to start the booking process
- Use "Stop Retrying" to cancel the automatic retry process
- The booking system tries slots in the order you prioritized them
- If a slot is unavailable, it automatically tries the next preferred time
- The retry interval can be adjusted through either UI
- The React app communicates with the Python script via API endpoints
- The browser automation runs headless (invisible) to reduce resource usage
If you encounter issues:
- Ensure Chrome browser is installed and up to date
- Verify your internet connection
- Check that your TU Delft credentials are correct in the
.envfile - Make sure all dependencies are properly installed
- Verify your conda environment is activated properly
- Credentials are stored locally in the
.envfile - The
.envfile is excluded from version control - Never share your credentials or the
.envfile
- python-dotenv: Environment variable management
- selenium: Web automation
- webdriver-manager: Chrome driver management
- numpy: Numerical operations
- tkcalendar: Calendar widget for GUI
- Next.js: React framework
- React: UI library
- React Calendar: Date picker component
- React Beautiful DnD: Drag and drop functionality
- Tailwind CSS: Styling