GithubHelp home page GithubHelp logo

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.


Exercism

Tests Maintainability View performance data on Skylight

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

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.3.0 (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. Double check versions in .dockerimages.json.

docker run -dp 3042:8080 -p 3040:4566 -p 3041:4566 localstack/localstack:2.3.2
docker run -dp 9200:9200 -e "discovery.type=single-node" opensearchproject/opensearch:2.11.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 start --port 3020 --procfile 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

Running Jest tests

Run tests:
yarn test [path/to/file]

Omit path to run all tests

Update snapshots:
yarn test [path/to/file] -- -u

Omit path to update all snapshots

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

gsoc2's Projects

apm icon apm

Elastic Application Performance Monitoring - resources and general issue tracking for Elastic APM.

apm-queue icon apm-queue

Abstraction layer over Kafka / GCP PubSub Lite to produce and consume records

apollo-server icon apollo-server

🌍  Spec-compliant and production ready JavaScript GraphQL server that lets you develop in a schema-first way. Built for Express, Connect, Hapi, Koa, and more.

apps icon apps

daily.dev application suite

appsec-internal-go icon appsec-internal-go

Shared code between all flavors of AppSec Go (in-tracer, serverless, etc...). Meant for internal use.

appshield icon appshield

Security configuration checks for popular cloud native applications and infrastructure.

assemble icon assemble

Get the rocks out of your socks! Assemble makes you fast at web development! Used by thousands of projects for rapid prototyping, themes, scaffolds, boilerplates, e-books, UI components, API documentation, blogs, building websites/static site generator, an alternative to Jekyll for gh-pages and more! Gulp- and grunt-friendly.

astexplorer icon astexplorer

A web tool to explore the ASTs generated by various parsers.

autogen icon autogen

Enable Next-Gen Large Language Model Applications. Join our Discord: https://discord.gg/pAbnFJrkgZ

aws-cli icon aws-cli

Universal Command Line Interface for Amazon Web Services

awx icon awx

AWX provides a web-based user interface, REST API, and task engine built on top of Ansible. It is one of the upstream projects for Red Hat Ansible Automation Platform.

awx-operator icon awx-operator

An Ansible AWX operator for Kubernetes built with Operator SDK and Ansible. 🤖

azaws icon azaws

Save temporary security credentials of AWS via Azure AD SSO

azure-sdk icon azure-sdk

This is the Azure SDK parent repository and mostly contains documentation around guidelines and policies as well as the releases for the various languages supported by the Azure SDK.

azure-sdk-for-python icon azure-sdk-for-python

This repository is for active development of the Azure SDK for Python. For consumers of the SDK we recommend visiting our public developer docs at https://docs.microsoft.com/python/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-python.

azure-sentinel icon azure-sentinel

Cloud-native SIEM for intelligent security analytics for your entire enterprise.

babylon.js icon babylon.js

Babylon.js is a powerful, beautiful, simple, and open game and rendering engine packed into a friendly JavaScript framework.

bashbrew icon bashbrew

Canonical build tool for the official images

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.