/Graux

Aux battles for the web

Primary LanguageTypeScript

Graux

Aux Battles For The Web

Application Live At https://graux-sage.vercel.app

Introduction

An Aux battle is a music competition between 2 or more people. Typically a 1v1 or 1v1 bracket. Graux is a web application which let's you create aux battles with your friends.

Main features:

  • Create Battles specifying how long the battle should run
  • Query Battles created in the platform with sort,search and pagination
  • Query Users of the platform with sort , search and pagination
  • Login/Register with jwt
  • Send request to people to join your battle
  • Choose song for your battle
  • Liking/Disliking Battle
  • Vote for a user in a battle
  • Comment in a Battle
  • Determine Winner of the battle
  • Check Profile of a user
  • Manage your Battles

Technologies Used

The server is a Graphql server made with Nodejs and Apollo Server .
It uses Postgresql as database with Typeorm as orm .
The code for the Server is located at src directory in the root folder.

The Frontend is based on Next.js
Communication with the graphql server is done with Apollo Client
It uses Chakra UI for styling
The code for the Frontend is located at client directory in the root folder.

Running The Project Locally

First you have to clone this directory . Now to run the backend , on the root directory run

npm install

Next , create .env file in the root directory
The file should look like this .

NODE_ENV="development"
PORT="3000"

DATABASE_PORT="5432"
DATABASE_TYPE="postgres"

DATABASE_HOST=""
DATABASE_USERNAME=""
DATABASE_PASSWORD=""
DATABASE_NAME=""

LOCAL_DATABASE_HOST=""
LOCAL_DATABASE_USERNAME=""
LOCAL_DATABASE_PASSWORD=""
LOCAL_DATABASE_NAME=""

ACCESS_TOKEN_SECRET=""
REFRESH_TOKEN_SECRET=""
LAST_FM_API_KEY=""

Fill the blank strings with the necessary value. If you wanna run this project locally then fill the local database fields and if u have a postgres instance running somewhere then fill the database fields.

Now on the root folder , run

npm run dev

The server should start at http://localhost:3000/

Now to run the frontend go to the client folder in the root directory There , u have to run

npm install

Next Create a .env.local file at client/.env.local
File should look like this

NEXT_PUBLIC_LAST_FM_API_KEY=

Add a last fm api key here . This will be used for music metadata . More info at here

Now on the client folder , run

npm run dev

The web app should start at http://localhost:5000/

Seeding the database

To fill the database with dummy data , Just go to the root directory .
Then run

npm run seed

Screenshots

Battles page

Battles Page

Individual Battle page

Individual Battle

Comments

Comments

Choose song

Choose song

Manage Battle Page

Manage Battle Page

User Profile Page

User Profile Page

Users Page

Users Page

Approve Battle Request Page

Approve Battle Request Page

Login Page

Login Page

Todos

  • User Image Upload
  • Password Change
  • Edit User
  • Daily/Weekly/Monthly leaderboards
  • removing @ts-ignores and using es-lint