Why HappyX? πββοΈ
July 24, 2024 Β· View on GitHub
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 β‘
- Multiple options for HTTP server! Happyx use
asynchttpserveras default HTTP server (httpxvia-d:happyxHttpx,httpbeastvia-d:happyxBeastandmicrohttpservervia-d:happyxMicroas alternative HTTP servers). - Support
SPAonJSbackend andSSRon other backends. - Build HTML, CSS and pure JS with
buildHtml,buildStyleandbuildJsmacros. - Request models that supports
JSON/XML/Form-Data/x-www-form-urlencodedwithmodelmacro. - Routing and powerful path params.
- Assignment path params with
pathParamsmacro. - Powerful mounting sub-applications with
mountmacro. - Logging with
-d:debug. - Automatic translate with
-d:hpxTranslateor-d:translateflags. - CLI tool for
creating,servingandbuildingyour projects. - Hot code reloading (only for
SPAprojects as of now). - Python bindings
- NodeJS bindings
Minimal Example π©βπ»
| SPA | SSR |
|
|
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? π
Have A Nice Idea? π
Open issue or contact us hapticx.company@gmail.com
Contributing π
See Contributing.md for more information