Skip to content

GameHub offers a platform where you can explore and connect. Created with Next.js, Typescript, Radix UI and more!

License

Notifications You must be signed in to change notification settings

V-Mokhun/GameHub

Repository files navigation

GameHub

MIT License LinkedIn


Logo

GameHub is your one-stop destination for everything gaming. Whether you're an avid gamer or just starting your journey, GameHub offers a platform where you can explore, connect, and conquer.

View Site · Report Bug · Request Feature

Table of Contents
  1. About The Project
  2. Getting Started
  3. Contributing
  4. License
  5. Contact

About The Project

Home Screenshot

🎮 Discover Games: Dive into a vast collection of games from various genres, categories, and themes. Our curated selection ensures you never miss the next gaming masterpiece.

📊 Track Your Progress: Stay on top of your gaming achievements with our progress tracking system. You can watch your gaming journey unfold in real-time.

👥 Connect with Friends: Finding like-minded gamers is a breeze on GameHub. Connect with friends, see their library and write your own game reviews.

(back to top)

Built With

  • Next For Server Side Rendering
  • TypeScript For Type Safety
  • Clerk For Authentication
  • ReactHookForm For Form Handling
  • Zod For Form Validation
  • ReactQuery For Data Fetching
  • Zustand For State Management
  • TailwindCSS With RadixUI For UI Components
  • Pusher For Realtime Chat
  • Prisma For Database
  • PlanetScale For Database Hosting
  • Vercel For Hosting

(back to top)

Challenges

  • One of the challenges I faced was finding out how to fetch the IGDB Api correctly, which included using axios interceptors to keep the token updated, Next.js rewrites to avoid proxy issues and writing custom functions to create body for requests.
  • Another challenge was to handle the data from IGDB Api, which was not always consistent and required a lot of data manipulation.
  • It was also challenging to handle the cache correctly, when and how to invalidate it, how to use it with realtime chat and how to use it with IGDB Api.
  • Another challenge was to implement import from Steam, which required a lot of research and testing. I had to find a way to get the user's Steam games, then find a way to get the game's data from IGDB Api and then find a way to import it into the database.
  • Lastly, it was challenging to implement the realtime chat, which required a lot of research and testing. Especially, I tried to implement infinite scroll for messages, but it was not working correctly with the cache, so I had to abandon it.

(back to top)

Future Plans

In the future I plan to:

  • Write tests with probably playwright

(back to top)

Getting Started

To get a local copy up and running follow these simple example steps.

Running the app

  1. Clone the repo
    git clone https://github.com/v-mokhun/gamehub.git .
  2. Install NPM packages
    npm install
  3. Run the app (Will not work without environment variables)
    npm run dev

Environment Variables

  1. Create a .env file in the root of the project and copy all contents from .env.example file.
  2. Register on Clerk and create a new application, then grab your publishable key and secret key. Then go to webhooks and grab your webhook secret. For local testing you can use ngrok to create a tunnel to your localhost. Important: make sure to add your ngrok url to the webhook url in Clerk.
  3. In Clerk Dashboard go to Users & Authentication -> Social Connections and enable Google, GitHub and Twitch. Here is an detailed guide on how to do it.
  4. Register on Twitch and create a new application, then grab your client id and client secret and as OAuth Redirect URLs insert your Clerk OAuth Callback.
  5. Register on PlanetScale and create a new database, then grab your database url by clicking on Connect button.
  6. Register on Pusher and create a new channel, then grab your app id, key, secret and cluster.
  7. Register on Cloudinary and grab your cloud name. Furthermore, you will need to create a new preset and make it unsigned and also put its name in .env file. You can also use your own image hosting service, just make sure to change the code accordingly.
  8. Go to Steam and grab your api key.
  9. Go to RapidAPI and register if needed, then grab your api key for image moderation.
  10. For tests to work properly, create test user and fill in the username and password in .env file

(back to top)

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

(back to top)

License

Distributed under the MIT License. See LICENSE.txt for more information.

(back to top)

Contact

Telegram

LinkedIn

Project Link: https://gamehub-proj.vercel.app

(back to top)

About

GameHub offers a platform where you can explore and connect. Created with Next.js, Typescript, Radix UI and more!

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages