Skip to content

This repository sets up a Node.js app that will expose various REST API endpoints following (semantic) processing of data collected from SoCaTel-linked Twitter accounts and website generated data.

License

Notifications You must be signed in to change notification settings

SoCaTel/rest-api

Repository files navigation

SoCaTelLogo

REST API Endpoints

This project contains an array of endpoints that expose useful insights and analytics of the SoCaTel user base.

Getting Started

Prerequisites

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

All tools and processes are meant to be deployed under a docker container. To get everything set up, you should:

  • Have docker installed in your machine. See this for a general guide on Linux machines (preferred OS for this project).

The docker container used will take care of installing node and all packages required to expose endpoints included here.

You will need to have the following setup, found in the SoCaTel group:

  • DSE Flask application, housed in the backend-storage github repo, responsible for synchronising data insertion from the front-end to GraphDB and Elasticsearch
  • GraphQL, for semantic repository queries, exposed through API calls.
  • Elasticsearch, for direct queries to the database. For help in setting this up and the necessary Elasticsearch indices , refer to this repository.
  • MongoDB, for accessing recommendation and semantic engine's stored outputs from periodical runs

Configurations

Under the configuration file, change the Elasticsearch, GraphQL and MongoDB related fields, based on your current setup.

Basic authorisation is also supported, so you should change the following based on a unique set of username and password:

  • restapi_username
  • restapi_password

The default port used is 8192, if you need to change it, edit the restapi_port parameter.

Deployment

Retrieve the <mongodb_network_name> in the docker container preparation script from the second line of the following command's output (the MongoDB setup is done in the sentiment classification engine component setup): docker inspect <mongo_image_id> | grep -A 2 "Networks"

Then run ./docker_build.sh to deploy this on your Linux machine of choice. Access the GUI (built on Swagger) through: <host>:8192/api-docs/#/, where host is your Linux machine's IP address (the docker exposes the application on localhost).

Built With

  • Docker - The secure way to build and share this application, anywhere.
  • NodeJS - A powerful Javascript runtime where scalable network applications are built.
  • Swagger - Used for API documentation and exposure on its GUI tool

Contact

If you encounter any problems, please contact the following:

CyRIC | Cyprus Research and Innovation Centre

License

Apache-2.0

Acknowledgments

About

This repository sets up a Node.js app that will expose various REST API endpoints following (semantic) processing of data collected from SoCaTel-linked Twitter accounts and website generated data.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages