Skip to content

Tournament is a fully responsive esports gaming website, Responsive for all devices, build using NextJS, SCSS, and TypeScript.

License

Notifications You must be signed in to change notification settings

trinhquocthinh/Tournament

Repository files navigation

Tournament Gaming Website - Next.js Conversion

This project has been converted from static HTML to Next.js 14 with TypeScript and SCSS, following the architecture patterns defined in agent.md.

πŸš€ Project Status

The conversion includes:

βœ… Completed:

  • Next.js 14 project structure with App Router
  • TypeScript configuration with path aliases
  • SCSS variables and mixins system
  • Custom React hooks (useScroll, useNavbar, useCursor, useReveal, useTournamentTabs, useButtonRipple)
  • Reusable components (Header, Footer, Layout, BackToTop, CustomCursor)
  • SEO configuration and metadata
  • Data files for navigation, matches, news, benefits
  • Root layout with global styles
  • Home, Tournament, and Article page structures
  • Sitemap and Robots.txt generation
  • Security headers configuration

πŸ“¦ Installation

  1. Install dependencies:

    yarn install
    # or
    npm install
  2. Start the development server:

    yarn dev
    # or
    npm run dev
  3. Open your browser: Navigate to http://localhost:3000

πŸ—οΈ Project Structure

tournament-website/
β”œβ”€β”€ public/
β”‚   β”œβ”€β”€ assets/
β”‚   β”‚   β”œβ”€β”€ css/
β”‚   β”‚   β”œβ”€β”€ images/
β”‚   β”‚   └── js/
β”‚   └── favicon.svg
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ app/
β”‚   β”‚   β”œβ”€β”€ layout.tsx          # Root layout
β”‚   β”‚   β”œβ”€β”€ page.tsx            # Home page
β”‚   β”‚   β”œβ”€β”€ robots.ts           # Dynamic robots.txt
β”‚   β”‚   β”œβ”€β”€ sitemap.ts          # Dynamic sitemap
β”‚   β”‚   β”œβ”€β”€ article/
β”‚   β”‚   β”‚   └── page.tsx
β”‚   β”‚   └── tournament/
β”‚   β”‚       └── page.tsx
β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”œβ”€β”€ Header.tsx
β”‚   β”‚   β”œβ”€β”€ Header.scss
β”‚   β”‚   β”œβ”€β”€ Footer.tsx
β”‚   β”‚   β”œβ”€β”€ Footer.scss
β”‚   β”‚   β”œβ”€β”€ Layout.tsx
β”‚   β”‚   β”œβ”€β”€ BackToTop.tsx
β”‚   β”‚   β”œβ”€β”€ BackToTop.scss
β”‚   β”‚   β”œβ”€β”€ CustomCursor.tsx
β”‚   β”‚   β”œβ”€β”€ CustomCursor.scss
β”‚   β”‚   └── sections/
β”‚   β”‚       β”œβ”€β”€ HeroSection.tsx
β”‚   β”‚       └── HeroSection.scss
β”‚   β”œβ”€β”€ config/
β”‚   β”‚   └── seo.ts             # SEO configuration
β”‚   β”œβ”€β”€ data/
β”‚   β”‚   β”œβ”€β”€ navigation.ts
β”‚   β”‚   β”œβ”€β”€ matches.ts
β”‚   β”‚   β”œβ”€β”€ news.ts
β”‚   β”‚   └── benefits.ts
β”‚   β”œβ”€β”€ hooks/
β”‚   β”‚   β”œβ”€β”€ useScroll.ts
β”‚   β”‚   β”œβ”€β”€ useNavbar.ts
β”‚   β”‚   β”œβ”€β”€ useCursor.ts
β”‚   β”‚   β”œβ”€β”€ useReveal.ts
β”‚   β”‚   β”œβ”€β”€ useTournamentTabs.ts
β”‚   β”‚   └── useButtonRipple.ts
β”‚   β”œβ”€β”€ styles/
β”‚   β”‚   β”œβ”€β”€ globals.scss
β”‚   β”‚   β”œβ”€β”€ _variables.scss
β”‚   β”‚   └── _mixins.scss
β”‚   └── types/
β”‚       β”œβ”€β”€ index.ts
β”‚       └── ion-icon.d.ts
β”œβ”€β”€ next.config.js
β”œβ”€β”€ tsconfig.json
β”œβ”€β”€ package.json
β”œβ”€β”€ .env.local
└── README.md

