Welcome to Code Legends, a Ruby on Rails application where users can challenge each other in coding duels. Each match generates a random challenge from a pool of existing challenges in the database, allowing users to test their coding skills in real-time. Additionally, users can connect, send friend requests, and challenge their friends to duels!
- Random Coding Duels: Face off against other users in real-time coding duels where a random challenge is picked from the database.
- Friend System: Send and accept friend requests to create a network of coding buddies.
- Challenge Friends: Once friends, you can directly challenge your friends to a coding duel.
- Real-Time Interaction: Stay engaged with live duels and notifications for friend requests or challenges.
- Leaderboard: Compete with others to top the leaderboard by winning duels.
Before setting up the project, make sure you have the following installed on your machine:
- Ruby on Rails
- PostgreSQL
For detailed instructions on installing Rails and PostgreSQL, please refer to the following files:
- RAILS_README.md – Rails installation and setup instructions.
- POSTGRES_README.md – PostgreSQL setup and configuration.
-
Clone the repository:
git clone https://github.com/giovannilentini/code_legends.git cd code_legends
-
Install dependencies:
Run the following command to install the required gems:
bundle install
-
Install JavaScript dependencies:
yarn install
-
Start redis server:
redis-server
-
PostgreSQL Setup: Follow the instructions in POSTGRES_README.md to configure your PostgreSQL database.
-
Database Migration:
After setting up PostgreSQL, run the following command to create and migrate the database:
rails db:create rails db:migrate rails db:seed
-
The first Admin must be set from the rails console (User.wher(user_id: your_user_id).update(is_admin: true))
-
Start the Rails server:
Run the following command to start the server:
rails server
-
Open your browser and go to http://localhost:3000 to start using Code Legends