diff --git a/.travis.yml b/.travis.yml index 3011b100f..08675c621 100644 --- a/.travis.yml +++ b/.travis.yml @@ -50,4 +50,5 @@ notifications: slack: on_pull_requests: false on_success: always - secure: WzJFZxMyylShlK4p8hfWl1yrsTPTikiLjjNz+8TtV3jeNsUe4e8ytjYwojRL8ViRUrbfCFetnRlI/gsIGbgAPzjLkmlTWGdErNSt0TlIRDg9xuqagOmcQqBSqt7XBRn3pLSWaTDxvs29LAF+EZndFcAur+SMNbW1NvDM4ctLtTDrvyaGP+FMFaOREQebIY9ilDtD+1ZjoUtLObOEg16gRAfeA9kWoCl4JJPl0jAbxb58jrpNxusK3dt0kEY19hbmQjfhclAMIKDtz1O8JEQt5O7+GtLhwnOH73nE9Tn7EwjA2qHg287qtFY5wQpWlaTu3OkJD5GK2Woj9XaFcAoLZFz1F0SPqs0NoLV1ItwAPk7pZr/8cYPp/55P+P0ATv7VGr94CSsCAa0BQpztVSDNHv6A0iIETr1VMlDtkxY/Nddo6Fddmn7KBMbunoHDJ2a7y0Dj4gNxU2xOd44VZLZcJ2UWP/eh1ESTNxwj4snFDR30R/dnJyEwFXIzEtkuwCeCvKtGNPWIU+gn1UdbZ2sI28jqkuqiXEHmWY+IbZqIxHCxxiwtpQ4h5af6xysmkNqD78vBU/lqWDMkO10J4itoNgm5RxVb1CZx97MEd9i5frNmw+86acuT77olRv3/XVLoad58awUGQYgF1SxSQjDSndGbeLfCm5GwVsIae2aUYpY= + rooms: + secure: dLMY/PKYoMCYrb2TL5mr9V4vMmnFFPSaKaUUl6G+7qrWpBLeB8FS+MNUB2XdvA5EGqS9vRdr72gUMdMnhoHtPMZgzHxxStjUB9oTBlg18WoLaIRpg0hjcgV4SfTsn7KisdSPgG3Wc0fnmIK9sf6j5oMLE6Lt6/6ANce7PurCPVm/UFo5djlyCaPDmgxhbXfzRJEbnJTiSiswwxzELsaJtZ3d+lu/OfZfo59pGk18C5AKX+sLN529q8MHaM0a66zGS06WwQC91pq9YsNNN7c2S7qOl/OJgaXFEa3+ZqiyEkE5T1GNrPTYyju798B6n8BkXTRkKrEAl8qMCsgkCwiyz204e7LwHACze3d4rGynxxA/0UqHEnWTGdWDuMmZ6Sxp1SfJVc6dZGR2bzYE8gqQGs0dpoUQjvDVwiELZWYNUCkJUQl/1ahEcXSuGfH8fMiqYXkNZKUc+8rMO+Q9EVRuf0xMb6QD6yLtgWzXx6tpotIP1KouwDVFHVcEkZScKj2jXaguCDeaCUiOwc7BsL1shoDRixytCbM6BLpZzKL82vyRAWoDwMF1V5JezLow/l6BF78xXqBkw0TfBzAO923xUKDFjRUZwaEeSYwUdLTOyDgRx290JWDCy3oLcwTtskWJzGVlnnlpId7XfUv1UiGW13W60OWu2PvUKkK5WRtnPbE= diff --git a/README.md b/README.md index 0c3ec52c0..d6fc674a5 100644 --- a/README.md +++ b/README.md @@ -34,38 +34,41 @@ Welcome to the [dev.to](https://dev.to) codebase. We are so excited to have you. With your help, we can build out DEV to be more stable and better serve our community. ## What is dev.to? -[dev.to](https://dev.to) (or just DEV) is a platform where software developers write articles, take part in discussions, and build their professional profiles. We value supportive and constructive dialogue in the pursuit of great code and career growth for all members. The ecosystem spans from beginner to advanced developers, and all are welcome to find their place within our community. ❤️ + +[dev.to](https://dev.to) (or just DEV) is a platform where software developers write articles, take part in discussions, and build their professional profiles. We value supportive and constructive dialogue in the pursuit of great code and career growth for all members. The ecosystem spans from beginner to advanced developers, and all are welcome to find their place within our community. ❤️ ## Table of Contents -- [Contributing](#contributing) - - [Where to contribute](#where-to-contribute) - - [How to contribute](#how-to-contribute) - - [Contribution guideline](#contribution-guideline) - - [Clean code with tests](#clean-code-with-tests) - - [Create a pull request](#create-a-pull-request) - - [Creating an issue](#create-an-issue) - - [How to get help](#how-to-get-help) - - [The bottom line](#the-bottom-line) -- [Codebase](#codebase) - - [The stack](#the-stack) - - [Engineering standards](#engineering-standards) - - [Style guide](#style-guide) - - [Husky hooks](#husky-hooks) -- [Getting Started](#getting-started) - - [Prerequisites](#prerequisites) - - [Installation](#installation) - - [Starting the application](#starting-the-application) - - [Suggested Workflow](#suggested-workflow) -- [Additional docs](#additional-docs) -- [Product Roadmap](#product-roadmap) -- [Core Team Members](#core-team) -- [License](#license) +* [Contributing](#contributing) + * [Where to contribute](#where-to-contribute) + * [How to contribute](#how-to-contribute) + * [Contribution guideline](#contribution-guideline) + * [Clean code with tests](#clean-code-with-tests) + * [Create a pull request](#create-a-pull-request) + * [Create an issue](#create-an-issue) + * [How to get help](#how-to-get-help) + * [The bottom line](#the-bottom-line) +* [Codebase](#codebase) + * [The stack](#the-stack) + * [Engineering standards](#engineering-standards) + * [Style guide](#style-guide) + * [Husky hooks](#husky-hooks) +* [Getting Started](#getting-started) + * [Prerequisites](#prerequisites) + * [Installation](#installation) + * [Starting the application](#starting-the-application) + * [Suggested Workflow](#suggested-workflow) +* [Additional docs](#additional-docs) +* [Product Roadmap](#product-roadmap) +* [Core Team Members](#core-team) +* [License](#license) ## Contributing + We expect contributors to abide by our underlying [code of conduct](https://dev.to/code-of-conduct). All conversations and discussions on GitHub (issues, pull requests) and across dev.to must be respectful and harassment-free. ### Where to contribute + When in doubt, ask a [core team member](#core-team)! You can mention us in any issues or ask on the [DEV Contributor thread](https://dev.to/devteam/devto-open-source-helpdiscussion-thread-v0-1l45). Any issue with `good first issue` tag is typically a good place to start. **Refactoring** code, e.g. improving the code without modifying the behavior is an area that can probably be done based on intuition and may not require much communication to be merged. @@ -75,23 +78,27 @@ When in doubt, ask a [core team member](#core-team)! You can mention us in any i **Building features** is the area which will require the most communication and/or negotiation. Every feature is subjective and open for debate. The [product roadmap](https://github.com/thepracticaldev/dev.to/projects) should be a good guide to follow. As always, when in doubt, ask! ### How to contribute -1. Fork the project & clone locally. Follow the initial setup [here](#getting-started). -2. Create a branch, naming it either a feature or bug: `git checkout -b feature/that-new-feature` or `bug/fixing-that-bug` -3. Code and commit your changes. Bonus points if you write a [good commit message](https://chris.beams.io/posts/git-commit/): `git commit -m 'Add some feature'` -4. Push to the branch: `git push origin feature/that-new-feature` -5. [Create a pull request](#create-a-pull-request) for your branch 🎉 -### Contribution guideline +1. Fork the project & clone locally. Follow the initial setup [here](#getting-started). +2. Create a branch, naming it either a feature or bug: `git checkout -b feature/that-new-feature` or `bug/fixing-that-bug` +3. Code and commit your changes. Bonus points if you write a [good commit message](https://chris.beams.io/posts/git-commit/): `git commit -m 'Add some feature'` +4. Push to the branch: `git push origin feature/that-new-feature` +5. [Create a pull request](#create-a-pull-request) for your branch 🎉 + +## Contribution guideline ### Create an issue + Nobody's perfect. Something doesn't work? or could be done better? Let us know by creating an issue. PS: a clear and detailed issue gets lots of love, all you have to do is follow the issue template! #### Clean code with tests + Some existing code may be poorly written or untested, so we must have more scrutiny going forward. We test with [rspec](http://rspec.info/), let us know if you have any questions about this! #### Create a pull request + * Try to keep the pull requests small; a pull request should try its very best to address only a single concern. * Make sure all tests pass and add additional tests for the code you submit. * Document your reasoning behind the changes. Explain why you wrote the code in the way you did; the code should explain what it does. @@ -101,72 +108,72 @@ Some existing code may be poorly written or untested, so we must have more scrut _Please note: all commits in a pull request will be squashed when merged, but when your PR is approved and passes our CI, it will be live on production!_ ### How to get help + Whether you are stuck with feature implementation, first-time setup, or you just want to tell us something could be done better, check out our [OSS thread](https://dev.to/devteam/devto-open-source-helpdiscussion-thread-v0-1l45) or create an issue. You can also mention any [core team member](#core-team) in an issue and we'll respond as soon as possible. ### 👉 [OSS Help/Discussion Thread](https://dev.to/devteam/devto-open-source-helpdiscussion-thread-v0-1l45) 👈 ### The bottom line + We are all humans trying to work together to improve the community. Always be kind and appreciate the need for tradeoffs. ❤️ ## Codebase ### The stack + We run on a Rails backend with mostly vanilla JavaScript on the front end, and some Preact sprinkled in. One of our goals is to move to mostly Preact for our front end. Additional technologies and services are listed on [our docs](https://docs.dev.to). ### Engineering standards + #### Style Guide + This project follows [thoughtbot's Ruby Style Guide](https://github.com/thoughtbot/guides/blob/master/style/ruby/.rubocop.yml), using [Rubocop](https://github.com/bbatsov/rubocop) along with [Rubocop-Rspec](https://github.com/backus/rubocop-rspec) as the code analyzer. If you have Rubocop installed with your text editor of choice, you should be up and running. For Javascript, we follow [Airbnb's JS Style Guide](https://github.com/airbnb/javascript), using [ESLint](https://eslint.org) and [prettier](https://github.com/prettier/prettier). If you have ESLint installed with your text editor of choice, you should be up and running. #### Husky hooks + When commits are made, a git precommit hook runs via [husky](https://github.com/typicode/husky) and [lint-staged](https://github.com/okonet/lint-staged). ESLint, prettier, and Rubocop will run on your code before it's committed. If there are linting errors that can't be automatically fixed, the commit will not happen. You will need to fix the issue manually then attempt to commit again. Note: if you've already installed the [husky](https://github.com/typicode/husky) package at least once (used for precommit npm script), you will need to run `yarn --force` or `npm install --no-cache`. For some reason, the post-install script of husky does not run when the package is pulled from yarn or npm's cache. This is not husky specific, but rather a cached package issue. ## Getting Started +This section provides a high-level requirement & quick start guide. For detailed installations, please check out our [docs](http://docs.dev.to/installations). + ### Prerequisites -These prerequisites assume you are running macOS. If you are running a different OS, you should install these prerequisites specific to your OS. -* Ruby: we recommend using [rbenv](https://github.com/rbenv/rbenv) to install the Ruby version listed on the badge. -* Bundler: `gem install bundler` -* Foreman: `gem install foreman` -* Yarn: use `brew install yarn` to install yarn. It will also install node if you don't already have it. -* PostgreSQL: the easiest way to get started with this is to use [Postgres.app](https://postgresapp.com/). - -### Linux pre-requisites (based on Ubuntu 18.04) -These prerequisites assume you're working on a Linux-based operating system but have been written by an Ubuntu 18.04 user so they may not work on all distributions. - -* Ruby: As recommended, [rbenv](https://github.com/rbenv/rbenv) should be used to install the Ruby version listed on the badge. Very detailed directions for rbenv installation for several distros can be found [here](https://www.digitalocean.com/community/tutorials/how-to-install-ruby-on-rails-with-rbenv-on-ubuntu-18-04). -* Bundler: `gem install bundler` -* Foreman: `gem install foreman` -* Yarn: There are two ways to install Yarn. - 1. Found [here](https://yarnpkg.com/en/docs/install#debian-stable) - 2. [This](https://www.digitalocean.com/community/tutorials/how-to-install-node-js-on-ubuntu-18-04) post describes how to install [NVM](https://github.com/creationix/nvm) a Node version manager. By installing NVM you can select a Node version (I would suggest either LTS or current), the guide will also explain how to install NPM. This way you'll have Node, NPM, and then you can run `npm install -g yarn` to install Yarn. -* PostgreSQL: For Ubuntu run `sudo apt update && sudo apt install postgresql postgresql-contrib libpq-dev`. To test the installation you can run `sudo -u postgres psql` which should open a PostgreSQL prompt. Exit the prompt by running `\q` then run `sudo -u postgres createuser -s $YOUR_USERNAME` where $YOUR_USERNAME is the username you are currently logged in as. Lastly, at least on Debian based systems, in the codebase under /config/database.yml you'll want to comment out the `host: localhost` to configure the database to use Unix domain sockets as outlined [here](https://stackoverflow.com/questions/23375740/pgconnectionbad-fe-sendauth-no-password-supplied). +* [Ruby](https://www.ruby-lang.org/en/): we recommend using [rbenv](https://github.com/rbenv/rbenv) to install the Ruby version listed on the badge. +* [Yarn](https://yarnpkg.com/): please refer to their [installation guide](https://yarnpkg.com/en/docs/install). +* [PostgreSQL](https://www.postgresql.org/) 9.4 or higher. ### Installation -1. `git clone git@github.com:thepracticaldev/dev.to.git` -2. `bundle install` -3. `bin/yarn` -4. Set up your environment variables/secrets - * Take a look at `Envfile`. This file lists all the `ENV` variables we use and provides a fake default for any missing keys. You'll need to get your own free [Algolia credentials](http://docs.dev.to/get-api-keys-dev-env/#algolia-(choose-oauth-or-email-sign-up)) to get your development environment running. + +0. Make sure all the prerequisites are installed. +1. Fork dev.to repository, ie. https://github.com/thepracticaldev/dev.to/fork +1. Clone your forked repository, ie. `git clone https://github.com//dev.to.git` +1. `gem install bundler` +1. `gem install foreman` +1. `bundle install` +1. `bin/yarn` +1. Set up your environment variables/secrets + * Take a look at `Envfile`. This file lists all the `ENV` variables we use and provides a fake default for any missing keys. You'll need to get your own free [Algolia credentials](http://docs.dev.to/get-api-keys-dev-env/#algolia) to get your development environment running. * This [guide](http://docs.dev.to/get-api-keys-dev-env/) will show you how to get free API keys for additional servies that may be required to run certain parts of the app. * For any key that you wish to enter/replace: - 1. Create `config/application.yml` by copying from the provided template (`cp config/sample_application.yml config/application.yml`). This is a personal file that is ignored in git. - 2. Obtain the development variable and apply the key you wish to enter/replace. ie: + 1. Create `config/application.yml` by copying from the provided template (ie. with bash: `cp config/sample_application.yml config/application.yml`). This is a personal file that is ignored in git. + 2. Obtain the development variable and apply the key you wish to enter/replace. ie: ``` - GITHUB_KEY: "afaslkjdflkj2398jflskdjfljk" - GITHUB_SECRET: "23r8dcvlk23jekljfslkdfjlks" + GITHUB_KEY: "SOME_REAL_SECURE_KEY_HERE" + GITHUB_SECRET: "ANOTHER_REAL_SECURE_KEY_HERE" ``` * If you are missing `ENV` variables on bootup, `envied` gem will alert you with messages similar to `'error_on_missing_variables!': The following environment variables should be set: A_MISSING_KEY.`. * You do not need "real" keys for basic development. Some features require certain keys, so you may be able to add them as you go. -5. Run `bin/setup` +1. Run `bin/setup` #### Starting the application + We're mostly a Rails app, with a bit of Webpack sprinkled in. **For most cases, simply running `bin/rails server` will do.** If you're working with Webpack though, you'll need to run the following: * Run **`bin/startup`** to start the server, Webpack, and our job runner `delayed_job`. `bin/startup` runs `foreman start -f Procfile.dev` under the hood. @@ -181,6 +188,7 @@ Here are some singleton commands you may need, usually in a separate instance/ta Current gotchas: potential environment issues with external services need to be worked out. #### Suggested Workflow + We use [Spring](https://github.com/rails/spring) and it is already included in the project. 1. Use the provided bin stubs to automatically start Spring, i.e. `bin/rails server`, `bin/rspec spec/models/`, `bin/rake db:migrate`. @@ -190,6 +198,7 @@ We use [Spring](https://github.com/rails/spring) and it is already included in t Caveat: `bin/rspec` is not equipped with Spring because it affects Simplecov's result. Instead use `bin/spring rspec`. ## Additional docs + [Check out our dedicated docs page for more technical documentation.](https://docs.dev.to) ## Product Roadmap @@ -198,25 +207,25 @@ Our new product roadmap can be found [here](https://github.com/thepracticaldev/d Core team members will move issues along the project board as they progress. -- Ideas & Requests: features up for discussion. -- Needs Owners: features in need of an owner. -- Committed: features we're committed to building -- free for contributors to work on, but please communicate with the owner beforehand. -- In Progress (early stage): work has begun on feature. -- In Progress (late stage): feature is near completion. +* Ideas & Requests: features up for discussion. +* Needs Owners: features in need of an owner. +* Committed: features we're committed to building -- free for contributors to work on, but please communicate with the owner beforehand. +* In Progress (early stage): work has begun on feature. +* In Progress (late stage): feature is near completion. ## Core team -- [@benhalpern](https://dev.to/ben) -- [@jessleenyc](https://dev.to/jess) -- [@peterkimfrank](https://dev.to/peter) -- [@maestromac](https://dev.to/maestromac) -- [@zhao-andy](https://dev.to/andy) +* [@benhalpern](https://dev.to/ben) +* [@jessleenyc](https://dev.to/jess) +* [@peterkimfrank](https://dev.to/peter) +* [@maestromac](https://dev.to/maestromac) +* [@zhao-andy](https://dev.to/andy) ## License -This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Please see the [LICENSE](./LICENSE.md) file in our repository for the full text. +This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Please see the [LICENSE](./LICENSE.md) file in our repository for the full text. -Like many open source projects, we require that contributors provide us with a Contributor License Agreement (CLA). By submitting code to the DEV project, you are granting us a right to use that code under the terms of the CLA. +Like many open source projects, we require that contributors provide us with a Contributor License Agreement (CLA). By submitting code to the DEV project, you are granting us a right to use that code under the terms of the CLA. Our version of the CLA was adapted from the Microsoft Contributor License Agreement, which they generously made available to the public domain under Creative Commons CC0 1.0 Universal. diff --git a/db/schema.rb b/db/schema.rb index 6643f8feb..40b9fbf0d 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -378,10 +378,6 @@ ActiveRecord::Schema.define(version: 20180806142338) do create_table "messages", force: :cascade do |t| t.bigint "chat_channel_id", null: false t.datetime "created_at", null: false - t.text "encrypted_message_html" - t.text "encrypted_message_html_iv" - t.text "encrypted_message_markdown" - t.text "encrypted_message_markdown_iv" t.string "message_html", null: false t.string "message_markdown", null: false t.datetime "updated_at", null: false diff --git a/docs/get-api-keys-dev-env.md b/docs/get-api-keys-dev-env.md index e814dd6e6..2e350b7b4 100644 --- a/docs/get-api-keys-dev-env.md +++ b/docs/get-api-keys-dev-env.md @@ -1,6 +1,8 @@ There are a few services you'll need **_(all free)_** in order to run the development server and access the app locally. Here are the instructions for getting them: -# Algolia (Choose OAuth or Email Sign Up) +# Algolia + +Choose OAuth or Email Sign Up ## Algolia: OAuth Sign Up diff --git a/docs/installation/linux.md b/docs/installation/linux.md new file mode 100644 index 000000000..0b3d1ba56 --- /dev/null +++ b/docs/installation/linux.md @@ -0,0 +1,51 @@ +## Installing prerequisites + +These prerequisites assume you're working on a Linux-based operating system but have been tested on Ubuntu 18.04. + +### Ruby + +1. If you don't already a Ruby version manager, we highly recommend [rbenv](https://github.com/rbenv/rbenv). Please follow their [installation guide](https://github.com/rbenv/rbenv#installation). +2. With the Ruby version manager, install Ruby verion listed on our badge. (ie with rbenv: `rbenv install 2.5.1`) + +For very detailed rbenv installation directions on several distros, please vist [DigitalOcean's guide](https://www.digitalocean.com/community/tutorials/how-to-install-ruby-on-rails-with-rbenv-on-ubuntu-18-04). + +### Yarn + +There are two ways to install Yarn. + +* Yarn's offical [installation guide](https://yarnpkg.com/en/docs/install#debian-stable). +* [DigitalOcean's detailed tutorial](https://www.digitalocean.com/community/tutorials/how-to-install-node-js-on-ubuntu-18-04) describes how to install [Node version Manager](https://github.com/creationix/nvm). By installing NVM you can select a Node version (we recommend either LTS or current), the guide will also explain how to install NPM. This way you'll have Node, NPM, and then you can run `npm install -g yarn` to install Yarn. + +### PostgreSQL + +1. run `sudo apt update && sudo apt install postgresql postgresql-contrib libpq-dev`. +2. To test the installation you can run `sudo -u postgres psql` which should open a PostgreSQL prompt. Exit the prompt by running `\q` then run `sudo -u postgres createuser -s $YOUR_USERNAME` where $YOUR_USERNAME is the username you are currently logged in as. Lastly, at least on Debian based systems, in the codebase under /config/database.yml you'll want to comment out the `host: localhost` to configure the database to use Unix domain sockets as outlined [here](https://stackoverflow.com/questions/23375740/pgconnectionbad-fe-sendauth-no-password-supplied). + +Check out the official [PostgreSQL](https://www.postgresql.org/) site for more information. + +## Installing Dev.to + +1. Fork dev.to repository, ie. https://github.com/thepracticaldev/dev.to/fork +2. Clone your forked repository, ie. `git clone https://github.com//dev.to.git` +3. Install bundler with `gem install bundler` +4. Install foreman gem with `gem install foreman` +5. Install our ruby dependencies with `bundle install` +6. Install our frontend dependencies with `bin/yarn` +7. Set up your environment variables/secrets + +* Take a look at `Envfile`. This file lists all the `ENV` variables we use and provides a fake default for any missing keys. You'll need to get your own free [Algolia credentials](http://docs.dev.to/get-api-keys-dev-env/#algolia) to get your development environment running. +* This [guide](http://docs.dev.to/get-api-keys-dev-env/) will show you how to get free API keys for additional servies that may be required to run certain parts of the app. +* For any key that you wish to enter/replace: + +8. Create `config/application.yml` by copying from the provided template (ie. with bash: `cp config/sample_application.yml config/application.yml`). This is a personal file that is ignored in git. +9. Obtain the development variable and apply the key you wish to enter/replace. ie: + + ``` + GITHUB_KEY: "SOME_REAL_SECURE_KEY_HERE" + GITHUB_SECRET: "ANOTHER_REAL_SECURE_KEY_HERE" + ``` + +* If you are missing `ENV` variables on bootup, `envied` gem will alert you with messages similar to `'error_on_missing_variables!': The following environment variables should be set: A_MISSING_KEY.`. +* You do not need "real" keys for basic development. Some features require certain keys, so you may be able to add them as you go. + +10. Run `bin/setup` diff --git a/docs/installation/mac-os.md b/docs/installation/mac-os.md new file mode 100644 index 000000000..78be10d97 --- /dev/null +++ b/docs/installation/mac-os.md @@ -0,0 +1,41 @@ +## Installing prerequisites + +### Ruby + +1. If you don't already a Ruby version manager, we highly recommend [rbenv](https://github.com/rbenv/rbenv). Please follow their [installation guide](https://github.com/rbenv/rbenv#installation). +2. With the Ruby version manager, install Ruby verion listed on our badge. (ie with rbenv: `rbenv install 2.5.1`) + +### Yarn + +Please refer to their [installation guide](https://yarnpkg.com/en/docs/install). + +### PostgreSQL + +Dev.to requires PostgreSQL version 9.4 or higher. The easiest way to get started is to use [Postgres.app](https://postgresapp.com/). Alternatively, check out the official [PostgreSQL](https://www.postgresql.org/) site for more granular version. + +## Installing Dev.to + +1. Fork dev.to repository, ie. https://github.com/thepracticaldev/dev.to/fork +2. Clone your forked repository, ie. `git clone https://github.com//dev.to.git` +3. Install bundler with `gem install bundler` +4. Install foreman gem with `gem install foreman` +5. Install our ruby dependencies with `bundle install` +6. Install our frontend dependencies with `bin/yarn` +7. Set up your environment variables/secrets + +* Take a look at `Envfile`. This file lists all the `ENV` variables we use and provides a fake default for any missing keys. You'll need to get your own free [Algolia credentials](http://docs.dev.to/get-api-keys-dev-env/#algolia) to get your development environment running. +* This [guide](http://docs.dev.to/get-api-keys-dev-env/) will show you how to get free API keys for additional servies that may be required to run certain parts of the app. +* For any key that you wish to enter/replace: + +8. Create `config/application.yml` by copying from the provided template (ie. with bash: `cp config/sample_application.yml config/application.yml`). This is a personal file that is ignored in git. +9. Obtain the development variable and apply the key you wish to enter/replace. ie: + + ``` + GITHUB_KEY: "SOME_REAL_SECURE_KEY_HERE" + GITHUB_SECRET: "ANOTHER_REAL_SECURE_KEY_HERE" + ``` + +* If you are missing `ENV` variables on bootup, `envied` gem will alert you with messages similar to `'error_on_missing_variables!': The following environment variables should be set: A_MISSING_KEY.`. +* You do not need "real" keys for basic development. Some features require certain keys, so you may be able to add them as you go. + +10. Run `bin/setup` diff --git a/docs/installation/readme.md b/docs/installation/readme.md new file mode 100644 index 000000000..84a6038e6 --- /dev/null +++ b/docs/installation/readme.md @@ -0,0 +1,13 @@ +--- +items: + - linux.md + - path: mac-os.md + title: macOS + - windows.md +--- + +# Detailed Installation Guides + +These are the guides for installing the app on different operating systems. + +These guides could be incorrect or outdated. If you come across anything that needs to be changed, make a PR! Thanks! diff --git a/docs/installation/windows.md b/docs/installation/windows.md new file mode 100644 index 000000000..363de7c3b --- /dev/null +++ b/docs/installation/windows.md @@ -0,0 +1,3 @@ +## 🚧 Under Contruction 🚧 + +_contributions welcomed_ diff --git a/docs/liquid-tags.md b/docs/liquid-tags.md new file mode 100644 index 000000000..4c9a1eca5 --- /dev/null +++ b/docs/liquid-tags.md @@ -0,0 +1,11 @@ +Liquid tags are a special element of the [dev.to](/) markdown editor. + +They are custom embeds that are added via `{% %}` syntax. [Liquid](https://shopify.github.io/liquid/) is a templating language developed by Shopify. + +Liquid embeds are for tweets, like `{% tweet 765282762081329153 }` or a DEV user profile preview, like `{% user jess %}` etc. + +They make for good community contributions because they can be extended and improved on consistently. It is truly how we extend the functionality of the editor. At the moment, there could be a lot of work refactoring and improving existing liquid tags, in addition to adding new ones. + +Liquid tags are sort of like functions, which have a name and take arguments. Develop them with that mindset in terms of naming things. They should be documented but also intuitive. They should also be fairly flexible in the arguments they take. Currently this could use improvements. + +Liquid tags are "compiled" when an article is saved. So you will need to re-save articles to see HTML changes. diff --git a/docs/readme.md b/docs/readme.md index 465ee316a..aa5281e67 100644 --- a/docs/readme.md +++ b/docs/readme.md @@ -16,6 +16,10 @@ items: title: FAQ - path: license-faq.md title: License FAQ + - path: installation + title: Installation Guide + - path: liquid-tags.md + title: Liquid Tags --- # Welcome to the dev.to documentation! diff --git a/netlify.toml b/netlify.toml index 1e1e660e6..885275197 100644 --- a/netlify.toml +++ b/netlify.toml @@ -1,5 +1,5 @@ -# Global settings applied to the whole site. -# +# Global settings applied to the whole site. +# # “publish” is the directory to publish (relative to root of your repo), # “command” is your build command, # “base” is directory to change to before starting build. if you set base: @@ -13,21 +13,25 @@ [[redirects]] from = "http://docs.dev.to/*" to = "https://docs.dev.to/:splat" + status = 301 [[redirects]] from = "docs.dev.to" to = "https://docs.dev.to" [[redirects]] from = "docs.dev.to/*" to = "https://docs.dev.to/:splat" + status = 301 [[redirects]] from = "http://devto.netlify.com" to = "https://docs.dev.to" [[redirects]] - from = "http://devto.netlify.com/:splat" + from = "http://devto.netlify.com/*" to = "https://docs.dev.to/:splat" + status = 301 [[redirects]] from = "https://devto.netlify.com" to = "https://docs.dev.to" [[redirects]] from = "https://devto.netlify.com/*" to = "https://docs.dev.to/:splat" + status = 301