stay.io is a simple, scalable and containerized rating application.
It features role-based access to add, edit, delete, view, like, rate and comment on listings posted by providers who are able to add, edit, and delete their own listings and have all features that a normal unprivileged user would have. A normal user is able to only like, rate and comment on listings. They are also able to edit and delete their profiles.
The frontend application is built on Vue.js and the backend is a JWT-authenticated RESTful JSON API that communicates with a Postgresql database. Authentication is cookie-based and leverages cookie-handling by Passport.js.
The application is available to be deployed in a multi-container deployment according to the docker-compose.yml
file in the repository.
Set up a VirtualHost in your web server that points to the backend of the application.
server {
listen 80;
server_name <your-domain>
location / {
proxy_pass https://localhost:5002/;
}
}
Replace the temporary API endpoint with <your-domain>
in frontend/src/api/config.js
.
Add a Facebook API Secret in .env
as FB_API_SECRET=<your-secret>
Use docker-compose
as the container orchestrator to spin up all required services. The command that is to be executed is given below.
sudo docker-compose -f docker-compose.yml up \
-d --build frontend &
The docker-compose.yml
in the root of the repository exposes various aspects of the application at the given ports.
5001
- Database (postgresql)5002
- Backend APIs5003
- Frontend served via NGINX
Clone this repository on your machine.
Install all required dependencies in backend
and frontend
directories by executing npm install
in both directories. Install the @vue/cli
package globally by executing sudo npm i -g @vue/cli
.
Tests can be run in backend
and frontend
directories by executing npm test
in either one of them for triggering the respective test suites.
The REST API Documentation is hosted at SwaggerHub.
The MIT Open-Source License