Getting Started
Welcome to Rix.
Rix is the unified userland library layer for Vix.cpp applications.
It gives Vix C++ projects optional packages and one clean facade API:
#include <rix.hpp>
int main()
{
rix.debug.print("Hello", "Rix");
auto auth = rix.auth.memory();
return 0;
}Rix does not replace Vix.cpp.
Vix.cpp provides the runtime, CLI, build workflow, registry integration, and core foundations.
Rix provides application-level packages built on top of Vix.cpp.
Vix.cpp -> runtime, CLI, build workflow, registry, core modules
Rix -> optional userland packages and unified facadeWhat you will learn
This getting started section shows how to:
- understand what Rix is
- install Rix in a Vix.cpp project
- use the unified
rixfacade - run a first Rix example
- understand when to use the facade or an independent package
The basic idea
Install the Rix facade package:
vix add @rix/rix
vix installInclude the main header:
#include <rix.hpp>Use the mounted package APIs through the global rix object:
rix.debug.print("Hello", "Rix");
auto auth = rix.auth.memory();Current focus
This documentation starts with rix/auth.
rix/auth provides authentication helpers for Vix.cpp applications:
- user registration
- login
- password hashing
- sessions
- tokens
- logout
- explicit error handling
Example:
#include <rix.hpp>
int main()
{
auto auth = rix.auth.memory();
auto registered = auth.register_user({"ada@example.com","correct-password"});
if (registered.failed())
{
const auto &error = registered.error();
rix.debug.eprint(
"auth error:",
rix.auth.error.to_string(error),
error.message()
);
return 1;
}
rix.debug.print("registered:", registered.value().email());
return 0;
}Recommended path
Read these pages in order:
Then continue with:
What you should remember
Rix is used from normal C++ code.
#include <rix.hpp>The public API should prefer the facade:
rix.authThe lower-level rixlib::... namespaces are available for advanced usage, independent package usage, and implementation details.
Use Vix.cpp commands to work with the project:
vix add @rix/rix
vix install
vix build
vix run
vix testsNext step
Learn what Rix is and how it relates to Vix.cpp.
Next: What is Rix?