Skip to content

Auto-Rooter/React-App-with-Ruby-On-Rails-and-Docker

Repository files navigation

React-Rails-App-MySQL-RSpec-Docker CircleCI :


Technologies are used :

  • Front-end : React.js
  • Back-end : Ruby on Rails
  • Testing : RSpec Framework
  • Database : Mysql
  • CI/CD : CircleCI
  • Images-Upload : Active Storage (on Backend) and react-dropzone-component (on React)
  • (React App connect to Rails API using axios)
  • React Style : bulma



Usage(With Docker):


- Before we start , you should install Docker on your machine (For Back-end side):

$ git clone https://github.com/Auto-Rooter/React-App-with-Ruby-On-Rails-and-Docker.git && cd React-App-with-Ruby-On-Rails-and-Docker

# Setup
$ docker-compose build
$ docker-compose run web rake db:seed

# Run All Tests with RSpec
$ docker-compose run web RSpec

# Start
$ docker-compose up 
$ open http://localhost:3000


- Now we need to start the Front-end part (You need to install Node.js [Tested on v12.13.0 ] ):

$ cd project_frontend

$ npm install

# Start
$ npm start
$ open http://localhost:8000




Usage(Without Docker):


- Before we start , you should install Ruby Installer (For Windows).
- Inside [\config\database.yml] file Comment Docker, CircleCi parts and make sure Normal part is Uncommented.

$ git clone https://github.com/Auto-Rooter/React-App-with-Ruby-On-Rails-and-Docker.git && cd React-App-with-Ruby-On-Rails-and-Docker


$ cd project_backend
# Install all Gems
$ bundle install

# Create DB, Migrate, Seed(Not necessarily) 
$ rake db:create
$ rake db:migrate
$ rake db:seed


# Start
$ rails s
$ open http://localhost:3000

- Now we need to start the Front-end part (You need to install Node.js [Tested on v12.13.0 ] ):

$ cd project_frontend

$ npm install

# Start
$ npm start
$ open http://localhost:8000

Tests:


- all the tests are under the directory [project_backend\spec] :


- You can Run all the test by:

# You should be in the backend directory
$ cd project_backend

# Run All the Tests
$ rspec

- You Should See Something like this:


- Also you can Run a specific Test (Ex: Run the test for POSTS Controller) :

# You should be in the backend directory
$ cd project_backend

# Run POSTS Controller Test
$ rspec spec/controllers/posts_controller_spec.rb

REST APIs:

- Blog REST API (CRUD) : you can add post with(out) images also with comments:

- Create new post:





- Update post:





- Delete post:





- Add and Delete comments:







- Triangel Checker: check if a triangle (by entering three parameters a,b,c) Scaleme/Equilateral/Isosceles/Incorrect:



Releases

No releases published

Packages

No packages published