Giter Club home page Giter Club logo

pyzlnar-back's Introduction

Pyzlnar Back

Introduction

This is the back end repo for pyzlnar.com
The backend is running on a Rails app (API mode) with PSQL.

Nothing too fancy to be honest, and maybe even a bit lackluster considering I’m supposed to be a backend guy, but tool for the job, so I guess this does for my small API for now. :)

Installation

Requirements

You will need the following installed to be able to run the back end:

  • git
    Should go without saying. Get yourself git installed.

  • ruby 2.4.2
    I recommend you install it via rvm or rbenv.

  • PostgreSQL 9.6.1
    Always a nightmare to setup, but it’s amazing to use. General instructions can be found here.

  • Memcached (Optional)
    Used for simple caching, but won’t have that much of an effect if you don’t install it other than slower responses. Install instructions can be found here.

Source Code

Clone the repo into your machine, and then change to the directory before you run anything else.

# Create a root directory first if you haven't already.
# The directory structure is not needed, but I like working this way.
$ mkdir pyzlnar

# Clone the repo into front
$ git clone https://github.com/pyzlnar/pyzlnar-back.git pyzlnar/back

# Change to back directory
$ cd pyzlnar/back

With the front repo, directories will look like this.

$ tree pyzlnar/ -L 1
pyzlnar/
├── back
└── front

Dependencies

Now to install all the dependencies. First you need to install bundler(v1.14.3+)

$ gem install bundler

After that, you simply need to install with bundler!

$ bundle install

# Or simply
$ bundle

You might find yourself that the pg gem is being uncooperative. If that’s the case follow the output instructions or google around on how to correctly setup the gem and retry until you’ve succesfuly installed all the gems.

The project uses rails 5.1.4 as of right now in case you’re wondering.

Initial Setup

Copy the secrets example into the actual secrets files. Edit the new file secrets.yml with your own secrets if needed to.

$ cp config/secrets.example.yml config/secrets.yml

Copy the database example into the actual database files. Edit the new file database.yml with your own database configuration.

$ cp config/database.example.yml config/database.yml

Create, migrate and seed the database.

$ rake db:setup

If you find yourself with problems creating the database (lol postgres), the most common errors are not having the correct username/password in the database config file (config/database.yml), not setting the postgres role correctly, and not setting up the correct database template.

Running

After all that one time setup, running is actually fairly easy!

# This will run the server in localhost:3000
$ rails s
Note
If you didn’t install memcached, consider commenting out the cache_store setting in config/environments/development.rb before running the server.

Code Integrity

Tests

Truth to be told running the tests is very easy! Just run the tests like this:

$ rspec spec/

Lint

I use rubocop to eliminate any smells from the code. To run it just use:

$ rubocop

TODO

Todo

Small list of features that may be coming in the future.

  • Forever upgrading ruby and rails versions

  • Use a docker image for ease of installation

License

Pyzlnar back is released under the MIT License.

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.