HappyX
| Original author(s) | Ethosa |
|---|---|
| Developer(s) | HappyX contributors.[1] |
| Initial release | June 2023[2] |
| Stable release | 2.6.1
/ August 23, 2023 |
| Repository | github |
| Written in | Nim[3] |
| Engine | |
| Operating system | Cross-platform |
| Platform | IA-32, x86-64, ARM, Aarch64, RISC-V, PowerPC ...[4] |
| Size | 0.2 MB[5] |
| Type | Web framework |
| License | MIT License |
| Website | https://hapticx.github.io/happyx |
Search HappyX on Amazon.
HappyX is a free and open-source macro-oriented full-stack web framework written in Nim.
Product-ready projects have a very small size due to metaprogramming (macro-oriented). HappyX compiles only those parts of the framework that the developer uses.
HappyX allows you to create Server-side scripting, static site generation and single-page applications.
Inspired By
HappyX is inspired by other web frameworks: Vue.js, React.js, FastAPI.
The components[6] came from Vue.js and React.js. Powerful routes, request models[7] came from FastAPI.
Server-Side
HappyX provides efficient server-side functionality with a powerful routing system, request models, CORS and template processor.
Server-side HappyX projects are very fast[8]
Hello, World!
Here is a "Hello, world!" example for HappyX server-side.
import happyx # import framework. It's required
# Launch server at http://127.0.0.1:5000/
serve "127.0.0.1", 5000:
# on GET method at /
get "/":
# Respond
return "Hello, world!"
Client-Side
HappyX provides efficient client-side functionality with a powerful routing system and components.
Hello, World!
Here is a "Hello, world!" example for HappyX client-side.
import happyx # import framework. It's required
# application start point (in tag with ID="app")
appRoutes "app":
# on example.com/#/
"/":
# Write HTML
tDiv:
"Hello, world!"
Routing System
HappyX has a powerful routing system. There are path parameters and request model support. It’s optimized and fast due to metaprogramming.
Example
# Declare Request model
model MyModel:
# Field "name" of type "string" with default value "Ethosa"
name: string = "Ethosa"
serve "127.0.0.1", 5000:
# /user/ is allowed
# /user/1 is allowed
# /user/asd is denied
get "/user/$id?:int":
# Developer may use path parameter as an immutable variable
# due to metaprogramming
echo id
# Respond JSON
return {"response": id}
# / with JSON body
# {"name": "..."}
post "/[m:MyModel]":
echo m.name
return {"response": m.name}
Version History
HappyX has been developed since April 2023.
| Version | Release date | Release Notes | Nim version |
|---|---|---|---|
| 0.27.1 | May 26, 2023 | release notes | 1.6.12 |
| 1.0.0 | June 1, 2023 | release notes | 1.6.12 |
| 1.7.1 | July 1, 2023 | release notes | 1.6.14 |
| 1.8.1 | July 3, 2023 | release notes | 1.6.14 |
| 1.9.0 | July 15, 2023 | release notes | 1.6.14 |
| 1.10.1 | July 26, 2023 | release notes | 1.6.14 |
| 1.12.0 | July 30, 2023 | release notes | 1.6.14 |
| 2.0.0 | August 09, 2023 | release notes | 1.6.14 |
| 2.6.1 | August 23, 2023 | release notes | 1.6.14 |
Old version Older version, still supported Latest version | |||
See also
- Comparison of web frameworks
- Web frameworks benchmark
- HappyX RestAPI tutorial series
- HappyX documentation
References
- ↑ "HappyX contributors". GitHub. 2023-07-15. Retrieved 2023-07-16.
- ↑ Ethosa (June 1, 2023). "HappyX first major release". GitHub. Retrieved June 1, 2023.
- ↑ "Install Nim". Retrieved 2023-07-01.
- ↑ "Packaging Nim". Retrieved 2023-07-01.
- ↑ "HappyX Download". GitHub. Retrieved 2023-07-01.
- ↑ "HappyX Components". May 9, 2023.
- ↑ "HappyX Request models". 2023-05-19.
- ↑ "Web frameworks benchmark". 2023-07-17. Retrieved 2023-07-19.
This article "HappyX" is from Wikipedia. The list of its authors can be seen in its historical and/or the page Edithistory:HappyX. Articles copied from Draft Namespace on Wikipedia could be seen on the Draft Namespace of Wikipedia and not main one.

