ZIAPI repository which contains the interfaces and concrete implementations that make up our Epitech Zia project API proposal.

Related tags

GUI api cpp http-server zia
Overview

ZIAPI

Banner

ZiAPI CPP Version Discord workflow

Welcome to the ZIAPI repository which contains the interfaces and concrete implementations that make up our Epitech Zia project API proposal.

ZIAPI was elected as the city-wide API for the Paris Region in 2022.

ZIAPI Official Website
ZIAPI Official Discord

Documentation

You can find the documentation for the ZIAPI in our documentation section.

Here are the most useful doc pages for starting out:

Here is a quick overview of how the request / response cycle is handled with the ZIAPI.

Request / Response flow

Usage

Fetch ZiAPI using CMake

Add the following content to your CMakeLists to fetch the API and include its header files in your project:

include(ExternalProject)

ExternalProject_Add(
    ziapi
    GIT_REPOSITORY  https://github.com/martin-olivier/ZiAPI.git
    GIT_TAG         v1.0.0
    INSTALL_COMMAND ""
    TEST_COMMAND    ""
)

add_dependencies(zia ziapi)
ExternalProject_Get_Property(ziapi SOURCE_DIR)
include_directories(${SOURCE_DIR}/include)

💡 Don't forget to link with libdl on unix if you use dylib:

if(UNIX)
    target_link_libraries(zia PRIVATE dl)
endif()

Contact

Feel free to submit any issues on our GitHub repository or ask questions on our Discord

Authors

