├── .all-contributorsrc ├── .editorconfig ├── .env.example ├── .eslintrc.cjs ├── .gitignore ├── .prettierignore ├── .prettierrc ├── Contributing.md ├── FETCH_HEAD ├── LICENSE ├── README.md ├── components.json ├── index.html ├── package.json ├── postcss.config.js ├── public ├── SamayBM.png ├── apple-touch-icon.png ├── favicon-16x16.png ├── favicon-32x32.png ├── favicon.ico ├── pwa-192x192.png ├── pwa-512x512.png ├── pwa-maskable-192x192.png ├── pwa-maskable-512x512.png └── vite.svg ├── src ├── App.tsx ├── assets │ ├── SamayBM.webp │ ├── Screenshot_2024-08-02_at_11.11.12_AM.png │ ├── blunder.webp │ ├── bm.jpg │ ├── bmuniverse.webp │ ├── cbi.svg │ ├── chesscomlogo.webp │ ├── diamond.webp │ ├── noob.jpg │ ├── pieces │ │ ├── bb.png │ │ ├── bk.png │ │ ├── bn.png │ │ ├── bp.png │ │ ├── bq.png │ │ ├── br.png │ │ ├── wb.png │ │ ├── wk.png │ │ ├── wn.png │ │ ├── wp.png │ │ ├── wq.png │ │ └── wr.png │ ├── profile.webp │ ├── react.svg │ ├── samayheader.webp │ ├── signup.webp │ └── sounds │ │ ├── move-capture.mp3 │ │ ├── move-castle.mp3 │ │ ├── move-check.mp3 │ │ ├── move-promote.mp3 │ │ └── move-self.mp3 ├── components │ ├── Background.tsx │ ├── ChatHoverCard.tsx │ ├── CookieConsentWrapper.tsx │ ├── ErrorBoundary.tsx │ ├── EvaluationBar.tsx │ ├── PlayerHoverCard.tsx │ ├── ShareGamepopup.tsx │ ├── comingsoon.tsx │ ├── input-box-with-label.tsx │ ├── landing │ │ ├── PredictionCard.tsx │ │ └── navbar.tsx │ ├── pgn-viewer │ │ ├── board.tsx │ │ ├── movetable.tsx │ │ └── timer.tsx │ ├── sidebar │ │ ├── Header.tsx │ │ ├── MobileMenu.tsx │ │ └── Sidebar.tsx │ ├── signup │ │ ├── ChessVerificationStep.tsx │ │ ├── GoogleSignUpButton.tsx │ │ └── VerificationCodeDisplay.tsx │ └── ui │ │ ├── .switch.tsx.icloud │ │ ├── Alert.tsx │ │ ├── avatar.tsx │ │ ├── badge.tsx │ │ ├── button.tsx │ │ ├── card.tsx │ │ ├── dialog.tsx │ │ ├── dropdown-menu.tsx │ │ ├── hover-card.tsx │ │ ├── icons.tsx │ │ ├── input.tsx │ │ ├── sheet.tsx │ │ ├── slider.tsx │ │ ├── table.tsx │ │ └── tabs.tsx ├── hooks │ ├── useGoogleAuth.ts │ └── useRouteChange.ts ├── lib │ ├── jwtDecoder.ts │ └── utils.ts ├── main.tsx ├── pages │ ├── 404NotFound.tsx │ ├── BulletinBoard.tsx │ ├── Chat.tsx │ ├── ChessNews.tsx │ ├── ChessTutorials.tsx │ ├── Community.tsx │ ├── GTE.tsx │ ├── Gift.tsx │ ├── Landing.tsx │ ├── Learn.tsx │ ├── PrivacyPolicy.tsx │ ├── SignUp.tsx │ ├── SignUpCallback.tsx │ ├── SomethingWentWrong.tsx │ ├── Subscribe.tsx │ ├── ThankYou.tsx │ └── Welcome.tsx ├── services │ ├── auth.ts │ ├── chessApi.ts │ ├── communityApi.ts │ ├── gamefetcher.ts │ └── getclock.ts ├── styles │ └── globals.css └── vite-env.d.ts ├── tailwind.config.js ├── tsconfig.json ├── tsconfig.node.json ├── vercel.json └── vite.config.ts /.all-contributorsrc: -------------------------------------------------------------------------------- 1 | { 2 | "projectName": "https://github.com/Bot-Rakshit/bm_frontend", 3 | "projectOwner": "Bot-Rakshit", 4 | "repoType": "github", 5 | "repoHost": "https://github.com", 6 | "files": [ 7 | "README.md" 8 | ], 9 | "imageSize": 100, 10 | "commit": true, 11 | "commitConvention": "angular", 12 | "contributors": [ 13 | { 14 | "login": "Bot-Rakshit", 15 | "name": "Rakshit Singh", 16 | "avatar_url": "https://avatars.githubusercontent.com/u/89170079?v=4", 17 | "profile": "https://github.com/Bot-Rakshit", 18 | "contributions": [ 19 | "code", 20 | "maintenance" 21 | ] 22 | }, 23 | { 24 | "login": "Dinesh-Gautam", 25 | "name": "DG", 26 | "avatar_url": "https://avatars.githubusercontent.com/u/69267018?v=4", 27 | "profile": "https://github.com/Dinesh-Gautam", 28 | "contributions": [ 29 | "code" 30 | ] 31 | }, 32 | { 33 | "login": "karthiksneu", 34 | "name": "Karthik Sunil", 35 | "avatar_url": "https://avatars.githubusercontent.com/u/114313259?v=4", 36 | "profile": "https://github.com/karthiksneu", 37 | "contributions": [ 38 | "code" 39 | ] 40 | }, 41 | { 42 | "login": "vishant007", 43 | "name": "Vishant Shah", 44 | "avatar_url": "https://avatars.githubusercontent.com/u/64253459?v=4", 45 | "profile": "https://github.com/vishant007", 46 | "contributions": [ 47 | "code" 48 | ] 49 | }, 50 | { 51 | "login": "hemantmodii", 52 | "name": "Hemant Pradeep Modi", 53 | "avatar_url": "https://avatars.githubusercontent.com/u/143285136?v=4", 54 | "profile": "https://my-portfolio-mauve-eight-48.vercel.app/", 55 | "contributions": [ 56 | "code" 57 | ] 58 | }, 59 | { 60 | "login": "MoutasimQazi", 61 | "name": "Moutasim", 62 | "avatar_url": "https://avatars.githubusercontent.com/u/115083371?v=4", 63 | "profile": "https://moutasimqazi.github.io/resume/", 64 | "contributions": [ 65 | "code" 66 | ] 67 | }, 68 | { 69 | "login": "itsnileshgosavi", 70 | "name": "Nilesh Gosavi", 71 | "avatar_url": "https://avatars.githubusercontent.com/u/109579816?v=4", 72 | "profile": "https://github.com/itsnileshgosavi", 73 | "contributions": [ 74 | "code" 75 | ] 76 | }, 77 | { 78 | "login": "manjotsk", 79 | "name": "Manjot Singh", 80 | "avatar_url": "https://avatars.githubusercontent.com/u/26750100?v=4", 81 | "profile": "https://manjot.in/", 82 | "contributions": [ 83 | "code", 84 | "maintenance" 85 | ] 86 | }, 87 | { 88 | "login": "krushna06", 89 | "name": "n0step_", 90 | "avatar_url": "https://avatars.githubusercontent.com/u/69315835?v=4", 91 | "profile": "https://n0step.xyz/", 92 | "contributions": [ 93 | "code" 94 | ] 95 | } 96 | ], 97 | "contributorsPerLine": 7, 98 | "linkToUsage": true 99 | } 100 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # http://editorconfig.org 2 | 3 | root = true 4 | 5 | [*] 6 | charset = utf-8 7 | indent_style = space 8 | indent_size = 2 9 | end_of_line = lf 10 | insert_final_newline = true 11 | trim_trailing_whitespace = true 12 | 13 | [*.md] 14 | insert_final_newline = false 15 | trim_trailing_whitespace = false 16 | -------------------------------------------------------------------------------- /.env.example: -------------------------------------------------------------------------------- 1 | VITE_BACKEND_URL= 2 | VITE_BACKEND2_URL= 3 | VITE_YOUTUBE_API_KEY= 4 | VITE_SERVER_URL= -------------------------------------------------------------------------------- /.eslintrc.cjs: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | env: { browser: true, es2020: true }, 3 | extends: [ 4 | 'eslint:recommended', 5 | 'plugin:@typescript-eslint/recommended', 6 | 'plugin:react-hooks/recommended', 7 | ], 8 | parser: '@typescript-eslint/parser', 9 | parserOptions: { ecmaVersion: 'latest', sourceType: 'module' }, 10 | plugins: ['react-refresh'], 11 | rules: { 12 | 'react-refresh/only-export-components': 'warn', 13 | }, 14 | }; 15 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | pnpm-debug.log* 8 | lerna-debug.log* 9 | 10 | node_modules 11 | package-lock.json 12 | dev-dist 13 | dist 14 | dist-ssr 15 | *.local 16 | 17 | # Editor directories and files 18 | .vscode/* 19 | !.vscode/extensions.json 20 | .idea 21 | .DS_Store 22 | *.suo 23 | *.ntvs* 24 | *.njsproj 25 | *.sln 26 | *.sw? 27 | *.tmp 28 | *.yaml 29 | .env -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | .code 2 | globals.d.ts 3 | *.png 4 | *.jpeg 5 | *.mp4 6 | *.mp3 7 | *.vtt 8 | *.ico 9 | *.toml 10 | 11 | **/partials/markup 12 | **/partials/import 13 | **/dist 14 | 15 | .gitignore 16 | .gitkeep 17 | .prettierignore 18 | -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "useTabs": false, 3 | "singleQuote": true, 4 | "trailingComma": "all", 5 | "singleAttributePerLine": false, 6 | "printWidth": 80, 7 | "tabWidth": 2, 8 | "experimentalTernaries": true, 9 | "plugins": ["@ianvs/prettier-plugin-sort-imports"], 10 | "importOrder": [ 11 | "^clsx$", 12 | "^react$", 13 | "^next", 14 | "", 15 | "~.*icons", 16 | "", 17 | ".css$", 18 | "", 19 | "^node:", 20 | "", 21 | "", 22 | ".webp?$", 23 | ".mp4?$", 24 | "", 25 | "^[$]", 26 | "^[../]", 27 | "^(?!.*[.](png|webp|mp4)$)[./].*$" 28 | ], 29 | "importOrderParserPlugins": ["jsx", "typescript", "decorators"], 30 | "importOrderSeparation": true, 31 | "importOrderSortSpecifiers": true, 32 | "importOrderCaseInsensitive": true 33 | } 34 | -------------------------------------------------------------------------------- /Contributing.md: -------------------------------------------------------------------------------- 1 | # Contributing to BMSamay.com Frontend 2 | 3 | We are excited that you are interested in contributing to the BMSamay.com Frontend project! Your contributions are valuable and help improve the project for everyone. Please take a moment to read through these guidelines before you get started. 4 | 5 | 6 | ## How Can I Contribute? 7 | 8 | ### Reporting Bugs 9 | 10 | If you find a bug in the project, please open an issue on GitHub. Include as much detail as possible to help us understand and resolve the issue: 11 | 12 | - A clear and descriptive title. 13 | - A detailed description of the issue. 14 | - Steps to reproduce the issue. 15 | - Any relevant logs, screenshots, or additional context. 16 | 17 | ### Suggesting Features 18 | 19 | We welcome feature suggestions! If you have an idea for a new feature, please open an issue on GitHub with the following details: 20 | 21 | - A clear and descriptive title. 22 | - A detailed description of the proposed feature. 23 | - Any relevant examples or use cases. 24 | 25 | ### Contributing Code 26 | 27 | 1. **Fork the Repository**: Fork the repository on GitHub and clone it to your local machine. 28 | 29 | ```bash 30 | git clone https://github.com/YOUR_USERNAME/bm_frontend.git 31 | cd bm_frontend 32 | 33 | 2. **Create a Branch**: Create a new branch for your changes. 34 | 35 | ```bash 36 | git checkout -b feature-branch 37 | ``` 38 | 39 | 40 | 3. **Make Your Changes**: Implement your changes, making sure to follow the project's coding standards and conventions. 41 | 42 | 43 | 44 | 5. **Commit Your Changes**: Commit your changes with a clear and concise commit message. 45 | 46 | ```bash 47 | git add . 48 | git commit -m "Add detailed commit message here" 49 | ``` 50 | 5. **Push to GitHub**: Push your changes to your forked repository. 51 | 52 | ```bash 53 | git push origin feature-branch 54 | ``` 55 | 56 | 6. **Open a Pull Request**: Open a pull request on GitHub, comparing your feature branch to the main repository's main branch. Provide a clear and detailed description of your changes. 57 | 58 | 59 | ### Code Review Process 60 | 61 | - All submissions, including submissions by project members, require review. 62 | - We use GitHub's pull request process for code reviews. 63 | - Be sure to respond to any feedback or requested changes promptly. 64 | 65 | ### Style Guide 66 | 67 | - Follow the existing code style in the project. 68 | - Use descriptive variable and function names. 69 | - Keep functions small and focused. 70 | - Write comments as necessary to explain your code. 71 | 72 | ### Writing Documentation 73 | 74 | - If you are adding a new feature, update the documentation accordingly. 75 | - Ensure your documentation is clear and concise. 76 | - Follow the format and style of the existing documentation. 77 | 78 | Thank you for your contributions! 79 | -------------------------------------------------------------------------------- /FETCH_HEAD: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bot-Rakshit/bm_frontend/1e381baa866e5698ec2b45581820ccec8344763c/FETCH_HEAD -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2024 Samay Raina 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # BMSamay.com Frontend 2 | 3 | # Not actively maintained. We are shifting the codebase to v2. 4 | 5 | 6 | Join our Discord - https://discord.gg/6Pje7Wch 7 | 8 | [![All Contributors](https://img.shields.io/badge/all_contributors-9-orange.svg?style=flat-square)](#contributors-) 9 | 10 | 11 | [![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/Dan5py/react-vite-ui/blob/main/LICENSE) 12 | 13 | This is Samay Raina's official community website for chess enthusiasts. 14 | Support the Developer - [!["Buy Me A Coffee"](https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png)](https://buymeacoffee.com/rakshitsingh) 15 | 16 | 17 | ## 📑 Table of Contents 18 | 19 | - [Features](#-features) 20 | - [Prerequisites](#-prerequisites) 21 | - [Getting Started](#-getting-started) 22 | - [Available Scripts](#-available-scripts) 23 | - [Project Structure](#-project-structure) 24 | - [Contribution](#-contribution) 25 | - [License](#-license) 26 | 27 | ## 🎉 Features 28 | 29 | - **Community Dashboard** - An interactive dashboard which shows the chess community stats and leaderboard. 30 | - **Chess News** - Chess news from all over the world powered by [ChessBase India](https://chessbase.in/). 31 | - **Connect Your Chess.com Profile** - Connect your chess.com profile to see where you stand in the community leaderboard. 32 | - **BM Points** - A point based scoring for correct guesses of samay's chess games. 33 | - **Integrations** - Coming soon. 34 | - **Streamers** - Coming soon. 35 | 36 | 37 | ## ⚙️ Prerequisites 38 | 39 | Make sure you have the following installed on your development machine: 40 | 41 | - Node.js (version 16 or above) - preferred v22.x.x 42 | - pnpm (package manager) or npm - preferred pnpm 43 | 44 | ## 🚀 Getting Started 45 | 46 | Follow these steps to get started with the BMSamay.com Frontend: 47 | 48 | 1. Clone the repository: 49 | 50 | ```bash 51 | git clone https://github.com/Bot-Rakshit/bm_frontend.git 52 | ``` 53 | 54 | 2. Navigate to the project directory: 55 | 56 | ```bash 57 | cd bm_frontend 58 | ``` 59 | 60 | 3. Install the dependencies: 61 | 62 | ```bash 63 | pnpm install 64 | ``` 65 | or 66 | 67 | ```bash 68 | npm install 69 | ``` 70 | 71 | 4. Start the development server: 72 | 73 | ```bash 74 | pnpm dev 75 | ``` 76 | ```bash 77 | npm run dev 78 | ``` 79 | 80 | ## 📜 Available Scripts 81 | 82 | - pnpm dev - Starts the development server. 83 | - pnpm build - Builds the production-ready code. 84 | - pnpm lint - Runs ESLint to analyze and lint the code. 85 | - pnpm preview - Starts the Vite development server in preview mode. 86 | 87 | ## 📂 Project Structure 88 | 89 | The project structure follows a standard React application layout: 90 | 91 | ```python 92 | bm_frontend/ 93 | ├── node_modules/ # Project dependencies 94 | ├── public/ # Public assets 95 | ├── src/ # Application source code 96 | │ ├── components/ # React components 97 | │ │ └── ui/ # shadc/ui components 98 | │ ├── styles/ # CSS stylesheets 99 | │ ├── lib/ # Utility functions 100 | │ ├── App.tsx # Application entry point 101 | │ └── index.tsx # Main rendering file 102 | ├── .eslintrc.json # ESLint configuration 103 | ├── index.html # HTML entry point 104 | ├── postcss.config.js # PostCSS configuration 105 | ├── tailwind.config.js # Tailwind CSS configuration 106 | ├── tsconfig.json # TypeScript configuration 107 | └── vite.config.ts # Vite configuration 108 | ``` 109 | 110 | ## 🤝 Contribution 111 | 112 | We welcome contributions to the BMSamay.com Frontend project! To contribute: 113 | 114 | 1. Fork the repository. 115 | 2. Create a new branch (git checkout -b feature-branch). 116 | 3. Make your changes and commit them (git commit -m 'Add some feature'). 117 | 4. Push to the branch (git push origin feature-branch). 118 | 5. Open a pull request. 119 | 120 | Please read our [Contributing Guidelines](Contributing.md) for more details. 121 | 122 | ## 📄 License 123 | 124 | This project is licensed under the MIT License. See the [LICENSE](https://choosealicense.com/licenses/mit/) file for details. 125 | 126 | ## Contributors ✨ 127 | 128 | Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)): 129 | 130 | - Feel free to join our discord community : https://discord.gg/hD5neU5U 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 158 | 159 | 160 |
Rakshit Singh
Rakshit Singh

