In this tutorial we will create a
tramvai application using the main features of the framework.
For interactivity we will use the wonderful public API - pokeapi as a backend.
And we will create a real
Creating a new application
For development, build and code generation there is a special CLI @tramvai/cli
⌛ Generate a template for the new application, name it
npm init @tramvai pokedex # or npx @tramvai/create pokedex
During the execution of the command you will need to select a base template, a package manager and a test framework. The command will create a new
pokedex directory, and generate an application skeleton in it, then install the dependencies.
⌛ Go to the application folder, and run application in
cd pokedex && npm start
npm start under the hood will execute the
tramvai start pokedex command, which will build the server and client code of the application, and start the server at
tramvai commands run automatic migrations and tramvai libraries version checking in the application, so do not be scared of unexpected logs after running
npm start. Of course, migrations and version checks are not necessary for a freshly created application, but these actions may be useful for future upgrades.
⌛ Go to http://localhost:3000/
After loading, you will see a welcome page with the header Tramvai 🥳
A detailed overview of the application structure can be found in Project structure and in the
README.md file of our new application.
We recommend using feature-sliced methodology to structure the code, which may be overkill for small demonstration applications, but will have a good effect on the structure of the application when it is further developed.