{"id":17930959,"url":"https://github.com/ayush272002/fightlinx","last_synced_at":"2026-04-07T08:01:29.645Z","repository":{"id":259552675,"uuid":"873063808","full_name":"Ayush272002/Fightlinx","owner":"Ayush272002","description":"This is a MMA website on which fighters can register and look for a match. The matchmaking algorithm runs a KNN algorithm for matchmaking.","archived":false,"fork":false,"pushed_at":"2024-10-25T06:52:50.000Z","size":2162,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-03T10:28:40.975Z","etag":null,"topics":["aws","cicd","docker","expressjs","kafka","monorepo","nextjs","nginx","nodejs","postgresql","prisma","redis-pubsub","turborepo"],"latest_commit_sha":null,"homepage":"https://fightlinx.vercel.app","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Ayush272002.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-15T14:39:11.000Z","updated_at":"2024-10-25T06:52:53.000Z","dependencies_parsed_at":"2024-10-26T13:07:15.559Z","dependency_job_id":"da0e4db3-ef7b-49c9-a626-f0e61f73d6ed","html_url":"https://github.com/Ayush272002/Fightlinx","commit_stats":null,"previous_names":["ayush272002/fightlinx"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Ayush272002/Fightlinx","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ayush272002%2FFightlinx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ayush272002%2FFightlinx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ayush272002%2FFightlinx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ayush272002%2FFightlinx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Ayush272002","download_url":"https://codeload.github.com/Ayush272002/Fightlinx/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ayush272002%2FFightlinx/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31504897,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-07T03:10:19.677Z","status":"ssl_error","status_checked_at":"2026-04-07T03:10:13.982Z","response_time":105,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","cicd","docker","expressjs","kafka","monorepo","nextjs","nginx","nodejs","postgresql","prisma","redis-pubsub","turborepo"],"created_at":"2024-10-28T21:18:48.021Z","updated_at":"2026-04-07T08:01:29.620Z","avatar_url":"https://github.com/Ayush272002.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Fightlinx\n\nThis is a MMA website on which fighters can register and look for a match. The matchmaking algorithm runs a KNN algorithm for matchmaking.\n\nDeployed version - https://fightlinx.vercel.app\n\nTest credentials for signin\nemail - amanda.nunes@fighter.com\npassword - Test@1234\n\n## Tech Stack\n\n#### Frontend\n- Next.js\n- React.js\n- Storybook\n- ShadCN\n- MUI\n- Typescript\n\n#### Backend\n- Node.js\n- Express.js\n- Tensorflow.js\n- Kafka\n- Redis Pub/Sub\n- Prisma ORM (for postgreSQL db)\n\n#### DevOps\n- Docker\n- Github CI/CD\n- AWS\n\n## What's inside?\n\nThis Turborepo includes the following packages/apps:\n\n### Apps and Packages\n\n- `frontend`: a [Next.js](https://nextjs.org/) app for the fighters to register and look for opponents.\n- `admin`: another [Next.js](https://nextjs.org/) app for the admin to manage the fights (not completed it).\n- `storybook`: [React.js](https://react.dev/) app with storybbok initialised, it can be used as a react app but more specifically wanted it to test components independently using storybook.\n- `backend`: [Express.js](https://expressjs.com/) app and [esbuild](https://esbuild.github.io/) as the bundler.\n- `mm`: Runs the machine learning algorith (KNN) for find a perfect match of the fighter.\n- `@repo/db`: Initialised with [prisma](https://www.prisma.io/) and it exposes the prisma client.\n- `@repo/kafka`: Intialised with [kafkajs](https://kafka.js.org/) and it exposes the kafka client singleton.\n- `@repo/ui`: a stub React component library shared by both `frontend` and `admin` applications which includes [shadcn](https://ui.shadcn.com/) and [MUI - material ui](https://mui.com/material-ui/getting-started/) and [tsup](https://tsup.egoist.dev/) as the bundler.\n- `@repo/eslint-config`: `eslint` configurations (includes `eslint-config-next` and `eslint-config-prettier`).\n- `@repo/typescript-config`: `tsconfig.json`s used throughout the monorepo.\n- `@repo/tailwind-config`: `tailwind.config.js`s used throughout the monorepo.\n- `@repo/zodTypes`: exports the zodTypes.\n- `@repo/topics`: exports the topics/channel for kafka and redis.\n- `docker`: contains the dockerfile for the apps, which will be build in the ci/cd pipeline and then be deployed to my dockerhub and ec2 instance.\n\n### Workflow\n\nThis is how the workflow is designed\n\n![workflow](images/workflow.png)\n\nWhen the user signs-up and register for a fight the request is sent to the backend and then the backend validates the user and its figter profile. Once, validated it sends the matchmaking request in the kafka queue and subscribes on the `matchmaking` channel on the redi pub/sub which is taken out by a matchmaking processor running independently. The matchmaking algorithm uses tensorflow.js and runs a KNN algorithm to find the perfect match for the user which wanted a fight. And once the match is found the matchmaking processor puts it into the database and sends a `SUCESS` message to the backend on the `matchmaking` channel. Once the backend receives this messege it returns a 200 status code the frontend.\n\nI've chosen this architecture so that I'm not processing and running a big algorithm on the primaru backend also by following this architecture it can be easily scaled up horizontally by running multiple instances of the worker(matchmaker) easily. Which would be cost efficient rather than scaling up the whole primary backend.\n\n### Running the project locally\n\nFollow this [video](https://drive.google.com/file/d/1XDMOdq0sURbioo83CQBIiLfxFdpVI_82/view?usp=drive_link) to understand more better\n\n\nTo clone the repo run\n\n```shell\ngit clone https://github.com/Ayush272002/Fightlinx.git\ncd Fightlinx\nnpm i\nnpm run build\n```\nAfter that go to `apps/frontend` and create a .env file over there and paste this inside that\n`NEXT_PUBLIC_API_BASE_URL=http://localhost:8000`\n\nNow run the frontend\n\ngo to the frontend directory of the project and run\n```shell\ncd app/frontend\nnpm run dev\n```\n\nNow for running the backend and the mm, paste the given `docker-compose.yml` in the root dir of project and run\n\n```shell\ndocker-compose up\n```\n\n## Contributing\n\nContributions are welcome! If you have suggestions for new features, bug fixes, or improvements, please fork the repository and submit a pull request. For major changes, please open an issue first to discuss what you would like to change.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## Contact\n\nIf you have any questions or suggestions, please feel free to contact.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fayush272002%2Ffightlinx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fayush272002%2Ffightlinx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fayush272002%2Ffightlinx/lists"}