-
Notifications
You must be signed in to change notification settings - Fork 34
Getting Started for Developers
Coming soon
The Lodestone codebase is divided into 2 parts: the frontend, and the Core.
The frontend is written in React and handles user interaction. Actions completed by the users are sent as HTTP Requests to the backend, and the response is then displayed back to the user.
The Core
is Lodestone's backend, written in Rust, where most of the server hosting takes place.
A brief breakdown of the code is given below. Previous knowledge of Rust and Rest APIs is necessary.
core
│ main.rs
=> entry point to the backend, invokes run
from lib.rs
│ lib.rs
│ │ run
=> completes the setup for the app, including initiating AppState
and API Routes
to expose
│ │ restore_instances
=> restore instances in C:/Users/%USER%/.lodestone
to restore the instance to memory
│ └─ AppState
=> global variable that is used and managed by a web server framework Axum
│
└───implementations
=> the code that defines an instance
│ └───generics
=> PENDING...
│ └───minecraft
=> normal Minecraft instances
│ └─ mod.rs
=> defines the MinecraftInstance
struct and all the methods it implements
└───traits
=> defines the traits the instances implements
│ └───mod.rs
│ │ InfoInstance
=> completes the setup for the app, including initiating AppState
and API Routes
to expose
│ └─ TInstance
=> generic trait that is a composition of multiple traits, implemented by the instances
└───handlers
=> defines the route handlers for Axum and communication with the frontend
└─ every file has one Router
that applies endpoints and a method to that endpoint.
└─ Every function also has an AuthBearer
that authenticates that the user has enough permissions to complete an action.
└───auth
=> code for users and authentication