Skip to content

KATO-Hiro/AtCoderQAHub

Repository files navigation

AtCoderQAHub

Represents a Q&A board for AtCoder users.

Description

It is an unoffical bulletin board of AtCoder. Contestants can easily ask questions and answers.

*** DEMO ***

Comming soon.

Features

  • View AtCoder's contest problem list
  • Ask a question for problems
  • Answer these problems
  • Vote for answers (Use a gem called Acts As Votable)

Requirement

  • Ruby 2.6+
  • Ruby on Rails 5.2+
  • RSpec
  • MySQL 8.0.16
  • Docker Desktop 19.03+

Optional

Usage

  1. Choose a problem and click "Open ▶︎" button on the right
  2. Choose a question from the list, click its link
  3. If you are logged in, you can ask a question and answer the question

Installation

Paste the following commands at a Terminal prompt.

$ git clone git@github.com:KATO-Hiro/AtCoderQAHub.git

Getting started

# Build Dockerfile
$ docker-compose build

# Create and migrate DB
docker-compose run web rails db:create
docker-compose run web rails db:migrate

# Run docker container
$ docker-compose up -d

# Run a command (ex: View rails version)
$ docker-compose run web rails --version

# Restart docker container
$ docker-compose restart

# Run RSpec
$ docker-compose exec web bin/rspec

## Note:
if "exec: \"bin/rspec\": permission denied":
$ docker-compose exec web bash
$ chmod +x bin/rspec

# Stop docker container
$ docker-compose down

For fish shell user

# Run the following command if needs.
$ cp .config/fish/functions/*.fish ~/.config/fish/functions/

# Usage
## See:
.config/fish/functions/docker_usage.fish
$ docker_usage

# Initial settings(build image and create and migrate database)
$ init

# Build Images
$ build

# Run docker container
$ start

# Run RSpec
$ run_rspec

## Note:
if "exec: \"bin/rspec\": permission denied":
$ docker-compose exec web bash
$ chmod +x bin/rspec

# Restart docker container
$ restart

# Stop docker container
$ stop

Links

AtCoder

AtCoder Problems

AtCoder Problems Information API

Readme Driven Development; RDD

Author

@KATO-Hiro

License

MIT