You should have already installed:
- Ruby 3.2.0
- Ruby on Rails 7.0.6
- Postgresql
Restful API was built upon Grape API framework, and documented using OpenAPI. The UI for API documentation is available on localhost:/3000/api-docs
Endpoint | Action | Description |
---|---|---|
/books | GET | Get list of books |
/books?page={number} | GET | Get list of books for specific page |
/books | POST | Create new book |
/books{id} | GET | Get a specific book by ID with related author |
/books{id} | PUT | Update a specific book by ID |
/books{id} | DELETE | Delete a specific book by ID |
/books{id}/upload_cover | POST | Upload cover image for specific book with ID |
Endpoint | Action | Description |
---|---|---|
/authors | GET | Get list of author |
/authors?page={number} | GET | Get list of authors for specific page |
/authors | POST | Create new author |
/authors{id} | GET | Get a specific author by ID with related books |
/authors{id} | PUT | Update a specific author by ID |
/authors{id} | DELETE | Delete a specific author by ID |
git clone git@github.com:Bar2d2/libra_app.git
cd libra_app
gem install bundler
bundle install
yarn install
yarn build
yarn build:css
The master.key file should live under the /app/config
directory.
3. Images upload is handle by AWS S3 service, if you would want to update the credentials with your own
rails credentials:edit
s3:
bucket: <bucket-name>
region: <bucket-region>
access_key_id: <your-access-key>
secret_access_key: <your-secret-access-key>
brew services start postgres
You can check running services with brew services list
.
systemctl status postgres
Start services if required:
sudo systemctl start postgres.service
rake db:create
rake db:migrate
rake db:seed
bundle exec rspec
bundle exec cucumber
COVERAGE=on bundle exec rspec
rubocop
reek
foreman start