Where programmers share ideas and help each other grow
Clone or download
benhalpern Adjust button style/placement on desktop (#1288)
* Adjust button style/placement on desktop

* Change opacity on side comments

* Adjust css for side article actions

* Adjust opacity

* Adjust opacity

* Adjust opacity

* Fix test language

* Remove opacity deal
Latest commit 14bba5e Dec 11, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github Revert banisher (#1274) Dec 6, 2018
.vscode Fix YouTube tag (#649) Sep 13, 2018
app Adjust button style/placement on desktop (#1288) Dec 11, 2018
bin Delayed Jobs Investigation (#929) Oct 17, 2018
config [WIP] Allow mods to remove tags and send user notification (#1252) Dec 4, 2018
db Bump capybara from 3.10.0 to 3.12.0 (#1294) Dec 10, 2018
docs Remove database.yml from the repo (#1162) Nov 27, 2018
lib Add guard clause to hotfix some 500s (#1258) Dec 5, 2018
log Initial commit Feb 28, 2018
public Add Apple deep link page (#1075) Nov 6, 2018
spec Adjust button style/placement on desktop (#1288) Dec 11, 2018
vendor/assets Initial commit Feb 28, 2018
.babelrc Create DelayedJob config and misc DX changes (#979) Oct 26, 2018
.dockerignore Adds optional support for Docker/Compose (#296) Oct 12, 2018
.editorconfig Export articles/posts (#576) Nov 21, 2018
.eslintrc.js Dx/add prettier code (#188) Apr 9, 2018
.gitdocs.js Create DelayedJob config and misc DX changes (#979) Oct 26, 2018
.gitignore Remove database.yml from the repo (#1162) Nov 27, 2018
.postcssrc.yml Initial commit Feb 28, 2018
.prettierignore Dx/add prettier code (#188) Apr 9, 2018
.rspec Initial commit Feb 28, 2018
.rubocop.yml Basic feature specs for the stories (#1269) Dec 7, 2018
.rubocop_todo.yml Update rubocop_todo (#1270) [ci skip] Dec 6, 2018
.ruby-version Upgrade Ruby to 2.5.3 (#996) Oct 24, 2018
.simplecov Initial commit Feb 28, 2018
.travis.yml Upgrade Ruby to 2.5.3 (#996) Oct 24, 2018
CODE_OF_CONDUCT.md Update CODE_OF_CONDUCT.md (#1012) Oct 26, 2018
CONTRIBUTING.md fix a typo in CONTRIBUTING.md (#1136) Nov 17, 2018
Dockerfile Update Dockerfile (#1009) [ci skip] Oct 25, 2018
Envfile Add Honeycomb gem and initial instrumentation (#695) Nov 28, 2018
Gemfile Bump capybara from 3.10.0 to 3.12.0 (#1294) Dec 10, 2018
Gemfile.lock Bump capybara from 3.10.0 to 3.12.0 (#1294) Dec 10, 2018
Guardfile Add HTML variants for cta optimization and other nav bar adjustments (#… Oct 22, 2018
LICENSE.md Update Docs [ci skip] (#656) Aug 8, 2018
Makefile Adds optional support for Docker/Compose (#296) Oct 12, 2018
Procfile Initial commit Feb 28, 2018
Procfile.dev Initial commit Feb 28, 2018
Procfile.dev-hot Initial commit Feb 28, 2018
README.md Remove redundant installation steps [skip ci] (#1148) Dec 3, 2018
Rakefile Code cleanups (#659) Aug 7, 2018
after_deploy.sh Change mods-actions' display logic (#630) Jul 27, 2018
config.ru Code cleanups (#659) Aug 7, 2018
docker-compose.yml Adds optional support for Docker/Compose (#296) Oct 12, 2018
empty-module.js Initial commit Feb 28, 2018
jest.config.js more testing for connect components (#1046) Nov 19, 2018
netlify.toml Expend installation docs (#366) Aug 16, 2018
package.json Bump preact from 8.3.1 to 8.4.2 (#1290) [ci skip] Dec 10, 2018
yarn.lock Bump preact from 8.3.1 to 8.4.2 (#1290) [ci skip] Dec 10, 2018

README.md


DEV

DEV Community 👩‍💻👨‍💻

The Human Layer of the Stack

ruby version rails version Travis Status for thepracticaldev/dev.to CodeTriage badge

Welcome to the 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 (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

We encourage you to contribute to dev.to! Please check out the Contributing to dev.to guide for guidelines about how to proceed.

We expect contributors to abide by our underlying 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

All issues labeled with approved are up for grabs. For clarification on how we label issues, check out their definitions here.

When in doubt, ask a core team member! You can mention us in any issues or ask on the DEV Contributor thread. Any issue with the good first issue tag is typically a good place to start for anyone new to the project. For newer developers, try 'entry-level' issues.

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.

Fixing bugs may also not require a lot of communication, but the more the better. Please surround bug fixes with ample tests. Bugs are magnets for other bugs. Write tests near bugs!

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 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.
  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: git commit -m 'Add some feature'
  4. Push to the branch: git push origin feature/that-new-feature
  5. 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, 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. More info here
  • Document your reasoning behind the changes. Explain why you wrote the code in the way you did. The code should explain what it does.
  • If there's an existing issue related to the pull request, reference to it by adding something like References/Closes/Fixes/Resolves #305, where 305 is the issue number. More info here
  • If you follow the pull request template, you can't go wrong.

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 or create an issue. You can also mention any core team member in an issue and we'll respond as soon as possible.

👉 OSS Help/Discussion Thread 👈

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.

Engineering standards

Style Guide

This project follows thoughtbot's Ruby Style Guide, using Rubocop along with 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, using ESLint and 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 and 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 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.

Prerequisites

Standard Installation

  1. Make sure all the prerequisites are installed.
  2. Fork dev.to repository, ie. https://github.com/thepracticaldev/dev.to/fork
  3. Clone your forked repository, ie. git clone https://github.com/<your-username>/dev.to.git
  4. gem install foreman
  5. Setup your database
    • Create config/database.yml by copying from the provided template (i.e. cp config/database.yml.sample config/database.yml)
    • Update the config/database.yml file if needed.
  6. 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 to get your development environment running.
    • This guide will show you how to get free API keys for additional services 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 (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: "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.
  7. Run bin/setup
  8. That's it! Run bin/startup to start the application and head to http://localhost:3000/

View Full Installation Documentation

Docker Installation (BETA)

Our docker implementation is incomplete and may not work smoothly. Please kindly report any issues and any contribution is welcomed!

  1. Install docker and docker-compose
  2. git clone git@github.com:thepracticaldev/dev.to.git
  3. Set environment variables above as described in the "Basic Installation"
  4. run docker-compose build
  5. run docker-compose run web rails db:setup
  6. run docker-compose up
  7. That's it! Navigate to localhost:3000

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.
  • alias start="bin/startup" makes this even faster. 😊
  • If you're using pry for debugging in Rails, note that using foreman and pry together works, but it's not as clean as bin/rails server.

Here are some singleton commands you may need, usually in a separate instance/tab of your shell.

  • Running the job server (if using bin/rails server) -- this is mostly for notifications and emails: bin/rails jobs:work
  • Clearing jobs (in case you don't want to wait for the backlog of jobs): bin/rails jobs:clear

Current gotchas: potential environment issues with external services need to be worked out.

Suggested Workflow

We use 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.
  2. If Spring isn't picking up on new changes, use spring stop. For example, Spring should always be restarted if there's a change in environment key.
  3. Check Spring's status whenever with spring status.

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.

Product Roadmap

Our new product roadmap can be found here. Many notes need to be converted to issues but this should provide an overview of features we plan to work on, as well as features we are considering.

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.

Core team

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 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.

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.

Any questions, please refer to our license FAQ doc or email yo@dev.to


sloan
Happy Coding ❤️