A modern Next.js application built with TypeScript, Supabase authentication, and Tailwind CSS for the Builders League UPro Soccer platform.
- Node.js 18.0 or later
- npm, yarn, or pnpm package manager
- A Supabase account
-
Fork the Repository
Fork this repository from the original source at
Builder-s-League/builders-web-uproto your own GitHub account. -
Clone Your Fork
git clone https://github.com/YOUR_USERNAME/builders-web-upro.git cd builders-web-upro -
Install Dependencies
npm install
-
shadcn/ui Setup
The project uses shadcn/ui for UI components with the "new-york" style variant. The components are already configured via
components.jsonand available in thesrc/components/ui/directory. If you need to add new components:npx shadcn@latest add [component-name]
-
Create a Supabase Account
Visit supabase.com and create a free account.
-
Create a New Project
- Click "New Project"
- Choose your organization
- Enter a project name
- Create a secure database password
- Select a region close to your users
-
Get Your Environment Variables
Navigate to your project settings:
- Go to Settings > API
- Copy your Project URL
- Copy your anon/public key
-
Setup schema
In your supabase project:
- On the left side bar open
SQL Editor - Click new SQL Snippet
- Paste the contents of the schema
- Click run at the bottom right
- On the left side bar open
-
Setup database sample data
In your supabase project:
- On the left side bar open
SQL Editor - Click new SQL Snippet (or click the new tab button near the
Tab Title) - Paste the contents of the seed file
- Click run at the bottom right
- On the left side bar open
-
Create Environment File
Copy the example environment file:
cp .env.example .env.local
-
Configure Environment Variables
Edit
.env.localwith your Supabase credentials:NEXT_PUBLIC_SUPABASE_URL=your_supabase_project_url NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key
-
Development Mode
npm run dev
Open http://localhost:3000 in your browser.
-
Production Build
npm run build npm run start
src/
├── app/ # Next.js App Router pages
│ ├── (protected)/ # Protected routes requiring authentication
│ │ ├── dashboard/ # User dashboard
│ │ ├── profile/ # User profile management
│ │ ├── settings/ # Application settings
│ │ └── data-demo/ # Data demonstration page
│ ├── auth/ # Authentication pages
│ └── globals.css # Global styles
├── components/ # Reusable UI components
│ ├── auth/ # Authentication-related components
│ └── ui/ # Base UI components (buttons, cards, etc.)
├── contexts/ # React contexts for state management
├── hooks/ # Custom React hooks
├── lib/ # Utility libraries and configurations
├── providers/ # React providers
└── types/ # TypeScript type definitions
Protected Routes (/src/app/(protected)/)
- Require user authentication
- Automatically redirect to auth page if not logged in
- Include: dashboard, profile, settings, data-demo
Public Routes
- Accessible without authentication
- Include: home page, auth page
- Next.js 15.4.3 - React framework with App Router
- React 19.1.0 - UI library
- TypeScript 5 - Type safety and developer experience
- Supabase - Backend as a service with authentication
- @supabase/supabase-js - Supabase JavaScript client
- @tanstack/react-query - Server state management
- @tanstack/react-query-devtools - Development tools for React Query
- @tanstack/react-table - Table building library
- Axios - HTTP client for API requests
- Tailwind CSS 4 - Utility-first CSS framework
- shadcn/ui - Modern UI component library built on Tailwind CSS
- Lucide React - Icon library
- class-variance-authority - CSS class variants
- clsx & tailwind-merge - Conditional CSS classes
- ESLint - Code linting
- @eslint/eslintrc - ESLint configuration
- eslint-config-next - Next.js specific ESLint rules
- Prettier - Code formatting
- Husky - Git hooks for code quality
- lint-staged - Run linters on staged files
- Zod - Schema validation
- UUID - Unique identifier generation
- dotenv - Environment variable management
npm run dev- Start development server with Turbopacknpm run build- Build production applicationnpm run start- Start production servernpm run lint- Run ESLint code analysisnpm run lint:fix- Run ESLint and automatically fix issuesnpm run format- Format code with Prettiernpm run format:check- Check if code is properly formatted
This project uses Husky for Git hooks to ensure code quality:
- Runs
lint-stagedon staged files - Automatically fixes ESLint issues and formats code with Prettier
- Only processes files that are staged for commit
- Runs full lint check on the entire codebase
- Verifies all files are properly formatted
- Prevents pushing if there are linting errors or formatting issues
# Format all files
npm run format
# Check formatting without changing files
npm run format:check
# Run linting and fix issues
npm run lint:fixThe application uses Supabase for authentication with the following flow:
- Users can sign up or log in through the
/authpage - Authentication state is managed through
AuthContext - Protected routes use the
useRequireAuthhook to verify authentication - Unauthenticated users are redirected to the auth page
- Component Structure: Follow the established pattern of separating UI components from business logic
- Type Safety: Use TypeScript interfaces and types defined in
src/types/ - State Management: Use React Query for server state and React Context for client state
- Styling: Use Tailwind CSS classes and maintain consistency with the design system
- Authentication: Always protect sensitive routes using the provided authentication hooks
- Fork the repository
- Create a feature branch
- Make your changes
- Test your changes locally
- Submit a pull request
For issues and questions, please open an issue in the repository or contact the Builders League team.