You can edit almost every page by Creating an account and confirming your email.

HappyX

From EverybodyWiki Bios & Wiki




HappyX
HappyX web framework
Original author(s)Ethosa
Developer(s)HappyX contributors.[1]
Initial releaseJune 2023; 2 years ago (2023-06)[2]
Stable release
2.6.1 / August 23, 2023
Repositorygithub.com/HapticX/happyx
Written inNim[3]
Engine
    Operating systemCross-platform
    PlatformIA-32, x86-64, ARM, Aarch64, RISC-V, PowerPC ...[4]
    Size0.2 MB[5]
    TypeWeb framework
    LicenseMIT License
    Websitehttps://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
    Old version, no longer supported: 0.27.1 May 26, 2023 release notes 1.6.12
    Old version, no longer supported: 1.0.0 June 1, 2023 release notes 1.6.12
    Old version, no longer supported: 1.7.1 July 1, 2023 release notes 1.6.14
    Old version, no longer supported: 1.8.1 July 3, 2023 release notes 1.6.14
    Old version, no longer supported: 1.9.0 July 15, 2023 release notes 1.6.14
    Old version, no longer supported: 1.10.1 July 26, 2023 release notes 1.6.14
    Old version, no longer supported: 1.12.0 July 30, 2023 release notes 1.6.14
    Older version, yet still supported: 2.0.0 August 09, 2023 release notes 1.6.14
    Current stable version: 2.6.1 August 23, 2023 release notes 1.6.14
    Legend:
    Old version
    Older version, still supported
    Latest version
    Latest preview version
    Future release


    See also

    References

    1. "HappyX contributors". GitHub. 2023-07-15. Retrieved 2023-07-16.
    2. Ethosa (June 1, 2023). "HappyX first major release". GitHub. Retrieved June 1, 2023.
    3. "Install Nim". Retrieved 2023-07-01.
    4. "Packaging Nim". Retrieved 2023-07-01.
    5. "HappyX Download". GitHub. Retrieved 2023-07-01.
    6. "HappyX Components". May 9, 2023.
    7. "HappyX Request models". 2023-05-19.
    8. "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.