💻 🚧
DG
DG

💻
Karthik Sunil
Karthik Sunil

💻
Vishant Shah
Vishant Shah

💻
Hemant Pradeep Modi
Hemant Pradeep Modi

💻
Moutasim
Moutasim

💻
Nilesh Gosavi
Nilesh Gosavi

💻
Manjot Singh
Manjot Singh

💻 🚧
n0step_
n0step_

💻
154 | 155 | Add your contributions 156 | 157 |
161 | 162 | 163 | 164 | 165 | 166 | 167 | This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome! 168 | -------------------------------------------------------------------------------- /components.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://ui.shadcn.com/schema.json", 3 | "style": "default", 4 | "rsc": false, 5 | "tailwind": { 6 | "config": "tailwind.config.js", 7 | "css": "src/styles/globals.css", 8 | "baseColor": "slate", 9 | "cssVariables": true 10 | }, 11 | "aliases": { 12 | "components": "@/components", 13 | "utils": "@/lib/utils" 14 | } 15 | } -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | BM Samay Raina - India's Biggest Chess Community 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "react-vite-ui", 3 | "private": true, 4 | "version": "0.2.1", 5 | "type": "module", 6 | "scripts": { 7 | "dev": "vite", 8 | "build": "NODE_ENV=production tsc && vite build", 9 | "lint": "eslint src --ext ts,tsx --report-unused-disable-directives --max-warnings 0", 10 | "preview": "vite preview", 11 | "format": "prettier src --write --log-level warn" 12 | }, 13 | "dependencies": { 14 | "@radix-ui/react-avatar": "^1.1.0", 15 | "@radix-ui/react-dialog": "^1.1.1", 16 | "@radix-ui/react-dropdown-menu": "^2.1.1", 17 | "@radix-ui/react-hover-card": "^1.1.1", 18 | "@radix-ui/react-icons": "^1.3.0", 19 | "@radix-ui/react-slider": "^1.2.0", 20 | "@radix-ui/react-slot": "^1.1.0", 21 | "@radix-ui/react-tabs": "^1.1.0", 22 | "axios": "^1.7.2", 23 | "chess.js": "1.0.0-beta.8", 24 | "class-variance-authority": "^0.6.1", 25 | "clsx": "^1.2.1", 26 | "esbuild": "^0.17.19", 27 | "framer-motion": "^11.2.12", 28 | "install": "^0.13.0", 29 | "js-cookie": "^3.0.5", 30 | "jwt-decode": "^4.0.0", 31 | "lucide-react": "^0.244.0", 32 | "npm": "^10.8.1", 33 | "radix-ui": "^1.0.1", 34 | "react": "^18.3.1", 35 | "react-canvas-confetti": "^2.0.7", 36 | "react-chessboard": "^4.6.0", 37 | "react-dom": "^18.2.0", 38 | "react-feather": "^2.0.10", 39 | "react-helmet-async": "^2.0.5", 40 | "react-icons": "^5.2.1", 41 | "react-intersection-observer": "^9.10.3", 42 | "react-router-dom": "^6.26.2", 43 | "react-scroll": "^1.9.0", 44 | "react-swipeable": "^7.0.1", 45 | "socket.io-client": "^4.7.5", 46 | "tailwindcss-animate": "^1.0.6", 47 | "vite-plugin-pwa": "^0.20.0", 48 | "youtube-chat": "^2.2.0" 49 | }, 50 | "devDependencies": { 51 | "@ianvs/prettier-plugin-sort-imports": "^4.3.1", 52 | "@types/canvas-confetti": "^1.6.4", 53 | "@types/js-cookie": "^3.0.6", 54 | "@types/node": "^20.8.0", 55 | "@types/react": "^18.0.37", 56 | "@types/react-dom": "^18.0.11", 57 | "@typescript-eslint/eslint-plugin": "^5.59.0", 58 | "@typescript-eslint/parser": "^5.59.0", 59 | "@vitejs/plugin-react": "^4.0.0", 60 | "autoprefixer": "^10.4.14", 61 | "canvas-confetti": "^1.9.3", 62 | "eslint": "^8.38.0", 63 | "eslint-plugin-react-hooks": "^4.6.0", 64 | "eslint-plugin-react-refresh": "^0.3.4", 65 | "postcss": "^8.4.24", 66 | "prettier": "^3.3.3", 67 | "prettier-plugin-tailwindcss": "^0.6.5", 68 | "tailwind-merge": "^1.14.0", 69 | "tailwindcss": "^3.3.2", 70 | "typescript": "^5.0.2", 71 | "vite": "^4.3.9" 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /postcss.config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | plugins: { 3 | tailwindcss: {}, 4 | autoprefixer: {}, 5 | }, 6 | } 7 | -------------------------------------------------------------------------------- /public/SamayBM.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bot-Rakshit/bm_frontend/1e381baa866e5698ec2b45581820ccec8344763c/public/SamayBM.png -------------------------------------------------------------------------------- /public/apple-touch-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bot-Rakshit/bm_frontend/1e381baa866e5698ec2b45581820ccec8344763c/public/apple-touch-icon.png -------------------------------------------------------------------------------- /public/favicon-16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bot-Rakshit/bm_frontend/1e381baa866e5698ec2b45581820ccec8344763c/public/favicon-16x16.png -------------------------------------------------------------------------------- /public/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bot-Rakshit/bm_frontend/1e381baa866e5698ec2b45581820ccec8344763c/public/favicon-32x32.png -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bot-Rakshit/bm_frontend/1e381baa866e5698ec2b45581820ccec8344763c/public/favicon.ico -------------------------------------------------------------------------------- /public/pwa-192x192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bot-Rakshit/bm_frontend/1e381baa866e5698ec2b45581820ccec8344763c/public/pwa-192x192.png -------------------------------------------------------------------------------- /public/pwa-512x512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bot-Rakshit/bm_frontend/1e381baa866e5698ec2b45581820ccec8344763c/public/pwa-512x512.png -------------------------------------------------------------------------------- /public/pwa-maskable-192x192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bot-Rakshit/bm_frontend/1e381baa866e5698ec2b45581820ccec8344763c/public/pwa-maskable-192x192.png -------------------------------------------------------------------------------- /public/pwa-maskable-512x512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bot-Rakshit/bm_frontend/1e381baa866e5698ec2b45581820ccec8344763c/public/pwa-maskable-512x512.png -------------------------------------------------------------------------------- /public/vite.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/App.tsx: -------------------------------------------------------------------------------- 1 | import BMLogo from '@/assets/SamayBM.webp'; 2 | import { Badge } from '@/components/ui/badge'; 3 | 4 | function App() { 5 | return ( 6 |
7 |
8 |
9 | BM Samay Logo 10 | + 11 | Vite Logo 12 |
13 |

