• Stars
    star
    405
  • Rank 106,656 (Top 3 %)
  • Language
    Ruby
  • License
    GNU Affero Genera...
  • Created over 4 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

The codebase for Exercism's website.

Exercism

Tests Maintainability View performance data on Skylight

This is the website component of Exercism. It is Ruby on Rails app, backed by various services.

Please note: This repo is an internal repo. That means the source code is public, but we do not accept Pull Requests, we do not support the app being run locally, and we do not encourage people to fork or reuse this repository.

Setup

These are instructions to get things working locally. While you are welcome to try and follow these instructions and set up this repo on your local machine, we provide no guarantee of things working on your specific local setup.

Prerequistes

You need the following installed:

  • Ruby 3.2.1 (For other Ruby versions, change the version in the Gemfile and the .ruby-version files)
  • MySQL
  • MongoDB
  • Redis
  • AnyCable-Go
  • Docker

Mac-specific

The main dependencies can be installed via homebrew

  • brew install libgit2 cmake pkg-config anycable-go hivemind node yarn

Unix-specific

What dependencies you need to install depends on your Unix distribution.

For example, for Ubuntu you'll need to install:

sudo apt-get install software-properties-common libmariadb-dev cmake ruby-dev ruby-bundler ruby-railties

You'll also need to install nodejs and yarn.

Windows-specific

As we recommend using WSL, see the Unix-specific instructions listed above.

For information on setting up WSL, check the installation instructions.

Configure the database

Running these commands inside a mysql console will get a working database setup:

CREATE USER 'exercism'@'localhost' IDENTIFIED BY 'exercism';
CREATE DATABASE exercism_development;
ALTER DATABASE exercism_development CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
GRANT ALL PRIVILEGES ON exercism_development.* TO 'exercism'@'localhost';

CREATE DATABASE `exercism_test`;
ALTER DATABASE `exercism_test` CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
GRANT ALL PRIVILEGES ON `exercism_test`.* TO 'exercism'@'localhost';

Running local AWS

To run the app you must have a local version of AWS running. We use localstack and opensearch, and run them via Docker.

docker run -dp 3042:8080 -p 3040:4566 -p 3041:4566 localstack/localstack
docker run -dp 9200:9200 -e "discovery.type=single-node" opensearchproject/opensearch:1.1.0

Run the setup script

The following scripts configure exercism to work with your setup.

bundle install
EXERCISM_ENV=development bundle exec setup_exercism_config
EXERCISM_ENV=development bundle exec setup_exercism_local_aws

Note: you will need to do this every time you reset dynamodb, which happens when Docker is restarted.

Running the local servers

We have a Procfile which executes the various commands need to run Exercism locally.

Mac-specific

On MacOSX we recommend using hivemind to manage this, which can be installed via brew install hivemind.

To get everything started you can then run:

hivemind -p 3020 Procfile.dev

Unix-specific

On Unix systems we recommend using overmind to manage this, which can be installed using these instructions.

To get everything started you can then run:

overmind -p 3020 Procfile.dev

Windows-specific

As we recommend using WSL, see the Unix-specific instructions listed above.

For information on setting up WSL, check the installation instructions.

Rails Console

The Rails 7 console has autocomplete that can be very frustrating. To disable it, do the following:

echo 'IRB.conf[:USE_AUTOCOMPLETE] = false' >> ~/.irbrc

Code Standards

Rubocop is enforced on Pull Requests. To run it locally:

bundle exec rubocop --except Metrics

To autoupdate based on it's suggestions, add the -a flag:

bundle exec rubocop --except Metrics -a

To check the complexity of your code and ensure you're not adding things that are more complex to the codebase, run without the --except flag:

bundle exec rubocop -a

Testing

The tests can be run using:

bundle exec rails test

Git Repos

If you need to create a new Git repo for use in the tests, use the following:

mkdir /Users/iHiD/Code/exercism/website/test/repos/new-repo
cd /Users/iHiD/Code/exercism/website/test/repos/new-repo
git init --bare

