Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/code-spirit-369/the-game-db

This web application allows you to discover games by genre with detailed information fetched from the RAWG API. It features a sleek and responsive design, including a dark/light mode toggler for an optimal user experience across devices.
https://github.com/code-spirit-369/the-game-db

nextjs rawg-api shadcn-ui tailwindcss typescript

Last synced: 5 days ago
JSON representation

This web application allows you to discover games by genre with detailed information fetched from the RAWG API. It features a sleek and responsive design, including a dark/light mode toggler for an optimal user experience across devices.

Awesome Lists containing this project

README

        





Project Banner



nextdotjs
typescript
tailwindcss
shadcnui

The Game Database


Build this project step by step with a detailed tutorial on Code Spirit YouTube.

## πŸ“‹ Table of Contents

1. 🎬 [Introduction](#introduction)
2. βš™οΈ [Tech Stack](#tech-stack)
3. πŸ”‹ [Features](#features)
4. πŸš€ [Quick Start](#quick-start)
5. πŸ•ΈοΈ [Snippets (Code to Copy)](#snippets)
6. πŸ”— [Assets](#links)

## 🚨 Tutorial

This repository contains the code corresponding to an in-depth tutorial available on our YouTube channel, Code Spirit.

## βš™οΈ Tech Stack

- React.js
- Next.js
- Typescript
- TailwindCSS
- RAWG API
- ShadCN

## 🎬 Introduction

Welcome to The Game Database app! This web application allows you to discover games by genre with detailed information fetched from the RAWG API. It features a sleek and responsive design, including a dark/light mode toggler for an optimal user experience across devices.

## πŸ”‹ Features

πŸ‘‰ **Game Search by Genre**: Find and explore games based on your favorite genres.

πŸ‘‰ **Dark/Light Theme Mode**: Toggle between dark and light themes for a comfortable viewing experience.

πŸ‘‰ **Responsive Design**: Ensures a seamless experience on all devices, whether desktop, tablet, or mobile.

## πŸš€ Quick Start

Follow these steps to set up the project locally on your machine.

**Prerequisites**

Make sure you have the following installed on your machine:

- [Git](https://git-scm.com/)
- [Node.js](https://nodejs.org/en)
- [npm](https://www.npmjs.com/) (Node Package Manager)

**Cloning the Repository**

```bash
git clone https://github.com/code-spirit-369/the-game-db.git
cd the-game-db
```

**Installation**

Install the project dependencies using npm:

```bash
npm install
```

**Set Up Environment Variables**

Create a new file named `.env.local` in the root of your project and add the following content:

```env
RAWG_API_KEY=
```

Get your API key from [RAWG](https://rawg.io/).

**Running the Project**

```bash
npm run dev
```

Open [http://localhost:3000](http://localhost:3000) in your browser to view the project.

## πŸ•ΈοΈ Code Snippets

/types.ts

```typescript
interface Genre {
id: number;
name: string;
slug: string;
image_background: string;
}

interface Platform {
platform: {
id: number;
name: string;
slug: string;
};
}

interface Game {
id: number;
slug: string;
name: string;
background_image: string;
rating: number;
parent_platforms: Platform[];
genres: Genre[];
}
```

## πŸ”— Assets

Public assets used in the project can be found [here](https://drive.google.com/file/d/1etCa7Aidnv0GGrkwscWoz_rlhGr82l4w/view?usp=sharing)