Skip to content

edson-a-soares/poco_restful_webservice

Repository files navigation

Poco RESTful WebService

License Build Status

Overview

This is a totally functional RESTful API built using the free version of Poco C++ Libraries.

Disclaimer

  1. There is a POCO PRO C++ Frameworks and it has its own support to RESful APIs development. Check this out, if you want to know more about it.

  2. This application is just another way to build a application using only the free part of this amazing library. Be aware this is not meant to be a blueprint, the correct way, even worse, the best way to build an API using Poco C++ Libraries. On the contrary, it was built purely for fun and curiosity after I have used this amazing C++ framework in a project I worked in. Surely, there are plenty different ways to build a similar project using Poco C++ Libraries. However, I hope this can be useful offering some guidance for those trying to build a non trivial application using Poco C++ Libraries.

Requirements for running it locally

  • Virtualized environment

    The development environment is built using virtualization. So, for running it locally you just need to have Vagrant, VirtualBox and Puppet installed in your computer.

    Currently, the project has been using the following versions of the tools aforementioned:

    • Vagrant 2.0
    • VirtualBox 5.1
    • Puppet 4.8
  • On your own

    Currently, the project has the following dependencies:

    • CMake 3.7.2
    • GCC-6 and G++-6
    • Google's C++ test framework
    • Poco 1.8.1
    • MySQL

Running the project

After having Vagrant, VirtualBox and Puppet installed you can run the web service locally through a few Ant Tasks at the root directory of the project as follows:

Managing application environment

For making the environment available locally:

ant -propertyfile dev.properties setup_environment

or, using Vagrant directly applying this command on the root directory of the project:

vagrant up

For destroying the environment with everything:

ant -propertyfile dev.properties destroy_environment

or, using Vagrant directly applying this command on the root directory of the project:

vagrant destroy
Managing application database

For making the database available:

ant -propertyfile dev.properties create_schema
ant -propertyfile dev.properties init_schema

For destroying the database:

ant -propertyfile dev.properties drop_schema
Managing the development process
ant -propertyfile dev.properties create_build_directory
ant -propertyfile dev.properties clean_build_directory
ant -propertyfile dev.properties build_project
ant -propertyfile dev.properties compile_project
ant -propertyfile dev.properties run_tests

Usage

After having run the project you will be able to make requests to the API. For doing this, use a Terminal tool like cUrl or any REST Client Tool like ARC or Postman.
You reach the service at the IP address 192.168.1.100:9090.

Running Requests and Responses

For seeing a complete list of API resources and how to make requests and responses consult the API documentation.

Standards and Style

This project do not follow any specific Coding Style Guidelines or Standard. But, it has been influenced by Google C++ Style Guide, PPP Style Guide and Applied Informatics C++ Coding Style Guide itself.

Useful links