Skip to content

Repository files navigation

Sports-Hub Application Back-End

Project Description

This is a draft pet project for testing Generative AI on different software engineering tasks. It is planned to evolve and grow over time. Specifically, this repo will be a Ruby on Rails playground.

The application's legend is based on the sports-hub application description from the following repo: Sports-Hub.

Available Front-End applications

Dependencies

  • Docker
  • Docker Compose

The mentioned dependencies can be installed using the official documentation here. Read more about alternatives to Docker here.

Setup and Running the Application

Clone the Repositories

To run the web application with the React front-end, clone the following repositories within the same folder:

git clone git@github.com:dark-side/sports_hub_ruby_skeleton.git
git clone git@github.com:dark-side/sports_hub_react_skeleton.git
git clone git@github.com:dark-side/api_docs_genai_playground.git

Run Docker Compose

Navigate to the back-end application directory and run (-d for detached mode to run in the background):

docker compose up -d

Attach to the Backend Container

Run docker ps and copy the backend application container ID. Then, connect to the container with the following command:

docker exec -ti <CONTAINER ID> /bin/bash

Reset the Database

Inside the backend application container, run the following command to reset the database if needed:

bundle exec rails db:reset

Running on Windows (Tips & Tricks)

While running the App on Windows 11 using WSL, you may face issues related to Unix-style line endings (especially if you are storing the project(s) under the host machine filesystem, not the WSL one (e.g., the project is cloned to the disc c: or any other disk you have instead of being cloned to the WSL filesystem). Working within the WSL filesystem is a best practice when developing on Windows, as it helps prevent line ending and permission issues that can arise when using the Windows filesystem. I'm just reminding you that this will save you time and headaches for future projects.

If you are still reading this, please ensure your host machine converts related script(s) to Unix-style line endings.

# Install dos2unix if not already installed
sudo apt-get install dos2unix

# Convert all files in the project directory to Unix-style line endings
find . -type f -exec dos2unix {} \;

# Convert one file (example)
dos2unix bin/docker-entrypoint

Also, if you face issues with bin directory files not being executable, you can fix it with the following commands:

# check current permissions on the file
ls -l bin/docker-entrypoint

# ensure the file is executable
chmod +x bin/docker-entrypoint

Accessing the Application

To access the application in a browser locally, open the following URL:

  • Mac, Linux - http://localhost:3000/
  • Windows - http://127.0.0.1:3000/

License

Licensed under either of

Just to let you know, at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in your work, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Should you have any suggestions, please create an Issue for this repository

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

4 watching

Forks

Releases

Packages

Used by

Contributors

Languages