GithubHelp home page GithubHelp logo

project_template's Introduction

Nombre del proyecto

Application to be awesome

Table of contents

Client Details

Name Email Role
Nombre del cliente [email protected] CEO

Environment URLS

  • Production - TBD
  • Development - TBD

Da team

Name Email Role
Nombre miembro [email protected] Development
Nombre miembro [email protected] Development
Nombre miembro [email protected] Development

Technology Stack

Technology Version
Technology 1 ##.##.##
Technology 2 ##.##.##
Technology 3 ##.##.##

Management tools

You should ask for access to this tools if you don't have it already:

Development

Setup the project

You'll definitely want to install plis, as in this case will let you bring up the containers needed for development. This is done by running the command plis start, which will start up the services in the development group (i.e. rails and sidekiq), along with their dependencies (posgres, redis, etc).

After installing please you can follow this simple steps:

  1. Clone this repository into your local machine
$ git clone [email protected]:IcaliaLabs/crowdfront.git
  1. Fire up a terminal and run:
$ plis run web bash
  1. Inside the container you need to migrate the database:
% rails db:migrate

Running the stack for Development

  1. Fire up a terminal and run:
plis start

That command will lift every service crowdfront needs, such as the rails server, postgres, and redis.

It may take a while before you see anything, you can follow the logs of the containers with:

$ docker-compose logs

Once you see an output like this:

web_1   | => Booting Puma
web_1   | => Rails 5.1.3 application starting in development on http://0.0.0.0:3000
web_1   | => Run `rails server -h` for more startup options
web_1   | => Ctrl-C to shutdown server
web_1   | Listening on 0.0.0.0:3000, CTRL+C to stop

This means the project is up and running.

Stop the project

In order to stop crowdfront as a whole you can run:

% plis stop

This will stop every container, but if you need to stop one in particular, you can specify it like:

% plis stop web

web is the service name located on the docker-compose.yml file, there you can see the services name and stop each of them if you need to.

Restoring the database

You probably won't be working with a blank database, so once you are able to run crowdfront you can restore the database, to do it, first stop all services:

% plis stop

Then just lift up the db service:

% plis start db

The next step is to login to the database container:

% docker exec -ti crowdfront_db_1 bash

This will open up a bash session in to the database container.

Up to this point we just need to download a database dump and copy under crowdfront/backups/, this directory is mounted on the container, so you will be able to restore it with:

root@a3f695b39869:/# bin/restoredb crowdfront_dev db/backups/<databaseDump>

If you want to see how this script works, you can find it under bin/restoredb

Once the script finishes its execution you can just exit the session from the container and lift the other services:

% plis start

Debugging

We know you love to use debugger, and who doesn't, and with Docker is a bit tricky, but don't worry, we have you covered.

Just run this line at the terminal and you can start debugging like a pro:

% plis attach web

This will display the logs from the rails app, as well as give you access to stop the execution on the debugging point as you would expect.

Take note that if you kill this process you will kill the web service, and you will probably need to lift it up again.

Running specs

To run specs, you can do:

$ plis run test rspec

Or for a specific file:

$ plis run test rspec spec/models/user_spec.rb

Checking code for potential issues

To run specs, you can do:

$ plis run web reek
$ plis run web rubocop
$ plis run web scss_lint

Or any other linter you have.

project_template's People

Contributors

kurenn avatar rasacha 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.