Public API for VLCTechHub
- Clone the project
git clone git@github.com:VLCTechHub/VLCTechHub-api.git
- Install Ruby 3.1.3 (you might want to install it with rbenv)
- Install MongoDB (optional, you can use a remote service)
- Install dependencies by running
bundle install
- Create a local
.env
file from the included.env.example
file - Configure your mongo connection uris (not necesary if you use local mongo with default values) and optionally the rest of environment values in the
.env
file - Run
bundle exec rake up
- Visit
http://localhost:5000
- Run
bundle exec rake mongo:prepare
- Run
bundle exec rake test
The project is configured to use Rubocop and SyntaxTree checks.
- For Rubocop linting run
bundle exec rubocop .
- For SyntaxTree format checks run
bundle exec stree check '**/*.rb' '**/*.ru' Rakefile Gemfile Clockfile
To simplify the linting checks it is advisable to configure both linters extensions in your code editor of choice.
- Install Docker Engine and Docker Compose.
- The first time you use it, you will need to build the app containers:
docker-compose build
- Optionally, create a local
.env
file for the environment values without default values in thedocker-compose.yml
file - To start the containers, just use
docker-compose up
- Visit
http://localhost:5000
- With the containers running, execute
docker-compose exec api bundle exec rake mongo:prepare
- With the containers running, execute
docker-compose exec api bundle exec rake test
The project is configured to use Rubocop and SyntaxTree checks.
- For Rubocop, with the containers running, execute
docker-compose exec api bundle exec rubocop .
- For SyntaxTree, with the containers running, execute
docker-compose exec api bundle exec stree check '**/*.rb' '**/*.ru' Rakefile Gemfile Clockfile