- User Authentication: Secure authentication with Better Auth
- Team Management: Create, join, and manage teams
- Admin Panel: Administrative controls for user and team management
- Leaderboard: Competitive ranking system for verified teams
- Real-time Updates: Modern React Query integration
- Frontend: Next.js 16, React 19, TypeScript
- Styling: Tailwind CSS, Radix UI components
- Backend: Next.js API routes
- Database: MongoDB with Mongoose
- Authentication: Better Auth
- State Management: React Query (TanStack Query)
- Email: Nodemailer
- Node.js 18+
- MongoDB
- npm or yarn
- Clone the repository:
git clone <repository-url>
cd club-management-system- Install dependencies:
npm install- Set up environment variables:
cp .env.example .envConfigure the following variables in .env:
# Database
MONGODB_URI=mongodb://localhost:27017/club-management
# Better Auth
BETTER_AUTH_SECRET=your-secret-key
BETTER_AUTH_URL=http://localhost:3000
# Email (optional)
SMTP_HOST=smtp.gmail.com
SMTP_PORT=587
SMTP_USER=your-email@gmail.com
SMTP_PASS=your-app-password- Run the development server:
npm run dev- Open http://localhost:3000 in your browser.
src/
├── app/ # Next.js app directory
│ ├── (admin)/ # Admin routes
│ ├── (auth)/ # Authentication routes
│ ├── (private)/ # Protected user routes
│ ├── (public)/ # Public routes
│ └── api/ # API routes
├── components/ # Reusable components
│ ├── ui/ # UI components (shadcn/ui)
│ ├── admin/ # Admin-specific components
│ └── team/ # Team-related components
├── lib/ # Utility libraries
├── models/ # Database models
├── services/ # API service functions
└── types/ # TypeScript type definitions
Comprehensive API documentation is available in API_DOCUMENTATION.md.
- Teams:
/api/teams/*- Team creation, joining, leaving - Admin:
/api/admin/*- Administrative functions - Leaderboard:
/api/leaderboard- Team rankings - Auth:
/api/auth/*- Authentication (Better Auth)
# Development
npm run dev # Start development server
npm run build # Build for production
npm run start # Start production server
# Code Quality
npm run lint # Run ESLintSee .env.example for all required environment variables.
MONGODB_URI: MongoDB connection stringBETTER_AUTH_SECRET: Secret key for Better AuthBETTER_AUTH_URL: Base URL for the applicationGOOGLE_CLIENT_ID:GOOGLE_CLIENT_SECRET:
SMTP_*: Email configuration for notifications
{
_id: ObjectId,
name: String,
email: String,
image: String,
emailVerified: Boolean,
banned: Boolean,
banReason: String,
banExpires: Date,
teamId: ObjectId, // Reference to team
createdAt: Date
}{
_id: ObjectId,
name: String,
joinCode: String,
members: [ObjectId], // User references
teamleadId: ObjectId, // User reference
pointsEarned: Number,
currentPoints: Number,
isVerified: Boolean,
createdAt: Date
}- Fork the repository
- Create a feature branch
- Make your changes
- Run tests and linting
- Submit a pull request
This project is licensed under the MIT License.
For questions or support, please contact the development team.
Built with ❤️ using Next.js and TypeScript