HapticX / happyx

Macro-oriented asynchronous web-framework written in Nim with β™₯
https://hapticx.github.io/happyx/
MIT License
545 stars 19 forks source link
backend frontend full-stack hacktoberfest happyx http-server javascript nim open-source python server spa ssg ssr typescript web web-framework
### Macro-oriented asynchronous full-stack web-framework written in Nim with β™₯ ![Nim language](https://img.shields.io/badge/>=1.6.14-1b1e2b?style=for-the-badge&logo=nim&logoColor=f1fa8c&label=Nim&labelColor=2b2e3b) ![Python language](https://img.shields.io/badge/>=3.7.x-1b1e2b?style=for-the-badge&logo=python&logoColor=f1fa8c&label=Python&labelColor=2b2e3b) ![JavaScript language](https://img.shields.io/badge/ES6-1b1e2b?style=for-the-badge&logo=javascript&logoColor=f1fa8c&label=JavaScript&labelColor=2b2e3b) ![TypeScript language](https://img.shields.io/badge/>=5.2.2-1b1e2b?style=for-the-badge&logo=typescript&logoColor=f1fa8c&label=TypeScript&labelColor=2b2e3b) [![wakatime](https://wakatime.com/badge/user/eaf11f95-5e2a-4b60-ae6a-38cd01ed317b/project/bbd13748-36e6-4383-ac40-9c4e72c060d1.svg?style=for-the-badge)](https://wakatime.com/badge/user/eaf11f95-5e2a-4b60-ae6a-38cd01ed317b/project/bbd13748-36e6-4383-ac40-9c4e72c060d1) [![Testing](https://img.shields.io/github/actions/workflow/status/HapticX/HappyX/tests.yml?label=Testing&logo=github&style=for-the-badge)](https://github.com/HapticX/happyx/actions/workflows/tests.yml) [![Documentation](https://img.shields.io/badge/Documentation-2b2e3b?style=for-the-badge&logo=data:image/svg%2bxml;base64,PHN2ZyB3aWR0aD0iODAwcHgiIGhlaWdodD0iODAwcHgiIHZpZXdCb3g9IjAgMCAyNCAyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4NCjxwYXRoIGQ9Im05IDExYy0wLjU1MjI4IDAtMSAwLjQ0NzctMSAxczAuNDQ3NzIgMSAxIDFoNmMwLjU1MjMgMCAxLTAuNDQ3NyAxLTFzLTAuNDQ3Ny0xLTEtM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DFjMC0uMDAxIDAtLjAwMi0uNjU1LS4zNjZsLjY1NS4zNjVBLjc1NC43NTQgMCAwMDE0IDExVjcuNzVhLjc0Ny43NDcgMCAwMC0uMTE4LS40MDRsMS40MzQtLjY2NmEuNzUuNzUgMCAwMDAtMS4zNmwtNy0zLjI1ek0xMi41IDcuOTg4TDguMzE2IDkuOTNhLjc1Ljc1IDAgMDEtLjYzMiAwTDMuNSA3Ljk4OHYyLjcyM2E1LjU4NSA1LjU4NSAwIDAwLjk5Ljc3NmMuODA0LjUgMi4wNDMgMS4wMTMgMy43NiAxLjAxMyAxLjcxMyAwIDIuODEtLjUxIDMuNDY4LS45ODRhMy44MTIgMy44MTIgMCAwMC43ODItLjc0NVY3Ljk4OHpNOCA4LjQyM0wyLjc4MSA2IDggMy41NzcgMTMuMjE5IDYgOCA4LjQyM3oiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZmlsbD0iI2YxZmE4YyIgZmlsbC1ydWxlPSJldmVub2RkIi8+PC9zdmc+&label=HappyX&labelColor=3b3e4b)](https://github.com/HapticX/happyx-tutorial-series) [![VS Code Plugin](https://img.shields.io/badge/Plugin-1b1e2b?style=for-the-badge&logo=visualstudiocode&logoColor=f1fa8c&label=VS%20Code&labelColor=2b2e3b)](https://github.com/HapticX/hpx-vs-code) [![Python Bindings](https://img.shields.io/badge/Bindings-1b1e2b?style=for-the-badge&logo=python&logoColor=f1fa8c&label=Python&labelColor=2b2e3b)](https://pypi.org/project/happyx/) [![NodeJS Bindings](https://img.shields.io/badge/Bindings-1b1e2b?style=for-the-badge&logo=npm&logoColor=f1fa8c&label=NodeJS&labelColor=2b2e3b)](https://www.npmjs.com/package/happyx)

Why HappyX? πŸ’β€β™€οΈ

HappyX is a web framework with asynchronous, macro-oriented, full stack support.

In HappyX you can write single page, static site generation and server side rendering applications πŸ’‘

You can write Rest API with HappyX also πŸ”Œ

HappyX is very simple to use. Keep your peace of mind πŸ™‚

Why Not Jester/Karax? πŸ€”

Jester and Karax have many features, but Jester is a backend web framework, and Karax is a frontend web framework. HappyX is a full-stack web framework that combines the features of Jester and Karax and slightly improves them πŸ› 

With HappyX you mustn't learn new libraries/frameworks to switch between frontend and backend. You can switch between them easily using HappyX ✌

HappyX is macro-oriented web framework so you mustn't write a lot of code ✨

Features ⚑

Minimal Example πŸ‘©β€πŸ’»

SPA SSR
import happyx

    appRoutes "app":
      "/":
        "Hello, world!"
import happyx

    serve "127.0.0.1", 5000:
      "/":
        "Hello, world!"

Get Started πŸ‘¨β€πŸ”¬

Installing πŸ“₯

Nimble

nimble install happyx@#head

Nimble via Git

nimble install https://github.com/HapticX/happyx

PyPI

pip install happyx

Usage β–Ά

SSR

hpx create --name ssr_project --kind SSR
cd ssr_project/src

Main script will be able in /ssr_project/src/main.nim

Run πŸ’»

HTTP Server Flag
Default no flags
Httpx -d:httpx
MicroAsyncHttpServer -d:micro
HttpBeast -d:beast

SPA

hpx create --name spa_project --kind SPA --path-params
cd spa_project

Main script will be able in /spa_project/src/main.nim

Run πŸ’»

Just run this command and see magic ✨

hpx dev --reload

Have A Question? πŸ‘€

StackOverflow

Have A Nice Idea? 🍍

Open issue or contact us hapticx.company@gmail.com

Contributing πŸŒ€

See Contributing.md for more information

Donate πŸ’°

Tinkoff

Star History ✨

Star History Chart