Welcome to BM Samay

14 |

Join the BM SamayRaina community and get noticed by Samay Raina. Earn BM points, make predictions, and get discounted offers on Samay's merch as well as a chance to win free show tickets.

15 | 16 | shadcn/ui 17 | 18 |
19 |
20 | ); 21 | } 22 | 23 | export default App; 24 | 25 | -------------------------------------------------------------------------------- /src/assets/SamayBM.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bot-Rakshit/bm_frontend/1e381baa866e5698ec2b45581820ccec8344763c/src/assets/SamayBM.webp -------------------------------------------------------------------------------- /src/assets/Screenshot_2024-08-02_at_11.11.12_AM.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bot-Rakshit/bm_frontend/1e381baa866e5698ec2b45581820ccec8344763c/src/assets/Screenshot_2024-08-02_at_11.11.12_AM.png -------------------------------------------------------------------------------- /src/assets/blunder.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bot-Rakshit/bm_frontend/1e381baa866e5698ec2b45581820ccec8344763c/src/assets/blunder.webp -------------------------------------------------------------------------------- /src/assets/bm.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bot-Rakshit/bm_frontend/1e381baa866e5698ec2b45581820ccec8344763c/src/assets/bm.jpg -------------------------------------------------------------------------------- /src/assets/bmuniverse.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bot-Rakshit/bm_frontend/1e381baa866e5698ec2b45581820ccec8344763c/src/assets/bmuniverse.webp -------------------------------------------------------------------------------- /src/assets/chesscomlogo.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bot-Rakshit/bm_frontend/1e381baa866e5698ec2b45581820ccec8344763c/src/assets/chesscomlogo.webp -------------------------------------------------------------------------------- /src/assets/diamond.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bot-Rakshit/bm_frontend/1e381baa866e5698ec2b45581820ccec8344763c/src/assets/diamond.webp -------------------------------------------------------------------------------- /src/assets/noob.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bot-Rakshit/bm_frontend/1e381baa866e5698ec2b45581820ccec8344763c/src/assets/noob.jpg -------------------------------------------------------------------------------- /src/assets/pieces/bb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bot-Rakshit/bm_frontend/1e381baa866e5698ec2b45581820ccec8344763c/src/assets/pieces/bb.png -------------------------------------------------------------------------------- /src/assets/pieces/bk.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bot-Rakshit/bm_frontend/1e381baa866e5698ec2b45581820ccec8344763c/src/assets/pieces/bk.png -------------------------------------------------------------------------------- /src/assets/pieces/bn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bot-Rakshit/bm_frontend/1e381baa866e5698ec2b45581820ccec8344763c/src/assets/pieces/bn.png -------------------------------------------------------------------------------- /src/assets/pieces/bp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bot-Rakshit/bm_frontend/1e381baa866e5698ec2b45581820ccec8344763c/src/assets/pieces/bp.png -------------------------------------------------------------------------------- /src/assets/pieces/bq.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bot-Rakshit/bm_frontend/1e381baa866e5698ec2b45581820ccec8344763c/src/assets/pieces/bq.png -------------------------------------------------------------------------------- /src/assets/pieces/br.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bot-Rakshit/bm_frontend/1e381baa866e5698ec2b45581820ccec8344763c/src/assets/pieces/br.png -------------------------------------------------------------------------------- /src/assets/pieces/wb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bot-Rakshit/bm_frontend/1e381baa866e5698ec2b45581820ccec8344763c/src/assets/pieces/wb.png -------------------------------------------------------------------------------- /src/assets/pieces/wk.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bot-Rakshit/bm_frontend/1e381baa866e5698ec2b45581820ccec8344763c/src/assets/pieces/wk.png -------------------------------------------------------------------------------- /src/assets/pieces/wn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bot-Rakshit/bm_frontend/1e381baa866e5698ec2b45581820ccec8344763c/src/assets/pieces/wn.png -------------------------------------------------------------------------------- /src/assets/pieces/wp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bot-Rakshit/bm_frontend/1e381baa866e5698ec2b45581820ccec8344763c/src/assets/pieces/wp.png -------------------------------------------------------------------------------- /src/assets/pieces/wq.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bot-Rakshit/bm_frontend/1e381baa866e5698ec2b45581820ccec8344763c/src/assets/pieces/wq.png -------------------------------------------------------------------------------- /src/assets/pieces/wr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bot-Rakshit/bm_frontend/1e381baa866e5698ec2b45581820ccec8344763c/src/assets/pieces/wr.png -------------------------------------------------------------------------------- /src/assets/profile.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bot-Rakshit/bm_frontend/1e381baa866e5698ec2b45581820ccec8344763c/src/assets/profile.webp -------------------------------------------------------------------------------- /src/assets/react.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/assets/samayheader.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bot-Rakshit/bm_frontend/1e381baa866e5698ec2b45581820ccec8344763c/src/assets/samayheader.webp -------------------------------------------------------------------------------- /src/assets/signup.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bot-Rakshit/bm_frontend/1e381baa866e5698ec2b45581820ccec8344763c/src/assets/signup.webp -------------------------------------------------------------------------------- /src/assets/sounds/move-capture.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bot-Rakshit/bm_frontend/1e381baa866e5698ec2b45581820ccec8344763c/src/assets/sounds/move-capture.mp3 -------------------------------------------------------------------------------- /src/assets/sounds/move-castle.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bot-Rakshit/bm_frontend/1e381baa866e5698ec2b45581820ccec8344763c/src/assets/sounds/move-castle.mp3 -------------------------------------------------------------------------------- /src/assets/sounds/move-check.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bot-Rakshit/bm_frontend/1e381baa866e5698ec2b45581820ccec8344763c/src/assets/sounds/move-check.mp3 -------------------------------------------------------------------------------- /src/assets/sounds/move-promote.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bot-Rakshit/bm_frontend/1e381baa866e5698ec2b45581820ccec8344763c/src/assets/sounds/move-promote.mp3 -------------------------------------------------------------------------------- /src/assets/sounds/move-self.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bot-Rakshit/bm_frontend/1e381baa866e5698ec2b45581820ccec8344763c/src/assets/sounds/move-self.mp3 -------------------------------------------------------------------------------- /src/components/Background.tsx: -------------------------------------------------------------------------------- 1 | const Background = () => { 2 | return ( 3 |
4 |
5 | {/* Depth elements */} 6 |
7 |
8 |
9 | ) 10 | } 11 | 12 | export default Background -------------------------------------------------------------------------------- /src/components/ChatHoverCard.tsx: -------------------------------------------------------------------------------- 1 | import { HoverCard, HoverCardTrigger, HoverCardContent } from "@/components/ui/hover-card"; 2 | import { FaChessKnight } from 'react-icons/fa'; 3 | 4 | interface UserRating { 5 | chessUsername: string; 6 | ratings: { 7 | blitz: number; 8 | bullet: number; 9 | rapid: number; 10 | }; 11 | } 12 | 13 | interface ChatHoverCardProps { 14 | username: string; 15 | userRating?: UserRating; 16 | } 17 | 18 | const ChatHoverCard: React.FC = ({ username, userRating }) => { 19 | const handleClick = () => { 20 | if (userRating) { 21 | window.open(`https://www.chess.com/member/${userRating.chessUsername}`, '_blank'); 22 | } 23 | }; 24 | 25 | return ( 26 | 27 | 28 | 32 | 33 | {username} 34 | 35 | 36 | 37 | 38 | {userRating ? ( 39 |
40 |
41 | 42 |
43 |

Chess Username:

44 |

{userRating.chessUsername}

45 |
46 |
47 |
48 |

Blitz: {userRating.ratings.blitz}

49 |

Bullet: {userRating.ratings.bullet}

50 |

Rapid: {userRating.ratings.rapid}

51 |
52 |
53 | ) : ( 54 |

No ratings available

55 | )} 56 |
57 |
58 | ); 59 | }; 60 | 61 | export default ChatHoverCard; -------------------------------------------------------------------------------- /src/components/CookieConsentWrapper.tsx: -------------------------------------------------------------------------------- 1 | import { useEffect, useState } from 'react'; 2 | 3 | import useRouteChange from '@/hooks/useRouteChange'; 4 | import { cn, setConsentCookie } from '@/lib/utils'; 5 | import Cookies from 'js-cookie'; 6 | import { CookieIcon } from 'lucide-react'; 7 | import { Outlet, useLocation } from 'react-router-dom'; 8 | 9 | import { Button } from './ui/button'; 10 | 11 | interface CookieConsentProps { 12 | isVisible: boolean; 13 | onAccept: () => void; 14 | } 15 | 16 | const CookieConsent = ({ isVisible, onAccept }: CookieConsentProps) => { 17 | if (!isVisible) return null; 18 | 19 | return ( 20 |
29 |
30 |
31 |
32 |

We use cookies

33 | 34 |
35 |
36 |

37 | We use cookies to ensure you get the best experience on our 38 | website. 39 |
40 |
41 | 42 | By clicking " 43 | Accept", you 44 | agree to our use of cookies. 45 | 46 |
47 |

48 |
49 |
50 | 56 |
57 |
58 |
59 |
60 | ); 61 | }; 62 | 63 | const CookieConsentWrapper = () => { 64 | const [consentStatus, setConsentStatus] = useState(true); 65 | const location = useLocation(); 66 | 67 | useRouteChange({ callback: setConsentCookie }); 68 | 69 | const acceptCookies = () => { 70 | Cookies.set('cookie-consent', 'accepted', { expires: 365 }); 71 | setConsentStatus(true); 72 | }; 73 | 74 | const checkCookieConsent = () => { 75 | const consent = Cookies.get('cookie-consent'); 76 | setConsentStatus(consent === 'accepted'); 77 | }; 78 | 79 | useEffect(() => { 80 | checkCookieConsent(); 81 | }, [location.pathname]); 82 | 83 | return ( 84 | <> 85 | 86 | 87 | 88 | ); 89 | }; 90 | 91 | export default CookieConsentWrapper; 92 | -------------------------------------------------------------------------------- /src/components/ErrorBoundary.tsx: -------------------------------------------------------------------------------- 1 | import { Component, ErrorInfo, ReactNode } from 'react'; 2 | import { Navigate } from 'react-router-dom'; 3 | 4 | interface Props { 5 | children: ReactNode; 6 | } 7 | 8 | interface State { 9 | hasError: boolean; 10 | } 11 | 12 | class ErrorBoundary extends Component { 13 | constructor(props: Props) { 14 | super(props); 15 | this.state = { hasError: false }; 16 | } 17 | 18 | static getDerivedStateFromError(): State { 19 | return { hasError: true }; 20 | } 21 | 22 | componentDidCatch(error: Error, errorInfo: ErrorInfo) { 23 | console.error("Uncaught error:", error, errorInfo); 24 | } 25 | 26 | render() { 27 | if (this.state.hasError) { 28 | return ; 29 | } 30 | 31 | return this.props.children; 32 | } 33 | } 34 | 35 | export default ErrorBoundary; -------------------------------------------------------------------------------- /src/components/EvaluationBar.tsx: -------------------------------------------------------------------------------- 1 | import React, { useEffect, useState } from 'react'; 2 | import axios from 'axios'; 3 | import { motion } from 'framer-motion'; 4 | 5 | interface EvaluationBarProps { 6 | fen: string; 7 | isGameFetched: boolean; 8 | boardOrientation: 'white' | 'black'; 9 | boardHeight: number; 10 | } 11 | 12 | const EvaluationBar: React.FC = ({ 13 | fen, 14 | isGameFetched, 15 | boardOrientation, 16 | boardHeight 17 | }) => { 18 | const [evaluation, setEvaluation] = useState(null); 19 | 20 | const getWhiteHeight = (evalScore: number | null) => { 21 | if (evalScore === null) return '50%'; 22 | const normalizedEval = Math.max(-8, Math.min(8, evalScore)); 23 | const percentage = ((normalizedEval + 8) / 16) * 100; 24 | return `${percentage}%`; 25 | }; 26 | 27 | const displayEvaluation = (evalScore: number | null) => { 28 | if (evalScore === null) return '0.0'; 29 | const absEval = Math.abs(evalScore); 30 | const sign = evalScore >= 0 ? '+' : '-'; 31 | return `${sign}${absEval.toFixed(1)}`; 32 | }; 33 | 34 | useEffect(() => { 35 | if (isGameFetched && fen) { 36 | const fetchEvaluation = async () => { 37 | try { 38 | const response = await axios.post('https://chess-api.com/v1', { 39 | fen: fen, 40 | depth: 12, 41 | }); 42 | setEvaluation(response.data.eval !== undefined ? response.data.eval : null); 43 | } catch (error) { 44 | console.error('Error fetching evaluation:', error); 45 | } 46 | }; 47 | 48 | fetchEvaluation(); 49 | } 50 | }, [fen, isGameFetched]); 51 | 52 | return ( 53 |
57 | 63 |
64 |
68 |
69 |
70 | 81 | {displayEvaluation(evaluation)} 82 | 83 |
84 |
85 | ); 86 | }; 87 | 88 | export default EvaluationBar; -------------------------------------------------------------------------------- /src/components/PlayerHoverCard.tsx: -------------------------------------------------------------------------------- 1 | import { HoverCard, HoverCardTrigger, HoverCardContent } from "@/components/ui/hover-card"; 2 | import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar"; 3 | import { FaRegUser, FaExternalLinkAlt } from 'react-icons/fa'; 4 | 5 | interface Country { 6 | code: string; 7 | name: string; 8 | } 9 | 10 | interface PlayerInfo { 11 | avatar: string; 12 | url: string; 13 | name: string; 14 | followers: number; 15 | status: string; 16 | joined: number; 17 | last_online: number; 18 | country: Country; 19 | } 20 | 21 | interface PlayerHoverCardProps { 22 | username: string; 23 | playerInfo: Record; 24 | loadingPlayerInfo: Record; 25 | handleHover: (username: string) => void; 26 | } 27 | 28 | const PlayerHoverCard: React.FC = ({ username, playerInfo, loadingPlayerInfo, handleHover }) => { 29 | return ( 30 | 31 | 32 | handleHover(username)} 35 | > 36 | {username} 37 | 38 | 39 | 40 | 41 | {loadingPlayerInfo[username] ? ( 42 |

