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
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)
| 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 |
To run the Wave API locally, execute the following commands:
- Execute
git clone git@github.com:davidhqr/Wave-API.git - Execute
bundle install - Execute
rails server - Navigate to http://localhost:3000
Live Production API: http://138.197.151.168:3000
To deploy the API on the server:
- Execute
cd /var/www/wave-api - Execute
git pull - Execute
bundle install --deployment --without development test - Execute
bundle exec rake assets:precompile db:migrate RAILS_ENV=production - Execute
systemctl restart nginx - Execute
systemctl status nginxto check the status
This article was followed while deploying the API: Deploying Ruby App To Production
- 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