GithubHelp home page GithubHelp logo

phtdacosta / ptahka Goto Github PK

View Code? Open in Web Editor NEW
17.0 3.0 4.0 27 KB

Simple and fast micro framework for building web applications in C

License: MIT License

Makefile 4.42% C 95.58%
c web-framework backend web-backend fast productive asynchronous native c99 http-server

ptahka's Introduction

Ptahka logo

Ptahka

The godlike web framework using almighty technologies to face modern challenges

HitCount Build status Average time to resolve an issue Percentage of issues still open Ptahka integration status Ptahka integration status

main method in 3 lines

// Group where all routes are added
table_t *table = inittable();

// Create customizable HTTP routes 
createroute("GET",       // HTTP method
            "/home",     // Resource route
            &Homepage,   // Function pointer
            table);      // Route group

// Fires the server engine forever
initservice(&parserequest, table, &executeroute, NULL);

Brutally fast, period.

Ptahka is brutally fast. Built from scratch using just plain C language and specially written functions on top of the most performant Windows NT4 networking API, you can truly expect the ultimate performance available on any machine.

Extra technical information for the geeks

High modularity in core aspects of a project often means easier tweaks, higher adaptability and consequently, more performance.

One of the two parts that composes Ptahka is Gobio, powering all low-level networking stuff, input and output strategy (further information here), multi-threading and the general socket behavior. Gobio benchmarks shows 3.87x more speed than NodeJS which relies on the same pillars when running on Windows, ouch!

The second part is Tinfin which contains useful specialized functions, for handling protocols of a higher level more intuitively.

Focused on productivity

The design patterns were inspired by very popular frameworks like Flask, Falcon (both written in Python) and NodeJS. Like those, Ptahka achitecture allows developers to rapidly prototype and build server solutions, from microservices to full-featured API's.

Born modular and scalable

It was born modular since the whole framework is just two other smaller projects tied up with some magic dust. Gobio brings high-performance socket support and Tinfin specialized protocol handling. Feel free to modify both or even replace them.

Scalability is achieved thru the Makefile script available within the project. It is enough to automatically compiles any other source files (*.c) that small or medium projects could ever need, and may be even useful for big projects as well.

Easily extensible and widely compatible

Written in pure and plain C99, Ptahka API can be easily extended by any other language that extend C language, like C++, D, Go, Rust, Python, Lua, NodeJS and so on, making the project reliable enough to become a solution anywhere.

The stability of the Winsock 2 API (which was first implemented for Windows 95) makes it perfect to be used on any Windows NT4 compatible (legacy ones included) project.

Download, build and run

> git clone https://github.com/phtdacosta/ptahka.git
> cd ptahka
> make -B all
> main

Documentation

The documentation is going to be written gradually, but enough information regarding the basic usage of the framework is already available in the main file included.

Community and purpose

Ptahka was created with community in mind. Giving developers a reliable option to create native and extremely performant server applications (also focused in productivity, simplicity and modularity) let us shape better our future solutions using stable and time-tested tools. Faster web applications means efficient energy use on data warehouses which leads to less overall energy consumption. Performance is sustainability. Think about that. (I will write something about this in the future!)

Join the chat at https://gitter.im/ptahka/Lobby

License

Feel free to do whatever you want with the code. Ptahka is open source and MIT licensed.

Support

The whole project is maintained for just one person, so just-in-time support is almost impossible. But critical bugs and significant issues are going to be patched as soon as possible.

Milestones

  • Detailed documentation with advanced usage examples
  • Make Ptahka less bug prone as possible without making it slower
  • Further micro-optimizations and even broader machine support

ptahka's People

Contributors

gitter-badger avatar phtdacosta avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  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.