{"id":13415347,"url":"https://github.com/learn-awesome/learn","last_synced_at":"2025-03-14T22:33:14.554Z","repository":{"id":35764559,"uuid":"177329523","full_name":"learn-awesome/learn","owner":"learn-awesome","description":"A social network of lifelong learners built around humanity's universal learning map.","archived":true,"fork":false,"pushed_at":"2022-09-29T14:21:05.000Z","size":16295,"stargazers_count":344,"open_issues_count":92,"forks_count":41,"subscribers_count":14,"default_branch":"master","last_synced_at":"2024-10-29T21:35:43.290Z","etag":null,"topics":["community","curated-list","education","hacktoberfest","knowledge-graph","learning","learning-map","resources","skills"],"latest_commit_sha":null,"homepage":"https://learnawesome.org/","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/learn-awesome.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":"FUNDING.yml","license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"open_collective":"learnawesome"}},"created_at":"2019-03-23T19:06:50.000Z","updated_at":"2024-08-15T16:08:32.000Z","dependencies_parsed_at":"2023-01-16T05:45:25.883Z","dependency_job_id":null,"html_url":"https://github.com/learn-awesome/learn","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/learn-awesome%2Flearn","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/learn-awesome%2Flearn/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/learn-awesome%2Flearn/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/learn-awesome%2Flearn/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/learn-awesome","download_url":"https://codeload.github.com/learn-awesome/learn/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243336944,"owners_count":20275194,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["community","curated-list","education","hacktoberfest","knowledge-graph","learning","learning-map","resources","skills"],"created_at":"2024-07-30T21:00:47.423Z","updated_at":"2025-03-14T22:33:14.533Z","avatar_url":"https://github.com/learn-awesome.png","language":"HTML","funding_links":["https://opencollective.com/learnawesome"],"categories":["HTML","Happy Exploring 🤘","education"],"sub_categories":[],"readme":"# This version of the project has been deprecated. Please see [the new pure-Javascript version](https://github.com/learn-awesome/learndb) for the latest code.\n\n[![Gitpod Ready-to-Code](https://img.shields.io/badge/Gitpod-Ready--to--Code-blue?logo=gitpod)](https://gitpod.io/#https://github.com/learn-awesome/learn) \n\n# LearnAwesome\n\n[![Twitter](https://img.shields.io/badge/-Twitter-0a0a0a.svg?style=flat\u0026colorA=0a0a0a)](https://twitter.com/learn_awesome)\n\n#### Awesome learning resources organized by topics, formats and difficulty. Optimal learning paths for any topic.\n\n\u003cimg width=\"100%\" src=\"https://user-images.githubusercontent.com/19304/94602661-cbb4f380-02b2-11eb-81aa-419e4c4a53b2.png\"\u003e\n\nThis is the code that powers https://learnawesome.org\n\nThis is built using Ruby, Rails, PostgreSQL, Tailwind CSSm and AlpineJS.\n\nFor development, please come to [Slack](https://learnawesome.org/join_slack).\n\nThere are multiple ways to run this app locally:\n\n\u003cdetails\u003e\n  \u003csummary\u003eDevelop with GitPod\u003c/summary\u003e\n  \nIf you have an account with gitpod.io, you can simply visit [this URL](https://gitpod.io/#https://github.com/learn-awesome/learn) to get a complete coding environment with everything pre-configured: PostgreSQL, Ruby, NodeJS. The database will already be pre-loaded with seed data and GitPod will open the webapp in a separate browser window (make sure that popup is not blocked by your browser).\n\nAs you can see in .gitpod.yml, this will open all necessary tools in terminal: Main Rails server process, Rails console, Postgres console, Background job process etc.\n\nLearnAwesome uses Auth0 for logging-in and because GitPod gives you dynamically generated URLs, those will not be pre-approved. Therefore, login/signup in your GitPod instance will not work currently. We need to figure out a solution for this.\n\nThis is the easiest way to start hacking on and contributing to the LearnAwesome codebase.\n\u003c/details\u003e\n\n\n\u003cdetails\u003e\n  \u003csummary\u003eRun as a Docker Dev Environment\u003c/summary\u003e\n\nYou must have Docker Desktop installed with [Dev Environment](https://docs.docker.com/desktop/dev-environments/) feature supported.\n\nIn Docker Dashboard -\u003e Preferences -\u003e General, the checkbox for \"Use Docker Compose V2\" must be SWITCHED OFF.\n\nNow choose Docker Dashboard -\u003e Dev Environments -\u003e Create -\u003e Local Directory -\u003e Choose the root folder of this project.\nLaunch VS Code container for the app, open a new terminal and run `./entrypoint.sh`\nThis will set up database, run migrations, insert seed data, and start puma on port 3000 and port 8443 with HTTPS.\n\nThe config for this method is picked from `.docker/docker-compose.yaml` and not the `docker-compose.yml` in project's root directory.\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003eDevelop locally with Docker Compose\u003c/summary\u003e\n\nRun `docker compose up --build` and access on https://localhost:8443/\nThe config for this method comes from `docker-compose.yml` in project's root directory.\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003eDevelop locally with Docker\u003c/summary\u003e\n\nYou may need to put some values in `.env.dev`\n\nFirst, let's create a network so containers can find each other by name:\n\n`docker network create dev-network`\n\nIf you don't have postgres running somewhere already, install and start it:\n\n`docker run -d --name pg13dbhost --net dev-network --restart always -p 5432:5432 -v ~/pg13dbhost:/var/lib/postgresql/data -e POSTGRES_USER=learn -e POSTGRES_PASSWORD=learn -e POSTGRES_DB=learndb postgres:13.3`\n\nNote that:\n- run creates a new container from specified image\n- -d = detached/background mode\n- name will be the hostname to be used either with --link or in user-defined networks\n- --restart always will restart this container any time Docker is started, such as for a laptop reboot\n- -p 5432:5432 : will expose this postgres on your docker host\n- -v creates a volume for persisted data\n\nRedis is no longer required but if you want, you can run that as well:\n\n`docker run -d --name redis6host --net dev-network --restart always -p 6379:6379 -v ~/redis6host:/data -e REDIS_PASSWORD=learn redis:6.2.4`\n\nNow you can start the app while linking to these containers and overriding some environment variables:\n\n```\ndocker build -t learnawesome .\ndocker run -it -p 8443:8443 --env-file .env.dev --net dev-network --link pg13dbhost:pg13dbhost --link redis6host:redis6host -e DATABASE_HOST=pg13dbhost -e AUTH0_DOMAIN=learnawesomedev.eu.auth0.com -e AUTH0_PUBKEY=pubkey -e AUTH0_PRIVKEY=privkey learnawesome\n```\n\nUsing `docker-compose.yml`, the above two commands can also be run by:\n\n`DATABASE_HOST=pg13dbhost AUTH0_DOMAIN=learnawesomedev.eu.auth0.com AUTH0_PUBKEY=pubkey AUTH0_PRIVKEY=privkey docker compose up --build`\n\nNow, the app can be accessed at https://localhost:8443\n\nIn production, port 8443 will not be exposed and therefore, SSL proxy over port 3000 will be needed.\n\n\nTo get shell access in the container, run `docer exec -it \u003ccontainer_name\u003e /bn/bash`. All the environment variables will be already set so commands like `rails console` or `rake db:seed` can be run easily.\n\n\u003c/details\u003e\n\n\n\n\n\u003cdetails\u003e\n    \u003csummary\u003eLocal install\u003c/summary\u003e\n\n```\nbundle install\nrake db:drop db:create db:migrate db:seed\n```\n\nTo import some data:\n```\nrake import:import['public/data1.json'] \nrake import:import['public/data2.json'] \nrake mrb:import_experts\n```\n\nSet-up caching in dev:\n`rails dev:cache`\n\nSet up SSL certificate for local development. See [this article](https://dev.to/matayoshimariano/how-to-add-ssl-to-your-localhost-development-environment-using-ruby-on-rails-with-puma-14di)\n\nStart the app with some secrets:\n```\n# These two lines are not needed in local development unless you're testing ActivityPub flows\nexport ACTIVITYPUB_PRIVKEY=`cat private.pem`\nexport ACTIVITYPUB_PUBKEY=`cat public.pem`\n\nSECRET_KEY_BASE= AUTH0_DOMAIN= AUTH0_PUBKEY= AUTH0_PRIVKEY= bundle exec puma\n\nThe app can be accessed at https://localhost:8443/ \n\nDon't use http://localhost:3000/ for local development because it leads to weird issues with SameSite, non-Secure cookies\n\nEither use your own Auth0 tenant (which needs some configuration) or contact us to get the values of the above environment variables.\n```\n\nFor GraphQL clients, first send the user to https://learnawesome.eu.auth0.com/login?client=h5wMQw9p9MsN53nkY4YeN08mv3Ao1mnB\u0026protocol=oauth2\u0026response_type=token%20id_token\u0026redirect_uri=http://localhost:3000/callback\u0026scope=openid%20profile\n\nAfter successful login/signup, `user.authinfo` will have a field called `id_token`.\nThe value of that token can be used as the `Authorization` header with `Bearer` prefix. This ensures that user can only perform permitted operations via graphQL api.\n\n# Testing\n\nWe have starting adding automated Browser testing via Capybara.\n\n```\n# To setup browser for automated selenium testing\nbundle exec rake webdrivers:chromedriver:update\n```\n\nThen:\n\n`bin/rails test:system`\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n    \u003csummary\u003eProduction Environment\u003c/summary\u003e\n\nWe use CapRover to deploy LearnAwesome on a web app. A postgresql instance is already provided by the platform, so we only need to run the app container (defined in `Dockerfile`). This is specified in `captain-definition` file in the project root directory.\n\u003c/details\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flearn-awesome%2Flearn","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flearn-awesome%2Flearn","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flearn-awesome%2Flearn/lists"}