cd ~
git clone file:///Users/iHiD/Code/exercism/website/test/repos/new-repo exercism-new-git-repo
cd exercism-new-git-repo
echo "{}" > config.json
git add config.json
git commit -m "First commit"
git push origin head

Solargraph

Solargraph allows for code suggestions to appear in your editor.

If you'd like to use solargraph, the gem is in the file. You need to run and set solargraph.useBundler to true in your config. I have this working well with coc-solargraph. This article was helpful for setting it up.

  • bundle exec yard gems
  • solargraph bundle

More Repositories

1

exercism

Crowd-sourced code mentorship. Practice having thoughtful conversations about code.
7,312
star
2

python

Exercism exercises in Python.
Python
1,863
star
3

cli

A Go based command line tool for exercism.org.
Go
1,267
star
4

rust

Exercism exercises in Rust.
Rust
1,191
star
5

go

Exercism exercises in Go.
Go
986
star
6

java

Exercism exercises in Java.
Java
686
star
7

elixir

Exercism exercises in Elixir.
Elixir
570
star
8

javascript

Exercism exercises in JavaScript.
JavaScript
560
star
9

ruby

Exercism exercises in Ruby.
Ruby
498
star
10

haskell

Exercism exercises in Haskell.
Haskell
450
star
11

problem-specifications

Shared metadata for exercism exercises.
Ruby
310
star
12

csharp

Exercism exercises in C#.
C#
276
star
13

c

Exercism exercises in C.
C
249
star
14

cpp

Exercism exercises in C++.
C++
226
star
15

website-copy

A repository for exercism's website's copy
HTML
198
star
16

DEPRECATED.javascript

Exercism exercises in JavaScript.
JavaScript
194
star
17

kotlin

Exercism exercises in Kotlin.
Kotlin
192
star
18

windows-installer

A project to download and install the latest version of Exercism Client for Windows depending on the architecture.
Pascal
190
star
19

v3

The work-in-progress project for developing v3 tracks
C#
170
star
20

typescript

Exercism exercises in TypeScript.
JavaScript
145
star
21

clojure

Exercism exercises in Clojure.
Clojure
144
star
22

php

Exercism exercises in PHP.
PHP
129
star
23

elm

Exercism exercises in Elm.
Elm
129
star
24

v2-website

Exercism β€” Code practice and mentorship for everyone.
Ruby
125
star
25

erlang

Exercism exercises in Erlang.
Erlang
124
star
26

scala

Exercism exercises in Scala.
Scala
115
star
27

fsharp

Exercism exercises in F#.
F#
106
star
28

swift

Exercism exercises in Swift.
Swift
101
star
29

bash

Exercism exercises in Bash.
Shell
92
star
30

ocaml

Exercism exercises in OCaml.
OCaml
91
star
31

legacy-docs

84
star
32

gleam

Exercism exercises in Gleam.
Gleam
81
star
33

common-lisp

Exercism exercises in Common Lisp.
Common Lisp
76
star
34

crystal

Exercism exercises in Crystal.
Crystal
70
star
35

abap

Exercism exercises in ABAP.
ABAP
63
star
36

julia

Exercism exercises in Julia.
Julia
61
star
37

nim

Exercism exercises in Nim.
Nim
51
star
38

dart

Exercism exercises in Dart.
Dart
50
star
39

DEPRECATED.exercism.rb

DEPRECATED. See http://github.com/exercism/cli for the new CLI.
Ruby
48
star
40

DEPRECATED.x-api

Application to serve exercism assignments
Ruby
46
star
41

emacs-lisp

Exercism exercises in Emacs Lisp.
Emacs Lisp
45
star
42

docs

Exercism's docs. View them at Exercism's website, not on GitHub.
42
star
43

racket

Exercism exercises in Racket.
Racket
39
star
44

zig

Exercism exercises in Zig.
Zig
38
star
45

pony

Exercism exercises in Pony.
Pony
38
star
46

discussions

For discussing things like future features, roadmap, priorities, and other things that are not directly action-oriented (yet).
37
star
47

powershell

