- Ruby 2.6.4
- Rails 6.01
- Download docker cli
# Ubuntu
$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
$ sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
$ sudo apt-get update
$ apt-cache policy docker-ce
$ sudo apt-get install -y docker-ce
$ sudo curl -L https://github.com/docker/compose/releases/download/1.21.0/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose
$ sudo chmod +x /usr/local/bin/docker-compose
-
download docker app from dockerhub
-
Run docker containers
docker-compose up
- Create DB
$ docker-compose run --rm web rake db:setup db:migrate
- Use Use rbenv / rvm to install ruby whose version is as specified in Vantage root .ruby-version (2.6.4)
- Install the specific rails version
gem install rails -v 6.0.1
- Install MySql. Refer to here if you face installation issues.
# macOS
brew install mysql
# Linux
sudo apt-get install mysql-client
- Setup MySql with your own password
- Install yarn
brew install yarn
- Set your password in a file, the rails database.yml file will read it from there to initiate a connection. More info. Create a .env file in the repo root and add the root passwords:
DB_... should point to your local database. By default the
DB_USERNAME = root
unless you made changes to it.
DB_USERNAME = root
DB_PASSWORD = ...
DB_HOST = 127.0.0.1
- Start MySql server
- Populate your dev and test databases by running both commands:
# Dev
rake db:setup
# Test
RAILS_ENV=test rake db:create db:schema:load
rails s
to start the applicationruby bin/webpack-dev-server
to run webpacker for hot reload
- Open Google Cloud VM console
docker-compose -f docker-compose.prod.yml up -d mysql webserver
docker-compose -f docker-compose.prod.yml up -d --build --no-deps web
docker-compose -f docker-compose.prod.yml restart webserver
If running app on the db for the first time execute the below command to start
docker-compose -f docker-compose.prod.yml run web bundle exec rake db:setup db:migrate
- Dont use our project uses yarn instead of
npm
. Dont usenpm
commands
We use jest
as our front end testing framework and react-testing-library
for testing the components. All test front end cases are under the spec/javascript
directory in root. Run npm test
to execute all test cases. File needs to end with _spec.js/jsx
to be identified by jest
.
Include this at the top of every file:
import React from 'react'
import { render, screen } from 'test-utils';
import '@testing-library/jest-dom/extend-expect'
import App from 'components/App.jsx'
We use rspec
as our testing framework. Everything that has to do with testing is under the spec
directory. Refer here for more information.
#Execute all test cases
bundle exec rspec
#Execute a particular file
rspec spec/models/user_spec.rb
#Excute a particular test case:{line number}
This is Vantage own self-defined resume specification and it would be used to communicate the details of the resume between the front end and back end. Here is the format of the specification.
//VRS FORMAT
{
"about": {
"name": "USER'S FULL NAME: str",
"email": "USER'S EMAIL: str",
"contactNumber": "USER'S CONTACT NUMBER: int",
"aboutMe": "SHORT WRITE UP OF USER: str"
},
"educations": [
{
"program": "EDUCATION PROGRAMME: str",
"institution": "USER SCHOOL/ITE/PRIVATE SCHOOL ETC: str",
"start": "EDUCATION START DATE: int(DDMMYYYY)",
"end": "EDUCATION START DATE: int(DDMMYYYY)",
"grade": "EDUCATION GRADE: str"
}
],
"workExperiences": [
{
"title": "JOB TITLE: str",
"company": "COMPANY WORKING AT: str",
"start": "EDUCATION START DATE: int(DDMMYYYY)",
"end": "EDUCATION START DATE: int(DDMMYYYY)",
"achievements": ["SHORT WRITE UP ABOUT ACHIEVEMENTS IN THE COMPANY"],
"referee": {
"name": "NAME OF REFEREE: str",
"email": "EMAIL OF REFEREE: str"
}
}
],
"skills": [
{
"name": "NAME OF SKILL: str",
"description": "short write up about skill",
"link": "External link to photo/video of the skill"
}
],
"interests": [
{
"name": "NAME OF INTEREST: str"
}
]
}
Here contains the details of the design for the code base
Overall Architecture Diagram here.
Refer to this link(https://www.lucidchart.com/invitations/accept/02422668-1633-4c88-9259-95ec849acf1c) to make any changes to the diagram
Activity diagram of how the routing works for the internal API and front end routes. Diragram here.