Skip to content
forked from HapticX/happyx

Macro-oriented asynchronous web-framework written in Nim with ♥

License

Notifications You must be signed in to change notification settings

MCRusher/happyx

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Happyx

Macro-oriented asynchronous full-stack web-framework written in Nim with ♥

Nim language wakatime Testing

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 asynchttpserver as default HTTP server (httpx via -d:httpx and microhttpserver via -d:micro as alternative HTTP servers).
  • Support SPA on JS backend and SSG on other backends.
  • Build HTML and CSS with buildHtml and buildStyle macros.
  • Request JSON models with model macro.
  • Routing and powerful path params.
  • Assignment path params with pathParams macro.
  • Powerful mounting sub-applications with mount macro.
  • Logging with -d:debug.
  • CLI tool for creating, serving and building your projects.
  • Hot code reloading (only for SPA projects as of now).

Minimal Example 👩‍💻

SPA SSG
import happyx
appRoutes("app"):
  "/":
    "Hello, world!"
import happyx
serve("127.0.0.1", 5000):
  "/":
    "Hello, world!"

Get Started 👨‍🔬

Installing 📥

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

Usage ▶

SSG

hpx create --name ssg_project --kind SSG
cd ssg_project/src

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

Run 💻

Default Httpx microasynchttpserver
nim c -r -d:debug main
nim c -r -d:debug -d:httpx main
nim c -r -d:debug -d:micro main

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 Nice Idea? 🍍

Open issue or contact us [email protected]

Contributing 🌀

See Contributing.md for more information

Star History ✨

Star History Chart

About

Macro-oriented asynchronous web-framework written in Nim with ♥

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Nim 98.7%
  • HTML 1.3%