Exercism exercises in Windows PowerShell.
PowerShell
35
star
48

scheme

Exercism exercises in Scheme.
Scheme
35
star
49

purescript

Exercism exercises in PureScript.
PureScript
35
star
50

hiring-frontend-developer

34
star
51

pr-commenter-action

The PR Commenter GitHub action posts comments on a PR that can vary depending on which files are being changed in the PR.
JavaScript
33
star
52

lua

Exercism exercises in Lua.
Lua
33
star
53

pharo-smalltalk

Exercism exercises in Pharo.
Smalltalk
33
star
54

delphi

Exercism exercises in Delphi Pascal.
Pascal
33
star
55

exalysis

Mentoring tool for the Go track on Exercism. Downloads students code, checks it and provides suggestions.
Go
33
star
56

DEPRECATED.rikki

A worker written in golang for automatically nitpicking exercism submissions.
Go
30
star
57

idris

Exercism exercises in Idris.
Idris
29
star
58

plsql

Exercism exercises in PL/SQL.
PLSQL
28
star
59

prolog

Exercism exercises in Prolog.
Prolog
27
star
60

elixir-analyzer

Elixir
27
star
61

perl5

Exercism exercises in Perl 5.
Perl
26
star
62

automated-analysis

An overview space for Automated Analysis on Exercism
26
star
63

sml

Exercism exercises in Standard ML.
Standard ML
24
star
64

lfe

Exercism exercises in Lisp Flavoured Erlang (LFE).
LFE
23
star
65

r

Exercism exercises in R.
R
23
star
66

gui

JavaScript
22
star
67

deprecated-mentors

Rust
22
star
68

fortran

Exercism exercises in Fortran.
Fortran
22
star
69

x86-64-assembly

Exercism exercises in x86-64 Assembly.
Assembly
22
star
70

raku

Exercism exercises in Raku
Raku
22
star
71

blog

Exercism's blog content
Shell
21
star
72

configlet

The official tool for managing Exercism language track repositories.
Nim
20
star
73

reasonml

Exercism exercises in ReasonML.
Reason
20
star
74

groovy

Exercism exercises in Groovy.
Groovy
19
star
75

red

Exercism exercises in Red.
Red
19
star
76

mips

Exercism exercises in MIPS Assembly.
Shell
19
star
77

vimscript

Exercism exercises in Vim script.
Vim Script
18
star
78

generic-track

Ruby
18
star
79

coq

Exercism exercises in Coq.
Shell
17
star
80

nix

Exercism exercises in Nix.
Shell
17
star
81

terraform

HCL
17
star
82

DEPRECATED.help.exercism.io

DEPRECATED. LEGACY. NO LONGER BEING WORKED ON.
JavaScript
17
star
83

d

Exercism exercises in D.
D
16
star
84

v2-configlet

Tool to assist in managing Exercism language tracks.
Go
16
star
85

coffeescript

Exercism exercises in CoffeeScript.
CoffeeScript
16
star
86

development-environment

Ruby
16
star
87

solidity

Exercism exercises in Solidity.
JavaScript
15
star
88

babashka

Exercism exercises in Babashka.
Clojure
14
star
89

javascript-analyzer

This is Exercism's automated analyzer for the JavaScript track.
TypeScript
14
star
90

interactive-cli-walkthrough

Ruby
13
star
91

DEPRECATED.v2-feedback

Please use https://github.com/exercism/exercism.io for reporting issues
13
star
92

ruby-analyzer

This is Exercism's automated analyzer for the Ruby track.
Ruby
13
star
93

csharp-analyzer

An analyser for C#
C#
12
star
94

cfml

Exercism exercises in CFML.
ColdFusion
12
star
95

gnu-apl

Exercism exercises in GNU APL.
APL
12
star
96

v3-beta

12
star
97

awk

Exercism exercises in AWK.
Shell
12
star
98

tracks-maintenance-dashboard

A dashboard for maintainers to understand the state of tracks
TypeScript
11
star
99

python-test-runner

Python
11
star
100

go-test-runner

Jupyter Notebook
11
star