Loading...

43 | ) : ( 44 | playerInfo[username] ? ( 45 |
46 |
47 | 48 | 49 | 50 | 51 |
52 |

Country:

53 |
54 | {playerInfo[username]?.country.name} 55 | 56 | {playerInfo[username]?.country.name} 61 |
62 |
63 |
64 |
65 |

66 | Followers: {playerInfo[username]?.followers || 'Not Available'} 67 |

68 |

69 | Status: {playerInfo[username]?.status || 'Not Available'} 70 |

71 |

72 | Joined: {playerInfo[username]?.joined 73 | ? new Date((playerInfo[username]?.joined ?? 0) * 1000).toLocaleDateString() 74 | : 'Not Available'} 75 |

76 |

77 | Last Online: {playerInfo[username]?.last_online 78 | ? new Date((playerInfo[username]?.last_online ?? 0) * 1000).toLocaleString() 79 | : 'Not Available'} 80 |

81 | 87 | Chess.com Profile 88 | 89 | 90 |
91 |
92 | ) : ( 93 |

No information available

94 | ) 95 | )} 96 |
97 |
98 | ); 99 | }; 100 | 101 | export default PlayerHoverCard; -------------------------------------------------------------------------------- /src/components/ShareGamepopup.tsx: -------------------------------------------------------------------------------- 1 | import React, { useState, useEffect } from 'react'; 2 | import axios from 'axios'; 3 | import { motion } from 'framer-motion'; 4 | import { FaTimes, FaChess, FaPlay, FaEye } from 'react-icons/fa'; 5 | 6 | interface Game { 7 | id: number; 8 | title: string; 9 | timestamp: string; 10 | verdict: string; 11 | } 12 | 13 | const ShareGamePopup: React.FC = () => { 14 | const [games, setGames] = useState([]); 15 | const [selectedGame, setSelectedGame] = useState(null); 16 | const [title, setTitle] = useState(''); 17 | const [preview, setPreview] = useState(null); 18 | 19 | useEffect(() => { 20 | // Fetch recent games to populate dropdown 21 | axios.get('/api/recent-games') // Adjust the endpoint as needed 22 | .then(response => { 23 | setGames(response.data.games); 24 | }) 25 | .catch(error => { 26 | console.error('Error fetching recent games:', error); 27 | }); 28 | }, []); 29 | 30 | const handleSubmit = () => { 31 | if (selectedGame && title) { 32 | axios.post('/api/share-game', { gameId: selectedGame, title }) 33 | .then(() => { 34 | alert('Game shared successfully!'); 35 | // Reset form 36 | setSelectedGame(null); 37 | setTitle(''); 38 | setPreview(null); 39 | }) 40 | .catch(error => { 41 | console.error('Error sharing game:', error); 42 | }); 43 | } else { 44 | alert('Please select a game and enter a title.'); 45 | } 46 | }; 47 | 48 | const handleTitleChange = (e: React.ChangeEvent) => { 49 | const input = e.target.value; 50 | if (input.length <= 120) { 51 | setTitle(input); 52 | } 53 | }; 54 | 55 | const handlePreview = () => { 56 | if (selectedGame) { 57 | const game = games.find(game => game.id === selectedGame); 58 | setPreview(game || null); 59 | } else { 60 | alert('Please select a game to preview.'); 61 | } 62 | }; 63 | 64 | return ( 65 | 71 | 77 |
78 |

79 | 80 | Share Your Game 81 |

82 | 88 |
89 |
90 |
91 | 92 | 105 |
106 |
107 | 108 |