Giter Club home page Giter Club logo

alba-server's Introduction

Maintainability GitHub code size in bytes GitHub last commit

ALBA - Server

This repository contains the source code of the Alba Server, which connects to the ALBA mobile app. For more information about what is ALBA and the app, have a look at this other repo. Please note that both ALBA and ALBA-Server are currently on development and therefore they are potentially unstable.

The server project is written in C and it is POSIX compliant. It supports multiple simultaneous clients through a combination of multithreading and multiprocessing. DB management is handled with MySQL, and therefore you will need one MySQL local installation to run this software. Until the DB configuration script is ready, please read this for the configurations to be made.

Features overview (of the server)

  • Build a SocketServer and manage multiple clients on separate processes.
  • Construct a PING-PONG client-server system to manage disconnections on both sides.
  • Send and receive messages from clients using TCP sockets, defining an application layer protocol: the ALBAProtocol.
  • Construct a process-dependant circular queue to store requests and tasks for each client
  • Create a thread pool for each process, which retrieve elements from the process queue, ensuring minimum response times and maximizing performance.
  • Use mutex and conditional variables to avoid race conditions and ensure the critical sections are thread-safe. Also, implemented non-blocking socket read/write operations, maximizing resposiveness.
  • Implemented MySQL DB operations, which are always called from background threads, avoiding unnecessary wait times.
  • Constructed thread-safe program start and halt, without asynchronous cancellations.
  • Created a Parser in charge of translating socket messages into different codes according to the ALBAProtocol.
  • Send long messages by parts using JSON format and correctly announcing it comes divided into small chunks.

Roadmap

  • Implement more MySQL operations and tables according to different requests the client may send.
  • Define more operations for the client and server.
  • Accept different arguments at the program start, allowing for different modes.
  • Create a basic GUI (probably with QT5).
  • Keep ideas flowing.

Build and run

##Downloading the program
git clone git://github.com/h3xduck/alba-server.git

cd alba-server

##Build
make all

##Run
./server

Also, you will need to setup a MySQL DB with the following parameters:

  • Database name = "VERNOM"
  • GRANT acces to user = "Vernom" and password = "vernomPassword";

Note: Hardcoded passwords are not secure. This will change in the future.

Disclaimer

This is a personal side-project and by no means it is supposed to come with any warranty, it is offered AS-IS and I am not responsible of any harm derived from its use.

License

This project is released under the GPL v3 license. See LICENSE.

alba-server's People

Contributors

h3xduck avatar

Watchers

 avatar  avatar

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.