CampusLink
A comprehensive platform connecting brands with college event organizers for sponsorship opportunities
Overview
CampusLink is a sophisticated platform designed to bridge the gap between brands seeking marketing opportunities and college event organizers. The platform enables thousands of users across multiple schools to create, discover, and sponsor events, with secure payment processing, real-time messaging, and digital contract management. It serves as a complete ecosystem for campus event sponsorships, benefiting both brands looking to reach college audiences and student organizations seeking funding.
Key Features
- Brand-to-organizer matching system for event sponsorships
- Secure payment processing through Stripe integration
- Real-time chat with digital contract creation and signing
- Multi-school support with school-specific branding
- Comprehensive user profiles for brands, students, and organizations
- OAuth authentication and JWT-based authorization
- Admin dashboard with detailed analytics and approval workflows
Design & Structure
CampusLink employs a sophisticated architecture with SvelteKit powering the frontend and Cloudflare Workers providing serverless backend capabilities. The platform utilizes JWT-based authentication, role-based access control, and secure WebSocket connections for real-time features. The application leverages Cloudflare D1 (SQLite) for data persistence, with a carefully designed schema that supports complex relationships between users, events, sponsorships, and contracts.
Key Components
- Sponsorship Marketplace: Connects brands with event organizers
- Real-time Chat System: Facilitates negotiations between parties
- Digital Contract System: Enables creation, negotiation, and signing of sponsorship agreements
- Payment Processing: Secure handling of financial transactions via Stripe
- Multi-role User Profiles: Specialized interfaces for brands, students, and campus organizations
- Analytics Dashboard: Comprehensive metrics for both brands and event organizers
- Approval Workflow: Multi-stage process for event and sponsorship management
Project Structure
The application follows a modular architecture with clear separation of concerns. The frontend is organized into feature-based modules with shared components, while the backend implements a service-oriented approach with dedicated handlers for authentication, payments, messaging, and data operations. This structure ensures maintainability, scalability, and security across the platform.
Example Code
// Example SvelteKit route handler for CampusLink
export const load = async ({ locals, params }) => {
const { db } = locals;
const { schoolId } = params;
// Fetch school data
const school = await db.prepare(
'SELECT * FROM schools WHERE id = ?'
).bind(schoolId).first();
// Fetch upcoming events for this school
const events = await db.prepare(
'SELECT * FROM events WHERE school_id = ? AND start_time > ? ORDER BY start_time'
).bind(schoolId, new Date().toISOString()).all();
return {
school,
events: events.results
};
};Database Schema
CampusLink uses Cloudflare D1, which is a serverless SQL database built on SQLite. The database schema includes tables for schools, events, users, and more.
Database Schema
schools
Stores information about educational institutions
Relationships:
- events.school → id
- student_profiles.school → id
- org_profiles.school → id
users
User accounts with role-based permissions
Relationships:
- events.submitted_by_id → id
- brand_profiles.user_id → id
- student_profiles.user_id → id
- org_profiles.user_id → id
- user_contacts.user_id → id
- sponsorship_requests.requester_id → id
- sponsorship_requests.event_host_id → id
- chats.brand_id → id
- chats.host_id → id
- contracts.brand_id → id
- contracts.host_id → id
events
Contains event details with approval workflow
Relationships:
- school → schools.id
- submitted_by_id → users.id
- sponsorship_requests.event_id → id
brand_profiles
Extended profile for brand/company users
Relationships:
- user_id → users.id
student_profiles
Extended profile for student users
Relationships:
- user_id → users.id
- school → schools.id
org_profiles
Extended profile for campus organization users
Relationships:
- user_id → users.id
- school → schools.id
user_contacts
Contact information for users
Relationships:
- user_id → users.id
sponsorship_requests
Tracks sponsorship requests for events
Relationships:
- event_id → events.id
- requester_id → users.id
- event_host_id → users.id
chats
Chat conversations between users
Relationships:
- brand_id → users.id
- host_id → users.id
- contracts.chat_id → id
contracts
Sponsorship contracts between brands and hosts
Relationships:
- chat_id → chats.id
- brand_id → users.id
- host_id → users.id
Technologies
Frontend
- SvelteKit 5 with TypeScript and runes
- TailwindCSS with custom theming for school-specific branding
- Efficient polling instead of Websockets connections for chat functionality to work serverless
- PDF generation for contracts and agreements
Backend
- Cloudflare Workers for serverless functions
- OAuth 2.0 integration with Google for authentication
- JWT-based authorization with role-based access control
- Stripe API integration for payment processing
- WebCrypto API for secure contract signing
Database
- Cloudflare D1 (SQLite) with complex relational schema
- Structured SQL migrations for schema versioning
- Transaction support for data integrity
- JSON storage for flexible document structures
Tools
- Wrangler CLI for Cloudflare development and deployment
- TypeScript with strict type checking
- CI/CD pipeline for automated testing and deployment
- Monitoring and analytics for performance tracking
API Endpoints
Here's a very non-comprehensive list of some of the endpoints from CampusLink:
Authentication
| Method | Endpoint | Description |
|---|---|---|
| POST | /auth | Authenticate user with Google OAuth |
| GET | /dashboard | Get user dashboard data with authentication check |
Events
| Method | Endpoint | Description |
|---|---|---|
| GET | /admin/events | List all events with submitter information (admin only) |
| POST | /admin/events?/updateEvent | Update event details (admin only) |
| POST | /admin/events?/toggleApproval | Toggle event approval status (admin only) |
| GET | /calendar | Get events for calendar view |
| GET | /dashboard/events | Get events for user dashboard |
| POST | /submit | Submit new event |
Chat & Messaging
| Method | Endpoint | Description |
|---|---|---|
| GET | /chat/[roomId] | Get chat room details and messages |
| POST | /chat/[roomId]?/sendMessage | Send message in chat room |
| POST | /chat/api/contracts/generate | Generate contract using AI |
| POST | /chat/api/contracts/analyze | Analyze contract terms using AI |
| POST | /chat/api/contracts/payment | Process contract payment |
Contracts
| Method | Endpoint | Description |
|---|---|---|
| POST | /chat/[roomId]?/createContract | Create new contract in chat room |
| POST | /chat/[roomId]?/updateContract | Update existing contract |
| POST | /chat/[roomId]?/signContract | Sign contract by brand or host |
Profiles
| Method | Endpoint | Description |
|---|---|---|
| GET | /profiles | List all profiles |
| GET | /profiles/[id] | Get specific profile details |
| POST | /dashboard/profile | Update user profile |
Future Directions
Roadmap
- Enhanced analytics dashboard for event organizers
- Integration with social media platforms for event promotion
- Mobile application development
- Advanced search and filtering capabilities
- Event recommendation system based on user preferences
Challenges
- Scaling to support a large number of schools and events
- Ensuring data consistency across distributed systems
- Optimizing performance for real-time updates
- Implementing robust security measures for user data
Opportunities
- Expanding to additional educational institutions
- Developing partnerships with event organizers
- Creating a marketplace for event services
- Integrating with existing school management systems