The setups steps expect following tools installed on the system.
The app can be run in both local and via Docker.
-
Run in Local
-
Run from Dockerfile
git clone git@github.com:organization/project-name.git
You can find a .env file in the project's root directory. Create a .env file if the file is not present. Enter your Postgresql database username and password.
DB_USERNAME:<your_postgresql_username>
DB_USER_PASSWORD=<your_postgresql_password>
Run bundle install
to install gem files. If you encounter Ruby version mismatch error, change the the ruby version with the Ruby version installed in your machine. To do that, you will find Ruby version mentioned in Gemfile
and .ruby-version
files. Both files can be found in project's root directory.
Run the following commands to create development and test databases. The second command is for migration and the third command is for generating seed data.
rails db:create
rails db:migrate
rails db:seed
You can start the rails server using the command given below.
rails s
And now you can visit the site with the URL http://localhost:3000
Make sure you have Docker installed and running in your machine.
docker-compose -f docker-compose.yml build
docker-compose -f docker-compose.yml run web rails db:create db:migrate
docker-compose -f docker-compose.yml up -d
Run the following command to run RSpec tests.
rspec
POST /api/v1/campaigns
GET /api/v1/campaigns
GET /api/v1/campaigns/1
PUT /api/v1/campaigns/1
POST /api/v1/campaigns/1/investments/
GET /api/v1/campaigns/1/investments/