GithubHelp home page GithubHelp logo

backend-1's Introduction

vscode logo

Devsnest's Backend

workflow

Uses:

Ruby MySQL Rails

Installation

If you don't have build tools installed (gcc, make etc) install them.

$ sudo apt install build-essential

Install ruby using rbenv.

$ git clone https://github.com/rbenv/rbenv.git ~/.rbenv

$ echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc

$ echo 'eval "$(rbenv init -)"' >> ~/.bashrc

$ exec $SHELL

$ git clone https://github.com/rbenv/ruby-build.git "$(rbenv root)"/plugins/ruby-build

$ rbenv install 2.7.2

$ rbenv global 2.7.2

$ ruby -v

Install bundle and rails

# Arch users can skip first command
$ sudo apt-get install -y libreadline-dev zlib1g-dev

$ gem install bundler

$ gem install rails

$ rbenv rehash

$ rails -v

Install MySQL

Ubuntu

$ sudo apt install mysql-server

$ sudo /etc/init.d/mysql start
# check this issue if it gives error
# https://github.com/wslutilities/wslu/issues/101

$ sudo mysql_secure_installation

Arch

$ sudo pacman -S mariadb

$ sudo /etc/init.d/mysql start
# If you get an error run next 2 commands otherwise skip

$ sudo mysql_install_db --user=mysql --basedir=/usr --datadir=/var/lib/mysql

$ sudo systemctl start mysqld

$ sudo mysql_secure_installation

ALWAYS use a password containing uppercase, lowercase, and special characters or else MySQL will give error (eg. Test@1234)

Setup

Clone the repository.

$ git clone [email protected]:devs-nest/backend.git

$ cd backend/devsnest

Setup .env file and run.

$ bundle install

$ bundle exec rake db:create db:migrate db:seed

$ rails s -p 8000

Common Errors

If you get a MySQL error during bundle install

$ sudo apt-get install libmysql-ruby libmysqlclient-dev

If you are on WSL, you might get a Network Error while doing auth with discord, it is likely that IPv6 is causing it so disable it

Environment Variables

KEY VALUE
MYSQL_NAME Database Name
MYSQL_USERNAME Username for MySQL
MYSQL_PASSWORD Password for MySQL
MYSQL_HOST Hostname for MySQL
AWS_SECRET_KEY
DEVISE_JWT_SECRET_KEY
DISCORD_TOKEN
SENTRY_DSN
RAILS_ENV Type of rails environment
SECRET_KEY_BASE
DISCORD_CLIENT_ID Client id of discord bot
DISCORD_CLIENT_SECRET Client secret of discord bot
FRONTEND_URL Frontend url
DISCORD_REDIRECT_URI URL to redirect to after discord login
NEW_RELIC_KEY Key for New Relic

Resources

POSTMAN Collection link

backend-1's People

Contributors

vedansh avatar yug-gurnani avatar kaydee0502 avatar adhikram avatar lakshitxd avatar patheticgeek avatar ayush893 avatar prachipathrayan avatar newts7 avatar priyamishra2903 avatar s4ch avatar sanjay270899 avatar aditi9012 avatar ayushi4 avatar

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.