🎨 Key Features

Server-Side Rendering (SSR)

All pages are server-rendered by default for optimal SEO and performance.

TypeScript

Full type safety throughout the application with custom types for all data structures.

SCSS Architecture

  • Variables: All colors, fonts, and sizes in _variables.scss
  • Mixins: Responsive breakpoints and reusable patterns in _mixins.scss
  • Component Scoping: Each component has its own SCSS file

Custom Hooks

  • useScroll: Tracks scroll position for header and back-to-top button
  • useNavbar: Manages mobile navigation state
  • useCursor: Custom cursor effects
  • useReveal: Scroll-based animations
  • useTournamentTabs: Tournament bracket tab switching
  • useButtonRipple: Button ripple hover effects

SEO Optimization

  • Dynamic metadata for each page
  • Automatic sitemap generation
  • Robots.txt configuration
  • Open Graph and Twitter Card support
  • Semantic HTML structure

Security

  • Comprehensive security headers (CSP, HSTS, X-Frame-Options, etc.)
  • No X-Powered-By header
  • Secure cookie settings

πŸ”¨ Next Steps to Complete the Conversion

1. Create Additional Sections

You need to complete the remaining sections for the home page:

Join Section (src/components/sections/JoinSection.tsx):

  • Form with validation using React Hook Form + Zod
  • Benefits list
  • Form submission handling

Upcoming Matches Section (src/components/sections/UpcomingSection.tsx):

  • Match cards with team logos
  • Date/time display
  • Social media links

News Section (src/components/sections/NewsSection.tsx):

  • News cards grid
  • Dynamic content from data
  • Link to article pages

2. Complete Tournament Page

The tournament page needs:

  • Tournament tabs component (Valorant, Apex, League)
  • Bracket visualization
  • Match results display
  • Tab switching logic using useTournamentTabs hook

3. Complete Article Page

The article page needs:

  • Article content layout
  • Sidebar with latest posts
  • Reading time calculation
  • Social sharing buttons

4. Add Form Validation

Install and configure:

yarn add react-hook-form zod @hookform/resolvers

Then implement form validation in Join section.

5. Add Remaining CSS

Convert the remaining CSS from assets/css/style.css to component-specific SCSS files.

6. Test Everything

  • Test all interactive features (navigation, forms, animations)
  • Verify responsive design on all breakpoints
  • Check SEO metadata on all pages
  • Test performance with Lighthouse

πŸ“ Available Scripts

  • yarn dev - Start development server
  • yarn build - Build for production
  • yarn start - Start production server
  • yarn lint - Run ESLint
  • yarn lint:fix - Fix linting errors
  • yarn type-check - Run TypeScript compiler check
  • yarn format - Format code with Prettier
  • yarn analyze - Analyze bundle size

🌐 Environment Variables

Create .env.local:

NEXT_PUBLIC_SITE_URL=http://localhost:3000
NEXT_PUBLIC_SITE_NAME=Tournament

For production, update with your actual domain.

πŸ” SEO & Metadata

Each page has custom metadata exported for optimal SEO:

export const metadata: Metadata = {
  title: "Page Title",
  description: "Page description",
  // ...other metadata
};

πŸ“± Responsive Breakpoints

  • Mobile: ≀ 574px
  • Mobile Up: β‰₯ 575px
  • Tablet Up: β‰₯ 768px
  • Laptop Up: β‰₯ 992px
  • Desktop Up: β‰₯ 1200px
  • XL Desktop Up: β‰₯ 1400px

🎯 Best Practices Followed

  • βœ… Mobile-first responsive design
  • βœ… Component-based architecture
  • βœ… Type-safe TypeScript
  • βœ… SCSS with BEM-like naming
  • βœ… Server-side rendering for SEO
  • βœ… Proper semantic HTML
  • βœ… Accessibility attributes
  • βœ… Security headers
  • βœ… Image optimization
  • βœ… Code splitting

πŸ“š Learn More

🀝 Contributing

Follow the conventions in agent.md for consistent code style and architecture.


Note: All TypeScript errors shown during file creation are expected and will resolve once you run yarn install to install the dependencies.

About

Tournament is a fully responsive esports gaming website, Responsive for all devices, build using NextJS, SCSS, and TypeScript.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published