Project Templates
Project templates are the starting points generated by vix new. Each template creates a project with a different shape, depending on what the project is meant to become: a small Vix application, a production backend, a server-rendered web app, a Vue frontend with a Vix backend, a game project, or a reusable C++ library.
The template is not only a folder layout. It also decides which files are generated, which workflow is suggested after creation, how vix.app or CMake is used, which runtime resources are copied, and how the project is expected to grow.
vix new my-appWhen the command runs interactively, Vix lets you choose the project type. In non-interactive workflows, the template can be selected with flags or with --template.
Available templates
Vix currently provides these project templates:
Application
Backend
Web
Vue
Game
Library2
3
4
5
6
Each template has a different purpose. Choosing the right one matters because the generated files are meant to match the workflow of the project.
Application
The application template is the simplest Vix application shape. It creates a small C++ backend application with a vix.app manifest, a vix.json file, a minimal entry point, a basic test, and a module registry integration point.
vix new hello --appUse this template when you want a clean Vix application without the full backend production structure. It is a good starting point for small HTTP apps, experiments, internal tools, or applications that may later grow with vix modules.
hello/
include/
app/
ModuleRegistry.hpp
src/
main.cpp
app/
ModuleRegistry.cpp
tests/
vix.app
vix.json2
3
4
5
6
7
8
9
10
11
The important detail is the module registry. Even the simple application template keeps one stable place where generated application modules can be connected later.
Backend
The backend template creates a more structured production backend. It keeps main.cpp small and moves startup into AppBootstrap. It also generates route and middleware registries, health routes, API routes, response helpers, runtime resources, tests, and production-oriented metadata in vix.json.
vix new api --template backendUse this template when the project is a backend service or API that needs a clearer long-term structure from the beginning.
api/
include/api/
app/
presentation/
support/
src/
main.cpp
api/
app/
presentation/
support/
public/
views/
storage/
tests/
vix.app
vix.json2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
The backend template is also designed to work with application modules. Generated backend startup calls the generated module registration bridge, so feature modules can be added without turning AppBootstrap.cpp into a long list of manual includes.
Web
The web template creates a server-rendered Vix web application. It is different from the backend template because its main purpose is rendering HTML pages from views/ and serving static assets from public/.
vix new site --template webUse this template when the application should render pages on the server with the Vix template engine.
site/
include/site/
app/
presentation/
src/
main.cpp
site/
app/
presentation/
views/
base.html
header.html
index.html
dashboard.html
public/
app.css
app.js
storage/
tests/
vix.app
vix.json2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
The generated app configures templates and static files from the bootstrap:
app.templates("views");
app.static_dir("public", "/");2
Choose this template for server-rendered pages. Choose the backend template when the project is mainly an API service.
Vue
The Vue template creates a Vix C++ backend with a Vue frontend under frontend/. The backend remains a Vix application, while the frontend is managed by Vite.
vix new dashboard --template vueUse this template when you want a browser frontend built with Vue and a Vix backend serving API routes.
dashboard/
src/
main.cpp
include/
app/
frontend/
package.json
index.html
vite.config.js
src/
main.js
App.vue
vix.app
vix.json2
3
4
5
6
7
8
9
10
11
12
13
14
During development, the Vue app can call the backend through /api/*, and Vite proxies those requests to the Vix server.
/api -> http://localhost:8080This template should be understood as a combined project: Vue owns the frontend experience, and Vix owns the C++ backend.
Game
The game template creates a Vix game project. It links the game and IO modules, generates a game entry point, creates an assets/ directory, and includes game.package.json as runtime metadata.
vix new space-demo --gameor:
vix new space-demo --template gameA generated game project is centered on vix::game.
space-demo/
src/
main.cpp
assets/
game.package.json
vix.app
vix.json2
3
4
5
6
7
The game manifest links the game libraries and copies runtime resources beside the built target.
links = [
"vix::game",
"vix::io",
]
resources = [
"assets=assets",
"game.package.json=game.package.json",
]2
3
4
5
6
7
8
9
Use this template when the project is meant to run through the Vix game foundation.
Library
The library template creates a reusable C++ library project. It is different from the application templates because it is centered on a library package shape, examples, tests, and CMake packaging.
vix new mathkit --libA generated library project uses a normal CMake library layout.
mathkit/
include/
mathkit/
mathkit.hpp
examples/
basic.cpp
CMakeLists.txt
tests/
test_basic.cpp
CMakeLists.txt
CMakePresets.json
vix.json
mathkit.vix2
3
4
5
6
7
8
9
10
11
12
13
Use this template when the output is reusable C++ code instead of an application executable. It is the right starting point for packages that may later be consumed by another project.
Choosing a template
Choose the smallest template that matches the real project.
Application small Vix application
Backend structured API or backend service
Web server-rendered HTML application
Vue Vue frontend with Vix C++ backend
Game Vix game project
Library reusable C++ library2
3
4
5
6
The application, backend, web, Vue, and game templates are application-oriented. They use vix.app to describe the main target and let Vix generate the internal CMake project. The library template is different because it is meant to produce reusable C++ code and keeps a normal CMake package structure.
Generated workflow
After creation, Vix prints the next steps for the selected template. A simple application usually starts with:
cd hello/
vix build
vix run2
3
A backend or web project also needs a local environment file:
cd api/
cp .env.example .env
vix build
vix run2
3
4
A Vue project installs frontend dependencies before development:
cd dashboard/
npm install --prefix frontend
vix dev2
3
A library project usually builds all targets and enables tests when needed:
cd mathkit/
vix build --build-target all
vix tests2
3
The generated command hints are intentionally short. The detailed pages in this section explain what each template creates and why those files exist.
Next step
Continue with the application template to understand the default Vix application layout and its module registry.
