A comprehensive, full-stack web application for managing soccer sessions, player registrations, family relationships, and payments. Built with modern technologies and designed for soccer centers to streamline operations and enhance user experience.
SOFIVE Soccer Center Management System is a production-ready application that enables soccer facilities to:
- Manage session templates, schedules, and instances
- Handle player registrations and family management
- Process secure payments via Stripe
- Provide role-based admin dashboards
- Track billing and transaction history
- ποΈ Session Management: Complete session lifecycle with templates, periods, and instances
- π¨βπ©βπ§βπ¦ Family & Player Management: Comprehensive player profiles with family relationships
- π³ Payment Processing: Secure Stripe integration with multiple payment methods
- π Admin Dashboard: Full administrative controls with user, player, and session management
- π Authentication & Authorization: JWT-based auth with role-based access (user, coach, admin)
- π± Responsive Design: Mobile-first approach with Tailwind CSS
- π Real-time Updates: GraphQL subscriptions for live data synchronization
- π Analytics Dashboard: Performance metrics and reporting (coming soon)
- β‘ Performance Optimized: DataLoader for N+1 query prevention, React.memo for optimization
- π‘οΈ Security Hardened: Rate limiting, input sanitization, secure cookie handling
- π― Type Safety: Full TypeScript implementation across frontend and backend
| Technology | Version | Purpose |
|---|---|---|
| React | 18.3.1 | UI Framework |
| TypeScript | 5.8.3 | Type Safety |
| Apollo Client | 3.13.8 | GraphQL Client & State Management |
| Tailwind CSS | 3.4.3 | Styling Framework |
| Vite | 7.0.4 | Build Tool & Dev Server |
| React Router | 7.6.3 | Client-side Routing |
| Stripe Elements | 7.5.0 | Payment UI Components |
| Lucide React | 0.525.0 | Icon Library |
| Technology | Version | Purpose |
|---|---|---|
| Node.js | β₯16.0.0 | Runtime Environment |
| TypeScript | 5.7.2 | Type Safety |
| Apollo Server | 5.0.0 | GraphQL Server |
| Express.js | 4.21.2 | Web Framework |
| MongoDB | 8.8.0 (Mongoose) | Database & ODM |
| Stripe | 18.3.0 | Payment Processing |
| DataLoader | 2.2.3 | Batch Loading & Caching |
| JWT | 9.0.2 | Authentication |
- Helmet - Security headers
- Rate Limiting - API protection
- Bcrypt - Password hashing
- Compression - Response compression
- CORS - Cross-origin resource sharing
- Input Sanitization - XSS protection
Before you begin, ensure you have the following installed:
- Node.js (v16.0.0 or higher) - Download
- npm (v7.0.0 or higher) or yarn (v1.22.0 or higher)
- MongoDB (local installation or MongoDB Atlas)
- Stripe Account - Sign up
- Git - Download
git clone https://github.com/basquith16/xlsoccerapp.git
cd xlsoccerapp# Install backend dependencies
cd API
npm install
# Install frontend dependencies
cd ../client
npm installCreate API/config.env (use API/config.env.example as template):
# Database Configuration
DATABASE=mongodb+srv://<username>:<password>@<cluster>.mongodb.net/<database>?retryWrites=true&w=majority
DATABASE_PASSWORD=your_mongodb_password
# JWT Configuration
JWT_SECRET=your_super_secure_jwt_secret_key_min_32_characters
JWT_EXPIRES_IN=90d
JWT_COOKIE_EXPIRES_IN=90
# Stripe Configuration
STRIPE_SECRET_KEY=sk_test_your_stripe_secret_key
STRIPE_WEBHOOK_SECRET=whsec_your_webhook_secret
# Email Configuration (Mailgun)
MAILGUN_API=your_mailgun_api_key
# Server Configuration
NODE_ENV=development
PORT=4000
# Security
BCRYPT_ROUNDS=12
RATE_LIMIT_MAX=100
RATE_LIMIT_WINDOW=15Create client/.env:
# API Configuration
VITE_API_URL=http://localhost:4000/graphql
# Stripe Configuration
VITE_STRIPE_PUBLISHABLE_KEY=pk_test_your_stripe_publishable_key
# Environment
VITE_NODE_ENV=development# If using local MongoDB, start the service
sudo service mongod start
# Run data migration (optional - for sample data)
cd API
npm run migrate# Terminal 1: Start backend server
cd API
npm run dev
# Terminal 2: Start frontend server
cd client
npm run dev- Frontend: http://localhost:5173
- Backend API: http://localhost:4000/graphql
- GraphQL Playground: http://localhost:4000/graphql (in development)
xlsoccerapp/
βββ API/ # Backend Application
β βββ src/
β β βββ graphql/ # GraphQL Implementation
β β β βββ resolvers/ # GraphQL Resolvers
β β β βββ schemas/ # GraphQL Type Definitions
β β β βββ server.ts # Apollo Server Setup
β β βββ models/ # MongoDB Models
β β β βββ userModel.ts # User Schema
β β β βββ playerModel.ts # Player Schema
β β β βββ sessionModel.ts # Session Schema
β β β βββ bookingModel.ts # Booking Schema
β β βββ services/ # Business Logic Services
β β βββ utils/ # Utilities & Middleware
β β β βββ authMiddleware.ts # Authentication
β β β βββ dataLoaders.ts # DataLoader Setup
β β β βββ errorHandler.ts # Error Handling
β β β βββ logger.ts # Logging System
β β β βββ validation.ts # Input Validation
β β βββ types/ # TypeScript Type Definitions
β β βββ server.ts # Application Entry Point
β βββ dev-data/ # Development Data & Scripts
β βββ config.env.example # Environment Template
β βββ package.json
βββ client/ # Frontend Application
β βββ src/
β β βββ components/ # React Components
β β β βββ admin/ # Admin Dashboard Components
β β β β βββ users/ # User Management
β β β β βββ players/ # Player Management
β β β β βββ sessions/ # Session Management
β β β βββ auth/ # Authentication Components
β β β βββ billing/ # Payment Components
β β β βββ common/ # Reusable Components
β β β βββ layout/ # Layout Components
β β β βββ ui/ # UI Components
β β βββ pages/ # Page Components
β β βββ hooks/ # Custom React Hooks
β β βββ services/ # API Services
β β β βββ graphql/ # GraphQL Queries & Mutations
β β βββ types/ # TypeScript Definitions
β β βββ utils/ # Utility Functions
β β βββ App.tsx # Application Root
β βββ public/ # Static Assets
β βββ package.json
βββ docs/ # Documentation (if applicable)
βββ .gitignore # Git Ignore Rules
βββ LICENSE # License File
βββ README.md # This File
npm run dev # Start development server with hot reload
npm run build # Compile TypeScript to JavaScript
npm run start # Start production server
npm run start:prod # Start production server with NODE_ENV=production
npm run debug # Start server with debugging enabled
npm run migrate # Run database migrations
npm run recover # Recover database from backup
npm run codegen # Generate GraphQL typesnpm run dev # Start Vite development server
npm run build # Build for production
npm run preview # Preview production build locally
npm run lint # Run ESLint code analysisinterface User {
id: string;
name: string;
email: string;
role: 'user' | 'coach' | 'admin';
password: string;
birthday: Date;
active: boolean;
waiverSigned: boolean;
joinedDate: Date;
familyMembers: Player[];
}interface Player {
id: string;
name: string;
birthDate: Date;
sex: 'male' | 'female' | 'other';
isMinor: boolean;
waiverSigned: boolean;
profImg: string;
parent: User;
}interface Session {
id: string;
name: string;
sport: string;
description: string;
rosterLimit: number;
availableSpots: number;
price: number;
startDates: Date[];
endDate: Date;
timeStart: string;
timeEnd: string;
trainers: User[];
isActive: boolean;
slug: string;
}- Registration/Login: JWT tokens issued upon successful authentication
- Token Storage: Secure httpOnly cookies for token storage
- Token Refresh: Automatic token refresh mechanism
- Role-based Access: Different permissions for user, coach, and admin roles
/admin/*- Admin only/profile- Authenticated users only/billing- Authenticated users only
- Public: Session browsing, user registration
- Authenticated: Profile management, bookings, billing
- Admin: User management, session management, analytics
- Secure Payments: PCI DSS compliant payment processing
- Multiple Payment Methods: Credit cards, ACH, Apple Pay, Google Pay
- Subscription Management: Recurring payment handling
- Webhook Integration: Real-time payment status updates
- Payment History: Complete transaction tracking
- User selects session and provides payment method
- Frontend creates payment intent via GraphQL
- Stripe Elements handles secure payment collection
- Webhook confirms payment status
- Booking is created and confirmed
# Run backend tests
cd API
npm test
# Run frontend tests
cd client
npm test
# Run integration tests
npm run test:integration
# Generate test coverage report
npm run test:coverage- Production Database: Set up MongoDB Atlas or production MongoDB instance
- Environment Variables: Configure production environment variables
- SSL Certificates: Ensure HTTPS is enabled
- Domain Configuration: Set up custom domain with DNS
cd API
npm run build
# Deploy using Vercel CLI or GitHub integration# Set environment variables in platform dashboard
git push origin main # Triggers automatic deployment# Build production image
docker build -t soccer-app-api .
docker run -p 4000:4000 --env-file .env soccer-app-apicd client
npm run build
# Deploy dist folder via Vercelcd client
npm run build
# Deploy dist folder via Netlify- Input Validation: All inputs sanitized and validated
- Rate Limiting: API endpoints protected against abuse
- CORS Configuration: Properly configured for production domains
- Helmet Integration: Security headers automatically applied
- JWT Security: Secure token generation and validation
- Password Security: Bcrypt hashing with salt rounds
- Environment Variables: Sensitive data never committed to version control
- SSL/TLS enabled in production
- Environment variables secured
- Database access restricted
- API rate limiting configured
- Input validation implemented
- Authentication tokens secure
- CORS properly configured
- Security headers enabled
- Development: http://localhost:4000/graphql
- Production: https://your-domain.com/graphql
# Get all sessions
query GetSessions($limit: Int, $offset: Int) {
sessions(limit: $limit, offset: $offset) {
nodes {
id
name
sport
price
availableSpots
}
totalCount
hasNextPage
}
}
# Get user profile
query GetProfile {
me {
id
name
email
role
familyMembers {
id
name
birthDate
}
}
}# Create booking
mutation CreateBooking($input: CreateBookingInput!) {
createBooking(input: $input) {
id
session {
name
}
status
}
}
# Update user profile
mutation UpdateProfile($input: UpdateUserInput!) {
updateMe(input: $input) {
id
name
email
}
}# Check MongoDB connection
mongo --eval "db.adminCommand('ismaster')"
# Verify environment variables
echo $DATABASE# Clear node_modules and reinstall
rm -rf node_modules package-lock.json
npm install
# Clear TypeScript cache
rm -rf dist/
npm run build# Verify Stripe keys
stripe listen --forward-to localhost:4000/webhook- Enable gzip compression
- Implement Redis caching for sessions
- Use CDN for static assets
- Optimize database queries with indexes
- Enable MongoDB connection pooling
We welcome contributions! Please follow these steps:
- Fork the repository
- Clone your fork:
git clone https://github.com/yourusername/xlsoccerapp.git - Create a feature branch:
git checkout -b feature/amazing-feature - Install dependencies:
npm install - Make your changes
- Test your changes:
npm test - Commit your changes:
git commit -m 'Add amazing feature' - Push to the branch:
git push origin feature/amazing-feature - Submit a Pull Request
- TypeScript: All new code must be written in TypeScript
- ESLint: Follow the existing ESLint configuration
- Testing: Add tests for new functionality
- Documentation: Update documentation for API changes
- Commit Messages: Use conventional commit format
- Provide clear description of changes
- Include screenshots for UI changes
- Ensure all tests pass
- Update documentation as needed
- Follow existing code patterns
- GitHub Issues: Create an issue
- Documentation: Check the
/docsfolder for detailed guides - Stack Overflow: Tag questions with
xlsoccerapp
- Be respectful and inclusive
- Help others learn and grow
- Share knowledge and best practices
- Report bugs and suggest improvements
- β Complete admin dashboard with user, player, and session management
- β Enhanced GraphQL API with DataLoader optimization
- β Secure authentication with httpOnly cookies
- β Comprehensive player and family management
- β Improved TypeScript coverage and error handling
- β Performance optimizations and security hardening
See CHANGELOG.md for detailed version history.
- Mobile App: React Native companion app
- Advanced Analytics: Detailed reporting and insights
- Multi-location Support: Support for multiple soccer centers
- Calendar Integration: Google Calendar and Outlook sync
- SMS Notifications: Twilio integration for notifications
- Advanced Booking: Recurring bookings and waitlists
- Caching Layer: Redis implementation
- CDN Integration: Static asset optimization
- Database Optimization: Query performance improvements
- Monitoring: Application performance monitoring
This project is licensed under the MIT License - see the LICENSE file for details.
- β Commercial use
- β Modification
- β Distribution
- β Private use
- β Liability
- β Warranty
- React - The foundation of our frontend
- Apollo GraphQL - Powering our API layer
- Stripe - Secure payment processing
- MongoDB - Database and data storage
- Tailwind CSS - Styling and design system
- TypeScript - Type safety and developer experience
- Soccer community for feedback and requirements
- Open source contributors
- Beta testers and early adopters
Built with β€οΈ for the soccer community
π Homepage β’ π Documentation β’ π Report Bug β’ β¨ Request Feature