A modern web application with Framework7 frontend, Event Organizer Dashboard, and Django REST API backend.
- Python 3.8+
- Node.js 14+
- npm or yarn
- Clone the repository
git clone https://github.com/NathanPerrier/Mon_9am_Team_04
cd Mon_9am_Team_04- Set up environment variables
# Copy the example environment file
cp .env.example .env
# Edit .env with your configuration
# Make sure to change DJANGO_SECRET_KEY in production!# Make the script executable (first time only)
chmod +x start-all.sh
# Run both frontend and backend
./start-all.sh
# Or use Python script (cross-platform)
python3 start-all.py
# Alternative: Run individually
cd code/frontend/campuslink && npm start # CampusLink app (port 3000)
cd code/frontend/event-organiser-dashboard && npm start # Organizer dashboard (port 3001)
cd code/backend && python manage.py runserver # Backend API (port 8000)# Navigate to backend directory
cd code/backend
# Create virtual environment
python3 -m venv venv
# Activate virtual environment
# On macOS/Linux:
source venv/bin/activate
# On Windows:
venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Run migrations
python manage.py makemigrations
python manage.py migrate
# Initialize cache table (required for UQ Maps integration)
python manage.py createcachetable
# Create superuser (optional, for admin access)
python create_superuser.py
# Or manually:
python manage.py createsuperuser
# Start Django server
python manage.py runserverTo populate the database with example data for testing and development, use the provided initial_data.json file located in code/backend/backend/. This file contains sample data for all database tables, including users, events, bookings, comments, and associated images for events.
# Ensure migrations are applied:
cd code/backend
python manage.py makemigrations
python manage.py migrate
# Load the example data
python manage.py loaddata initial_data.json
# Create super user (avoid UNIQUE constraint error)
python manage.py createsuperuserTo verify the data, access the Django Admin panel at http://localhost:8000/admin to confirm that the example data (users, events, bookings, comments, etc.) has been successfully imported. Note: Event images referenced in initial_data.json are included as URLs or base64-encoded data. Ensure any external image URLs are accessible or replace them with local paths if needed.
# Navigate to CampusLink frontend directory
cd code/frontend/campuslink
# Install dependencies
npm install
# Start development server
npm start
# Build for production
npm run build- CampusLink Frontend: http://localhost:3000
- Event Organizer Dashboard: http://localhost:3001
- Backend API: http://localhost:8000/api
- Django Admin: http://localhost:8000/admin
- Default credentials:
admin/admin123(change in production!)
- Default credentials:
Mon_9am_Team_04/
βββ .env # Environment variables (create from .env.example)
βββ .env.example # Example environment configuration
βββ .gitignore # Git ignore rules
βββ CLAUDE.md # Claude Code assistant instructions
βββ README.md # This file
βββ start.sh # Unix/Linux startup script
βββ start.py # Python startup script (cross-platform)
βββ .github/
β βββ workflows/ # GitHub Actions CI/CD
β βββ ISSUE_TEMPLATE/ # Issue templates
β βββ pull_request_template.md
βββ code/
βββ backend/ # Django REST API backend
β βββ manage.py # Django management script
β βββ backend/ # Django project settings
β β βββ settings.py
β β βββ urls.py
β β βββ wsgi.py
β βββ api/ # Main API application
β β βββ models.py # Data models (Event, Booking, UserProfile, etc.)
β β βββ views.py # API views and authentication
β β βββ serializers.py # DRF serializers
β β βββ urls.py # API URL routing
β β βββ admin.py # Django admin configuration
β β βββ uq_maps_service.py # UQ Maps integration service
β β βββ management/ # Custom management commands
β β βββ commands/
β β βββ refresh_uq_maps_cache.py
β βββ db.sqlite3 # SQLite database (development)
β βββ refresh_cache_cron.sh # Cron script for cache refresh
β βββ venv/ # Python virtual environment
βββ frontend/ # Frontend applications
βββ campuslink/ # Framework7 SPA frontend
βββ event-organiser-dashboard/ # Flowbite admin dashboard
βββ package.json # Node.js dependencies
βββ vite.config.js # Vite build configuration
βββ src/
β βββ index.html # Entry HTML
β βββ app.f7 # Main app component
β βββ js/
β β βββ app.js # Framework7 initialization
β β βββ routes.js # Frontend routing
β β βββ store.js # State management
β β βββ services/
β β βββ api.js # Backend API client
β βββ pages/ # Page components (.f7 files)
β β βββ home.f7
β β βββ login.f7
β β βββ register.f7
β β βββ settings.f7
β βββ css/ # Stylesheets
βββ www/ # Production build output
βββ cordova/ # Mobile app builds
The application uses a single .env file in the root directory for both frontend and backend configuration. See .env.example for all available options:
DJANGO_SECRET_KEY: Django secret key (β οΈ change in production!)DJANGO_DEBUG: Set toFalsein productionDJANGO_ALLOWED_HOSTS: Comma-separated list of allowed hostsAPI_BASE_URL: Backend API URL for Django backendVITE_API_BASE_URL: Frontend API URL (must match API_BASE_URL for mobile apps)CORS_ALLOWED_ORIGINS: Allowed CORS origins for web requestsCORS_ALLOW_ALL_ORIGINS_MOBILE: Set toTruefor mobile app developmentJWT_ACCESS_TOKEN_LIFETIME: JWT token lifetime in minutes
For iOS devices and Android emulators, you need to configure the API URLs properly:
-
Find your machine's IP address:
ifconfig | grep "inet " | grep -v 127.0.0.1 # macOS/Linux ipconfig # Windows
-
Update .env file with your IP:
# For iOS devices - replace 192.168.1.100 with your machine's IP API_BASE_URL=http://192.168.1.100:8000/api VITE_API_BASE_URL=http://192.168.1.100:8000/api # For Android emulator (special IP that routes to host) # API_BASE_URL=http://10.0.2.2:8000/api # VITE_API_BASE_URL=http://10.0.2.2:8000/api
-
Update CORS settings for mobile:
CORS_ALLOW_ALL_ORIGINS_MOBILE=True CORS_ALLOWED_ORIGINS=http://localhost:3000,http://127.0.0.1:3000,http://localhost:5174,http://192.168.1.100:5174,file://,capacitor://localhost,ionic://localhost,app://localhost,null
Note: The
VITE_API_BASE_URLis required for the frontend to properly load the API URL from environment variables. BothAPI_BASE_URLandVITE_API_BASE_URLshould have the same value.
- Clone the repository
- Copy
.env.exampleto.envand configure - Run
./start.shorpython3 start.py - Access the application at http://localhost:3000
- Check for new dependencies:
- Backend:
pip install -r requirements.txt(if exists) - Frontend:
cd code/frontend && npm install
- Backend:
- Run migrations:
cd code/backend && python manage.py migrate - Start the application
python manage.py runserver- Start development serverpython manage.py makemigrations- Create migrationspython manage.py migrate- Apply migrationspython manage.py createsuperuser- Create admin userpython manage.py test- Run tests
cd code/frontend/campuslink && npm start- Start CampusLink app (port 3000)
cd code/frontend/event-organiser-dashboard && npm start- Start dashboard (port 3001)npm run build- Build for production (creates optimized bundle)npm run dev- Start development server (alias for npm start)npm test- Run tests (currently not configured)npm run build-cordova- Build for mobile platformsnpm run build-cordova-ios- Build for iOSnpm run build-cordova-android- Build for Android
# Install Node.js 14+ and npm
# Install Cordova globally
npm install -g cordova
# Navigate to CampusLink frontend directory
cd code/frontend/campuslink- Operating System: macOS 10.15 or later
- Xcode: Version 13+ (from App Store)
- Xcode Command Line Tools:
xcode-select --install
- CocoaPods (optional but recommended):
sudo gem install cocoapods
- iOS Simulator or physical iOS device
- Apple Developer Account (free for testing, $99/year for App Store)
- Java JDK: Version 11 or later
# macOS brew install openjdk@11 # Ubuntu/Debian sudo apt-get install openjdk-11-jdk # Windows - download from Oracle or OpenJDK
- Android Studio: Download from developer.android.com
- Android SDK: Install via Android Studio
- Environment Variables (add to ~/.bashrc, ~/.zshrc, or Windows Environment Variables):
export ANDROID_HOME=$HOME/Library/Android/sdk # macOS export ANDROID_HOME=$HOME/Android/Sdk # Linux # Windows: C:\Users\[username]\AppData\Local\Android\Sdk export PATH=$PATH:$ANDROID_HOME/emulator export PATH=$PATH:$ANDROID_HOME/platform-tools export PATH=$PATH:$ANDROID_HOME/cmdline-tools/latest/bin export PATH=$PATH:$ANDROID_HOME/build-tools/[version]
# Navigate to CampusLink frontend directory
cd code/frontend/campuslink
# Install dependencies (first time)
npm install
# Build for iOS (from campuslink directory)
cd code/frontend/campuslink
npm run build-cordova-ios
# Alternative: Step-by-step
cd cordova
npx cordova platform add ios # Only if not already added
npx cordova build ios
# Run on iOS Simulator
npx cordova emulate ios
# Run on specific simulator
npx cordova emulate ios --target="iPhone-14"
# Run on connected iOS device (requires npm install -g ios-deploy)
npx cordova run ios --device
# Open in Xcode for advanced configuration
open platforms/ios/Campuslink.xcworkspaceCreate a .env file in the project root with your Apple Developer credentials:
# iOS Development Configuration
IOS_DEVELOPMENT_TEAM=YOUR_TEAM_ID # Found in Xcode β Settings β Accounts
APP_BUNDLE_ID=com.campuslink.app # Your app's bundle identifier# Using the build script (recommended - uses .env variables)
cd code/frontend/cordova
./build-ios.sh
# Or run directly on device
./run-ios-device.sh- Register your device:
- Connect iPhone via USB
- Open Xcode β Window β Devices and Simulators
- Device will auto-register with your team
- Enable Developer Mode (iOS 16+):
- Settings β Privacy & Security β Developer Mode β ON
- Trust the app (first install):
- Settings β General β VPN & Device Management β Developer App β Trust
The project includes custom Campuslink icons. To update them:
cd code/frontend
# Replace public/icons/campuslink-icon.png with your logo
./create-campuslink-icon.sh # Regenerates all icon sizes- Open Xcode project:
open cordova/platforms/ios/Campuslink.xcworkspace
- Configure signing:
- Team ID is read from
.envfile - Bundle ID: com.campuslink.app (or customize in .env)
- Team ID is read from
- Build for App Store:
- Product β Archive
- Distribute App β App Store Connect
# Navigate to CampusLink frontend directory
cd code/frontend/campuslink
# Install dependencies (first time)
npm install
# Build for Android
npm run build-cordova-android
# Alternative: Step-by-step
cd cordova
npx cordova platform add android # Only if not already added
npx cordova build android
# Run on Android Emulator
npx cordova emulate android
# List available Android Virtual Devices (AVDs)
npx cordova run android --list
# Run on specific emulator
npx cordova emulate android --target="Pixel_4_API_30"
# Run on connected Android device (USB debugging enabled)
npx cordova run android --device
# Build release APK (unsigned)
npx cordova build android --release
# Build release Bundle for Play Store
cd platforms/android
./gradlew bundleRelease- Generate signed APK/AAB:
# Generate keystore (first time only) keytool -genkey -v -keystore campuslink.keystore -alias campuslink -keyalg RSA -keysize 2048 -validity 10000 # Build signed APK npx cordova build android --release -- --keystore=campuslink.keystore --alias=campuslink
- The signed APK will be at:
platforms/android/app/build/outputs/apk/release/ - The AAB bundle will be at:
platforms/android/app/build/outputs/bundle/release/
# Icons are located in:
# iOS: cordova/res/icon/ios/
# Android: cordova/res/icon/android/
# Splash screens are located in:
# iOS: cordova/res/screen/ios/
# Android: cordova/res/screen/android/
# After updating images, rebuild:
npm run build-cordova-ios # or
npm run build-cordova-androidEdit cordova/config.xml:
<widget id="com.yourcompany.campuslink" version="1.0.0">
<name>CampusLink</name>
<description>Your app description</description>
<author email="your@email.com">Your Name</author>
</widget>- "No profiles for 'xxx' were found": Configure signing in Xcode
- "Command failed with exit code 65": Clean build:
cd cordova/platforms/ios && xcodebuild clean - Simulator not starting: Reset simulator: Device β Erase All Content and Settings
- "SDK location not found": Create
local.propertiesincordova/platforms/android/with:sdk.dir=/path/to/Android/Sdk - "Gradle build failed": Clean build:
cd cordova/platforms/android && ./gradlew clean - Device not recognized: Enable USB debugging in Developer Options
- White screen on app launch: Check console for errors using:
- iOS: Safari β Develop β Simulator
- Android: Chrome β chrome://inspect
- CORS errors: Ensure backend allows mobile app origin
- Build errors after update: Remove and re-add platform:
npx cordova platform remove ios/android npx cordova platform add ios/android
POST /api/auth/register/- User registration (with role selection)POST /api/auth/login/- User login (returns JWT tokens)POST /api/auth/logout/- User logoutGET /api/auth/user/- Get current user detailsGET/PUT/PATCH /api/auth/profile/- User profile management
GET /api/events/- List all events (with pagination, search, filters)POST /api/events/- Create new event (organizers only)GET /api/events/{id}/- Get event detailsPUT/PATCH /api/events/{id}/- Update event (organizer only)DELETE /api/events/{id}/- Delete event (organizer only)POST /api/events/{id}/save_event/- Save/bookmark an eventDELETE /api/events/{id}/unsave_event/- Unsave an eventGET /api/events/saved/- Get user's saved eventsGET /api/events/my_events/- Get events created by user
?search=- Search in name, description, location, tags?start_date=YYYY-MM-DD- Events after this date?end_date=YYYY-MM-DD- Events before this date?min_price=0- Minimum ticket price?max_price=100- Maximum ticket price?tags=music,sports- Filter by tags?organizer={user_id}- Filter by organizer
GET /api/bookings/- List user's bookingsPOST /api/bookings/- Create new bookingGET /api/bookings/{id}/- Get booking detailsPOST /api/bookings/{id}/cancel/- Cancel a booking
GET /api/comments/?event={id}- Get event commentsPOST /api/comments/- Post a commentPUT/PATCH /api/comments/{id}/- Edit commentDELETE /api/comments/{id}/- Delete commentPOST /api/comments/{id}/like/- Like a commentDELETE /api/comments/{id}/unlike/- Unlike a comment
GET /api/friends/- List friends/followersPOST /api/friends/- Follow a userDELETE /api/friends/unfollow/- Unfollow a userGET /api/users/search/?q=query- Search users
GET /api/uq-maps/campuses/- List all UQ campusesGET /api/uq-maps/buildings/- Get buildings for default campus (St Lucia)GET /api/uq-maps/buildings/{campus}/- Get buildings for specific campusGET /api/uq-maps/building/{campus}/{building_id}/- Get building detailsGET /api/uq-maps/search/?q={query}&campus={campus}- Search locationsGET /api/uq-maps/parking/or/api/uq-maps/parking/{campus}/- Get parking availabilityGET /api/uq-maps/computers/or/api/uq-maps/computers/{campus}/- Get computer lab availabilityGET /api/uq-maps/library/or/api/uq-maps/library/{campus}/- Get library occupancyGET /api/uq-maps/parse-room/?code={room_code}- Parse UQ room code formatGET /api/uq-maps/build-url/- Build UQ Maps URL with parametersPOST /api/uq-maps/refresh-cache/- Refresh cache (admin only)
For detailed UQ Maps API documentation, see Documents/UQ_MAPS_API_README.md
cd code/backend
python manage.py testFrontend testing is currently not configured. Consider adding Jest or Vitest for unit testing.
-
Environment Variables
- Set
DJANGO_DEBUG=False - Generate new
DJANGO_SECRET_KEY - Update
DJANGO_ALLOWED_HOSTS - Set
NODE_ENV=production
- Set
-
Database
- Configure production database (PostgreSQL recommended)
- Update
DJANGO_DATABASE_URL
-
Static Files
python manage.py collectstatic
-
Security
- Enable HTTPS
- Configure proper CORS origins
- Set secure headers
-
Blank page in frontend
- Check browser console for errors
- Ensure backend is running
- Verify CORS settings
-
API connection errors
- Check if Django server is running on port 8000
- Verify proxy settings in webpack.config.js
- Check CORS_ALLOWED_ORIGINS in .env
-
Authentication issues
- Ensure JWT settings are configured
- Check token expiration times
- Verify API endpoints
- Main branch:
main- Production-ready code - Development branch:
dev- Active development - Feature branches: Create from
devfor new features - Pull requests: Use the template in
.github/pull_request_template.md
This project is part of COMP1100 coursework at the University of Queensland.
- Framework7 for the mobile framework
- Django REST Framework for the API
- All contributors and team members
Nathan Perrier, 49684388, NathanPerrier, s49684388@uq.edu.au
Joshua Borg, 49135684, ijlb, joshua.borg@student.uq.edu.au
Bastien Walter, 48909589, bastienwalter-jpg. s4890958@uq.edu.au
Hunter Siviour, 49216912, HuntSiv6, s4921691@uq.edu.au
Hanseong Kang, 48911078, Hanslmnop, hanseong.kang@student.uq.edu.au