Comments
  • How to get out of pipeline when a module fail (or need to throw)?

    How to get out of pipeline when a module fail (or need to throw)?

    Description

    I was trying to figure how to "throw" from modules when an error occur or how to handle when you need to skip some modules because client is not logged or his method (POST, GET, ...) is not allowed on our server or anything like that.

    Proposed solution

    Maybe it could be cool to have a way to throw an exception from the pipeline (maybe a class), the exception could possibly be catch in the core to handle response (with status code + error message if necessary, something like that) :)

    bug 
    opened by arthur-fouquet 10
  • Replace the lists of variables in HttpConstants with enum class

    Replace the lists of variables in HttpConstants with enum class

    [FEATURES] Replace the lists of variables in HttpConstants with enum class

    Description

    The lists of variables that are used as number can and should be replaced by enum class.

    Is your feature request related to a problem? Please describe.

    Nope

    Describe the solution you'd like

    Replace the lists that can be by enum class

    Expected behaviour

    Same

    Actual behaviour

    Same

    Logs

    None

    Additional context

    None

    opened by Breigner01 6
  • Compilation warnings in Http.hpp

    Compilation warnings in Http.hpp

    Description

    There are compilation warnings in the Http.hpp file :

    ziapi/Http.hpp:33:8: warning: ‘ziapi::http::Response::version’ should be initialized in the member initialization list [-Weffc++]
       33 | struct Response {
          |        ^~~~~~~~
    ziapi/Http.hpp:33:8: warning: ‘ziapi::http::Response::status_code’ should be initialized in the member initialization list [-Weffc++]
    ziapi/Http.hpp:33:8: warning: ‘ziapi::http::Response::reason’ should be initialized in the member initialization list [-Weffc++]
    ziapi/Http.hpp:33:8: warning: ‘ziapi::http::Response::fields’ should be initialized in the member initialization list [-Weffc++]
    ziapi/Http.hpp:33:8: warning: ‘ziapi::http::Response::body’ should be initialized in the member initialization list [-Weffc++]
    
    ziapi/Http.hpp:16:8: warning: ‘ziapi::http::Request::version’ should be initialized in the member initialization list [-Weffc++]
       16 | struct Request {
          |        ^~~~~~~
    ziapi/Http.hpp:16:8: warning: ‘ziapi::http::Request::method’ should be initialized in the member initialization list [-Weffc++]
    ziapi/Http.hpp:16:8: warning: ‘ziapi::http::Request::target’ should be initialized in the member initialization list [-Weffc++]
    ziapi/Http.hpp:16:8: warning: ‘ziapi::http::Request::fields’ should be initialized in the member initialization list [-Weffc++]
    ziapi/Http.hpp:16:8: warning: ‘ziapi::http::Request::body’ should be initialized in the member initialization list [-Weffc++]
    

    Your environment

    • OS and version: PopOs (v 21.10)
    • branch that causes this issue: main

    Steps to reproduce

    Use -Wall -Wextra -Weffc++ compilation flags.

    Warnings are located in Http.hpp lines 16 and 33.

    bug 
    opened by Victoire-Rabeau 5
  • [FEATURES] [Modify Pop() function prototype of IResponseInputQueue]

    [FEATURES] [Modify Pop() function prototype of IResponseInputQueue]

    [FEATURES] [Modify Pop() function prototype of IResponseInputQueue]

    Description

    Hard to determine if std::pair<Request, Context> has been filled. For example, if we implement the Pop function like this:

    std::pair<Request, Context> MyResponseInputQueue::Pop()
    {
        if(myContainer.Size() == 0)
            return {};
        return myContainer.Pop();
    }
    

    If the function returns {}, the default constructors of Request and Context will be called, which will make it harder to know if the std::pair has been filled.

    Describe the solution you'd like

    Change the prototype of the Pop() function with:

    virtual bool Pop(std::pair<Request, Context> &req) = 0;
    

    Now we can implement the new function :

    bool MyResponseInputQueue::Pop(std::pair<ziapi::http::Request, ziapi::http::Context> &req)
    {
        if (myContainer.Size() == 0)
            return false;
        req = myContainer.Pop()
        return true;
    }
    

    And use it like that :

    
    IResponseInputQueue* networkQueue = new ...;
    std::pair<ziapi::http::Request, ziapi::http::Context> req;
    while (networkQueue->Pop(req) {
        //process new request
     }
    opened by ArthurVasseur 3
  • feat: keep-alive key in http header constant

    feat: keep-alive key in http header constant

    just added the key value for "keep alive"

    Description

    I canot found the key "keep alive" in http header constants so i added it.

    Breaking changes

    new value available in http header constants

    Additional Changes

    Checklist

    • [x] I have assigned this PR to myself
    • [ ] I have added at least 1 reviewer
    • [x] I have tested this code
    • [x] I have added sufficient documentation and/or updated documentation to reflect my changes

    Additional comments

    Please post additional comments in this section if you have them, otherwise delete it.

    opened by antwxne 1
  • Returning references with AsString method

    Returning references with AsString method

    Description

    Why returning a copy instead of a reference in the AsString method in struct Node ? String AsString() const { return std::get<String>(*this); } It's a good practice to return references instead of copies.

    Is your feature request related to a problem? Please describe.

    I'm frustrated because I can't return const references with my configuration because it's causing a warning during compilation.

    Describe the solution you'd like

    Return references or const references.

    enhancement 
    opened by Pepiloto 1
  • Request structure documentation

    Request structure documentation

    Description

    This PR adds some doc for the target member of the Request structure. It also reorders the members so that it corresponds to the order it is in the HTTP request. It also renames the fields field to headers. For more explanations refer to the commits

    Breaking changes

    The order change of the structure members might break some structure constructions which rely on the order of the structure members. The name of the field fields changed to headers

    Checklist

    • [ ] I have assigned this PR to myself
    • [ ] I have added at least 1 reviewer
    • [x] I have tested this code
    • [x] I have added sufficient documentation and/or updated documentation to reflect my changes
    opened by Breigner01 1
  • Bad type in IResponseInputQueue::Pop

    Bad type in IResponseInputQueue::Pop

    Description

    it returns a Request 😢

    class IResponseInputQueue {
    public:
        virtual ~IResponseInputQueue() = default;
    
        virtual std::pair<Request, Context> Pop() = 0;
    
        [[nodiscard]] virtual std::size_t Size() const noexcept = 0;
    };
    

    Expected behaviour

    it should return a Response

    Proposed solution

    class IResponseInputQueue {
    public:
        virtual ~IResponseInputQueue() = default;
    
        virtual std::pair<Response, Context> Pop() = 0;
    
        [[nodiscard]] virtual std::size_t Size() const noexcept = 0;
    };
    
    bug 
    opened by antwxne 1
  • Version/3.0.0

    Version/3.0.0

    Description

    This pull request closes #18, closes #19, closes #20, closes #21, closes #22 and contains all changes made in version 3.0.0 of ZIAPI

    Breaking Changes

    • Update ziapi::Version class to match versioning system of the ZIAPI project
    • Update ziapi::config::Node so that it uses smart pointers instead of raw pointers
      • Add MakeDict and MakeArray static factory methods
      • Drop constructors of ziapi::config::Node that use std::initializer_list
    • Update ziapi::INetworkModule::Run() documentation. This call is now expected to be blocking

    Additional Changes

    • Add documentation on the set of standards and best practices for developing ZIAPI modules
    • Bump dylib version from 1.7.1 to 1.8.1
    • Improve issue templates and pull request templates
    • Update documentation to reflect said changes
    • Fix compilation warning

    Checklist

    • [X] I have assigned this PR to myself
    • [X] I have added at least 1 reviewer
    • [X] I have tested this code
    • [X] I have added sufficient documentation in the code
    opened by Romain-1 1
  • String as key in http context

    String as key in http context

    [BUG] on peut mettre n'importe quoi comme key

    Description

    "client" = structure client

    mais les modules des autres groupes n'implementeront pas la value "client" sous forme de structure.

    A voir si on peut pas imposer une nome / faire un enum

    histoire que tout le monde utilise la meme chose

    voir meme utiliser un data type comme celui du json

    enhancement 
    opened by antwxne 1
  • Warning on windows

    Warning on windows

    [BUG] Warning on windows

    Description

    When compiling , a lot of warning C4458 appear due of same member name, and function parameters name.

    Your environment

    • OS: Windows
    • Environement: Visual Studio 2019 (occure on higher version)
    • Branch: main

    Steps to reproduce

    Warning appear at compilation time.

    Expected behaviour

    No warning should appear.

    Actual behaviour

    6 warning C4458 appear. (see Logs)

    Logs

    ziapi-prefix\src\ziapi\include\ziapi\Http.hpp(47,25): warning C4458:  la déclaration de 'status_code' masque le membre de classe
    ziapi-prefix\src\ziapi\include\ziapi\Http.hpp(38,10): message :  voir la déclaration de 'ziapi::http::Response::status_code'
    ziapi-prefix\src\ziapi\include\ziapi\Http.hpp(47,62): warning C4458:  la déclaration de 'reason' masque le membre de classe
    ziapi-prefix\src\ziapi\include\ziapi\Http.hpp(41,17): message :  voir la déclaration de 'ziapi::http::Response::reason'
    ziapi-prefix\src\ziapi\include\ziapi\Http.hpp(47,92): warning C4458:  la déclaration de 'version' masque le membre de classe
    ziapi-prefix\src\ziapi\include\ziapi\Http.hpp(35,13): message :  voir la déclaration de 'ziapi::http::Response::version'
    ziapi-prefix\src\ziapi\include\ziapi\Http.hpp(47,25): warning C4458:  la déclaration de 'status_code' masque le membre de classe
    ziapi-prefix\src\ziapi\include\ziapi\Http.hpp(38,10): message :  voir la déclaration de 'ziapi::http::Response::status_code'
    ziapi-prefix\src\ziapi\include\ziapi\Http.hpp(47,62): warning C4458:  la déclaration de 'reason' masque le membre de classe
    ziapi-prefix\src\ziapi\include\ziapi\Http.hpp(41,17): message :  voir la déclaration de 'ziapi::http::Response::reason'
    ziapi-prefix\src\ziapi\include\ziapi\Http.hpp(47,92): warning C4458:  la déclaration de 'version' masque le membre de classe
    \ziapi-prefix\src\ziapi\include\ziapi\Http.hpp(35,13): message :  voir la déclaration de 'ziapi::http::Response::version'
    

    Proposed solution

    Change function parameters or member name.

    bug 
    opened by DipStax 1
  • Version 5.0.2

    Version 5.0.2

    Description

    Please provide a detailed description of what was done in this PR.

    Breaking changes

    Please complete this section if any breaking changes have been made, otherwise delete it.

    Additional Changes

    Checklist

    • [ ] I have assigned this PR to myself
    • [ ] I have added at least 1 reviewer
    • [ ] I have tested this code
    • [ ] I have added sufficient documentation and/or updated documentation to reflect my changes

    Additional comments

    Please post additional comments in this section if you have them, otherwise delete it.

    opened by rojas-diego 0
  • My Bug Report

    My Bug Report

    Description

    Bonjour,

    J'ai remarqué une erreur inadmissible dans le fichier 'HttpConstants.hpp'. Effectivement une coquille s'est glissée dans dans le namespace 'ziapi::http::reason'. La constexpr auto kConflicT = " Conflict" possède un T majuscule en dernier caractère de son nom. J'accepte de vous pardonner, si et seulement si le nom de cette constexpr est changé par kConflict. (avec un t minuscule)

    Cordialement,

    Login : [email protected] Membre de : Paris Anniversaire: 06/11/2001 Numéro de téléphone: +33 06 99 20 68 50 Localisation: 26 rue Gabriel Peri, Yerres, France (La cité de Ninho) GPA: 2.59

    bug 
    opened by Maxime-glm 0
Releases(v5.0.1)
  • v5.0.1(Mar 6, 2022)

  • v5.0.0(Mar 1, 2022)

    Breaking changes

    • IPostProcessorModule::PostProcess now takes a const ziapi::http::Request & object as its second positional argument.

    Additional Changes

    • Review naming conventions for unit test descriptions.
    • Add ziapi::http::RequestInputQueue::ValueType and ziapi::http::ResponseOutputQueue::ValueType
    Source code(tar.gz)
    Source code(zip)
  • v4.0.0(Feb 25, 2022)

    What's Changed

    • feat: keep-alive key in http header constant by @antwxne in https://github.com/martin-olivier/ZiAPI/pull/34
    • Wait() documentation of method of queue.
    • ShouldPostProcess now has access to the request .

    New Contributors

    • @antwxne made their first contribution in https://github.com/martin-olivier/ZiAPI/pull/34

    Full Changelog: https://github.com/martin-olivier/ZiAPI/compare/v3.1.1...v4.0.0

    Source code(tar.gz)
    Source code(zip)
  • v3.1.1(Feb 20, 2022)

    What's Changed

    • Feat/build conf vectors by @edouard-sn in https://github.com/martin-olivier/ZiAPI/pull/27
    • Request structure documentation by @Breigner01 in https://github.com/martin-olivier/ZiAPI/pull/28
    • feat: Wait() virtual pure on IResponseInputQueue by @edouard-sn in https://github.com/martin-olivier/ZiAPI/pull/30
    • Changed variable name fields of Response & Request structs to headers

    New Contributors

    • @edouard-sn made their first contribution in https://github.com/martin-olivier/ZiAPI/pull/27
    • @Breigner01 made their first contribution in https://github.com/martin-olivier/ZiAPI/pull/28

    Full Changelog: https://github.com/martin-olivier/ZiAPI/compare/v3.0.0...v3.1.1

    Source code(tar.gz)
    Source code(zip)
  • v3.1.0(Feb 20, 2022)

  • v3.0.0(Feb 8, 2022)

    Breaking Changes

    • Update ziapi::Version class to match versioning system of the ZIAPI project
    • Update ziapi::config::Node so that it uses smart pointers instead of raw pointers
      • Add MakeDict and MakeArray static factory methods
      • Drop constructors of ziapi::config::Node that use std::initializer_list
    • Update ziapi::INetworkModule::Run() documentation. This call is now expected to be blocking

    Additional Changes

    • Add documentation on the set of standards and best practices for developing ZIAPI modules
    • Bump dylib version from 1.7.1 to 1.8.1
    • Improve issue templates and pull request templates
    • Update documentation to reflect said changes
    • Fix compilation warning
    Source code(tar.gz)
    Source code(zip)
  • v2.2.0(Feb 5, 2022)

    Changelog

    • Numeric HTTP constants are now typed as enums
    • All constants have been renamed according to the C++ Google Coding Style
    • The return value of the http::IResponseQueue::Pop method has been updated to return an std::optional
    • The return value of the http::IResponseQueue::Pop now features a std::pair<Response, Context> instead of a std::pair<Request, Context>.
    • The INetworkModule now correctly inherits from IModule
    Source code(tar.gz)
    Source code(zip)
  • v2.1.0(Feb 2, 2022)

    Description

    Fixes and improves some of the features introduced in version 2.0.

    Changes

    • Additional documentation for Config
    • Boolean operator on Node to check if its valid (not null and not undefined)
    • Removed Node variadic constructor
    Source code(tar.gz)
    Source code(zip)
  • v2.0.0(Jan 29, 2022)

    Breaking changes

    • The ziapi::Logger now supports variadic arguments replacing the old implementation.
    • ziapi::IModule::Run() is now a pure virtual method.
    • ziapi::Config has been removed in favor of ziapi::config::Node which features an improved configuration management model.

    Additional changes

    • The documentation has been updated to reflect said changes.
    • The documentation now enforces a convention for retrieving modules from shared libraries.
    • Additional constants of the HTTP/1.1 protocol have been added to the ziapi::http::header namespace.

    Comments

    Further documentation about the ziapi::config::Node class will be added shortly. For now, check the unit tests linked to that feature to learn about its usage.

    Source code(tar.gz)
    Source code(zip)
  • v1.0.0(Jan 23, 2022)

A small C library for building user interfaces with C, XML and CSS

LCUI A small C library for building user interfaces with C, XML and CSS. Table of contents Table of contents Introduction Features Screenshots Related

Liu 3.9k Dec 27, 2022
Library for writing text-based user interfaces

Termbox for RT-Thread 中文说明文档 This repository forks from nullgemm/termbox_next Getting started Termbox's interface only consists of 12 functions: tb_in

Meco Jianting Man 5 May 25, 2022
Arcan is a powerful development framework for creating virtually anything from user interfaces

Arcan is a powerful development framework for creating virtually anything from user interfaces for specialized embedded applications all the way to full-blown standalone desktop environments.

Bjorn Stahl 1.3k Dec 26, 2022
GTK is a multi-platform toolkit for creating graphical user interfaces.

GTK — The GTK toolkit General information GTK is a multi-platform toolkit for creating graphical user interfaces. Offering a complete set of widgets,

GNOME Github Mirror 1.1k Dec 31, 2022
A simple/fast stacking box layout library. It's useful for calculating layouts for things like 2D user interfaces.

A simple/fast stacking box layout library. It's useful for calculating layouts for things like 2D user interfaces. It compiles as C99 or C++. It's tested with gcc (mingw64), VS2015, and clang/LLVM. You only need one file to use it in your own project: layout.h.

Andrew Richards 713 Dec 28, 2022
A wallpaper changer using Wallhaven api. Written with C++/CLR, only 0.5 MB and have a GUI.

WHaven Wallpaper WHaven Wallpaper is a desktop wallpaper change program for change your wallpapers directly from wallhaven. Features You have a search

null 2 Aug 1, 2022
NWM is a simple window manager for linux which uses Xlib for managing windows

NWM is a simple window manager for linux which uses Xlib for managing windows.

Kumar Gaurav Pandey 18 Nov 27, 2022
Yoga is a cross-platform layout engine which implements Flexbox

Yoga Building Yoga builds with buck. Make sure you install buck before contributing to Yoga. Yoga's main implementation is in C++, with bindings to su

Meta 15.8k Jan 8, 2023
onnxruntime C Api wrapped for nim

onnxruntime-nim onnxruntime C Api wrapped for nim Wrapped C Api is generated using c2nim Onnxruntime Home Page Onnxruntime Github Header file onnxrunt

null 14 Apr 7, 2022
A lightweight modern C++11 library for Win32 API, using lambdas to handle Windows messages.

WinLamb A lightweight modern C++11 library for Win32 API, using lambdas to handle Windows messages. Overview Setup Example Classes summary License 1.

Rodrigo 239 Dec 28, 2022
This is gtkmm, the C++ API for GTK.

This is gtkmm, the C++ API for GTK.

GNOME Github Mirror 136 Jan 6, 2023
An implementation of node editor with ImGui-like API.

Node Editor in ImGui About An implementation of node editor with ImGui-like API. Project purpose is to serve as a basis for more complex solutions lik

Michał Cichoń 2.4k Jan 9, 2023
This is a thin c-api wrapper programmatically generated for the excellent C++ immediate mode gui Dear ImGui.

cimgui This is a thin c-api wrapper programmatically generated for the excellent C++ immediate mode gui Dear ImGui. All imgui.h functions are programm

Victor Bombi 22 Jul 5, 2021
An automatically updated mirror of the Irrlicht SVN repository on sourceforge

========================================================================== The Irrlicht Engine SDK version 1.9 =======================================

Dezső Zoltán 431 Dec 22, 2022
This project aims to simplify creation of basic Arduino programs by just editing a UI on Android.

ArdUI A video explanation If you are more a fun of video explanation go to this youtube video Project aim This project aims to simplify creation of ba

Targist 21 Nov 19, 2022
Sample Unreal Engine 5.0.1 C++ Project That Incorporates Dear ImGui

UE5 With Dear ImGui A sample Unreal Engine 5.0.1 C++ project that incorporates the Dear ImGui graphical user interface library. YouTube Tutorial This

Kyle Geske 36 Dec 25, 2022
Free open-source modern C++17 / C++20 framework to create console, forms (GUI like WinForms) and unit test applications on Microsoft Windows, Apple macOS and Linux.

xtd Modern C++17/20 framework to create console (CLI), forms (GUI like WinForms) and tunit (unit tests like Microsoft Unit Testing Framework) applicat

Gammasoft 441 Jan 4, 2023
Latte is a dock based on plasma frameworks that provides an elegant and intuitive experience for your tasks and plasmoids.

Latte is a dock based on plasma frameworks that provides an elegant and intuitive experience for your tasks and plasmoids. It animates its contents by using parabolic zoom effect and trys to be there only when it is needed.

KDE GitHub Mirror 1.4k Jan 7, 2023
Build performant, native and cross-platform desktop applications with Node.js and CSS like styling. 🚀

NodeGui Build performant, native and cross-platform desktop applications with Node.js and CSS like styling. ?? NodeGUI is powered by Qt5 ?? which make

NodeGui 8.1k Dec 30, 2022