Skip to content

davidhqr/Wave-API

Repository files navigation

Wave-API

Contact GitHub license GitHub issues GitHub stars GitHub forks

Overview

This is the Wave Backend API which is responsible for the creation and retrieval of Waves.

Wave Flutter (Android & iOS) App: https://github.com/davidhqr/Wave-App
Wave React Web App: https://github.com/lindaayangg/Wave-Web

Endpoints

GET /waves/:code Retrieve a Wave by code
POST /waves Save a wave

Test the endpoints with Postman: https://www.getpostman.com/collections/739d155fdfb50f5c0773 (import the collection)

Database Tables

waves

Field Type Description
id BIGINT(20) Wave id
code VARCHAR(255) Wave code
text VARCHAR(255) Text contained in the Wave if it is a text Wave
created_at DATETIME Date that the Wave was created
updated_at DATETIME Date that the Wave was last updated

Usage

Development

To run the Wave API locally, execute the following commands:

  1. Execute git clone git@github.com:davidhqr/Wave-API.git
  2. Execute bundle install
  3. Execute rails server
  4. Navigate to http://localhost:3000

Production

Live Production API: http://138.197.151.168:3000

To deploy the API on the server:

  1. Execute cd /var/www/wave-api
  2. Execute git pull
  3. Execute bundle install --deployment --without development test
  4. Execute bundle exec rake assets:precompile db:migrate RAILS_ENV=production
  5. Execute systemctl restart nginx
  6. Execute systemctl status nginx to check the status

This article was followed while deploying the API: Deploying Ruby App To Production

Notes

  • We are using Phusion Passenger as an integration with nginx
  • To enable CORS, we added headers in the Passenger config for Wave
  • Passenger config for Wave is located at /etc/nginx/conf.d/wave-api.conf

About

Wave Backend API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •