Coder Social home page Coder Social logo

anya-cxx's Introduction

Anya

Gitter

Tech stack:

  • C++20
  • Drogon Web Framework
  • Postgresql
  • glaze-json

Setup and installation

For Windows users:

Please set WSL if not done already done with the following details:

  • use version 2
  • use a Debian-based distro

Open the Linux CLI and follow the guide.

For Linux users:

Check if your Linux distribution is based on Debian if not then please lookup into setup/Makefile in the repository and find suitable packages for installation.

Further guide is focused on users having Debian.

Guide:

Follow the below steps:

  • Step 1: Clone

    cd to your working directory and clone the repository. we will refer to the working directory as <work-dir>.

    cd \<work-dir>;
    sudo apt-get install git -y;
    sudo apt-get update;
    git clone https://github.com/rishiagl/anya-cxx.git 
  • Step 2: Install PostgresSQL

    Install PostgreSQL using the setup Makefile.

    cd anya-cxx/setup;
    sudo apt-get install make -y;
    sudo apt-get update;
    make postgres;

    now check the version of Postgres installed

    psql -V
  • Step 3: Setup PostgresSQL

    • Change the password of the Postgres user created during installation. (do not confuse this user with a database user, this user is an OS user).

      sudo passwd postgres;
    • start the database server

      sudo service postgresql start;
    • run psql

      sudo -u postgres psql;
    • Now change the password of postgres user(Default database user created during installation)

      ALTER USER user_name WITH PASSWORD 'new_password';
    • Quit psql

      \q
    • Change config.json

      In anya-cxx(root) directory you'll find a file named config.json, in line no 18 add the <new_password> which you added 2 steps back.

    Now your PostgreSQL is up and running with very very minimal configuration, for production use please read the further blog on Securing your PostgreSQL server.

  • Step 4: Install Web Framework and Build System
    (Make Sure you are in the setup directory)

    make install;
  • Step 5: Build and Run (Assuming you are in the setup directory)

    • Go to build directory

      cd ../build;
    • Run cmake

      sudo cmake ..
    • Run make

      sudo make
    • Run

      ./anya

API Reference

Company:

Relational Structure(Schema):

Feature Data Type Constraint
pid integer auto generated
sid string auto generated
name string unrestricted text
address string unrestricted text
city string unrestricted text
state string unrestricted text
country string unrestricted text
cin string size == 21
pan string size == 10
gstin string size == 15

CRUD Api Endpoints:

prefix = http://:/rest/api/company

URI HTTP Metthod Use Request Content type Response Content type
<prefix> GET Get all Companies None JSON
<prefix> POST Add single company JSON Plain Text
<prefix>/{pid} GET Get a single company None JSON
<prefix>/{pid} PUT Update a single company JSON Plain Text
<prefix>/{pid} DELETE Delete a single company None Plain Text

Like-wise much more real-world entity's CRUD API has been implemented which will be documented in further iterations.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.