Skip to content

themaheshsutar/game-hub

Repository files navigation

Game Hub

Live Demo

A minimal React + Vite project demonstrating a game listing UI built with Chakra UI.

Tech stack

  • React (TypeScript)
  • Vite
  • Chakra UI
  • Axios
  • react-icons

Prerequisites

  • Node.js 18+ (or compatible)
  • npm / pnpm / yarn

Setup

  1. Install dependencies
# npm
npm install

# or pnpm
pnpm install
  1. Run the dev server
npm run dev
# or pnpm dev
  1. Build for production
npm run build

Useful scripts

  • dev — start Vite dev server
  • build — production build
  • preview — preview production build

Project structure (important files)

  • src/ — application source
    • components/ — React components (UI, layout, widgets)
    • hooks/ — reusable data hooks (useGames, useGenres, etc.)
    • services/ — API client + helpers
    • components/ui/provider.tsx — Chakra provider (theme + color mode)
    • components/ui/theme.tsx — (optional) custom Chakra theme

Path aliases

This project uses the @/ alias to reference src/ (configured in tsconfig.app.json). Vite resolves it via vite-tsconfig-paths (see vite.config.ts).

Chakra UI customization

  • To customize colors, edit src/components/ui/theme.tsx (or create it) and pass the theme into ChakraProvider in src/components/ui/provider.tsx.
  • Example: override the gray palette or add semantic tokens to keep consistent light/dark colors.

Common notes

  • If you change TypeScript path aliases, restart the dev server so Vite reloads config.
  • Guard network hooks (useData) against undefined values and memoize request configs to avoid unnecessary refetches.

Contributing

  • PRs are welcome. Keep changes focused and include a short description of motivation in the PR.

License

  • MIT (adjust as needed)

React + TypeScript + Vite

This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.

Currently, two official plugins are available:

React Compiler

The React Compiler is not enabled on this template because of its impact on dev & build performances. To add it, see this documentation.

Expanding the ESLint configuration

If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules:

export default defineConfig([
  globalIgnores(["dist"]),
  {
    files: ["**/*.{ts,tsx}"],
    extends: [
      // Other configs...

      // Remove tseslint.configs.recommended and replace with this
      tseslint.configs.recommendedTypeChecked,
      // Alternatively, use this for stricter rules
      tseslint.configs.strictTypeChecked,
      // Optionally, add this for stylistic rules
      tseslint.configs.stylisticTypeChecked,

      // Other configs...
    ],
    languageOptions: {
      parserOptions: {
        project: ["./tsconfig.node.json", "./tsconfig.app.json"],
        tsconfigRootDir: import.meta.dirname,
      },
      // other options...
    },
  },
]);

You can also install eslint-plugin-react-x and eslint-plugin-react-dom for React-specific lint rules:

// eslint.config.js
import reactX from "eslint-plugin-react-x";
import reactDom from "eslint-plugin-react-dom";

export default defineConfig([
  globalIgnores(["dist"]),
  {
    files: ["**/*.{ts,tsx}"],
    extends: [
      // Other configs...
      // Enable lint rules for React
      reactX.configs["recommended-typescript"],
      // Enable lint rules for React DOM
      reactDom.configs.recommended,
    ],
    languageOptions: {
      parserOptions: {
        project: ["./tsconfig.node.json", "./tsconfig.app.json"],
        tsconfigRootDir: import.meta.dirname,
      },
      // other options...
    },
  },
]);

About

A minimal React + Vite project demonstrating a game listing UI built with Chakra UI.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published