Set up your first Caesar web app.

Check out requirements

Before creating a new application, make sure that you have Go installed on your machine, with a version of at least 1.22.
If you don't have Go installed, you can download it here.

In order to install npm modules (such as TailwindCSS), you will need Node.js and npm installed.
You can download Node.js here.

Setup your web app

Install CLI tools

Open a terminal and run the following commands to install the required CLI tools:

# Install the Caesar CLI
go install github.com/caesar-rocks/cli/cmd/caesar@latest

# Install the Air CLI (for hot reloading)
go install github.com/air-verse/air@latest

# Install the Task CLI (for making use of Taskfile, a task runner)
go install github.com/go-task/task/v3/cmd/task@latest

# Install the Templ CLI (for templating)
go install github.com/a-h/templ/cmd/templ@latest

Creating a new application

In a new terminal, run the following command to scaffold a new Caesar application:

caesar new

This will create a new directory with the name of your application, and a basic structure for your web app.

Install npm modules

# Change directory to your app
cd <app_name>

# Install npm modules
npm install

Starting the development server

To start the development server, make sure you are in the root directory of your app.

# Change directory to your app
cd <app_name>

And then, run the three commands below in separate terminals:

# Start the development server
task air
# Start the templating server
task templ
# Start the CSS build server (TailwindCSS)
task css

This will start the hot reload server on http://localhost:7331, reverse proxying the original HTTP server on http://localhost:3000.

VSCode extensions

If you are using Visual Studio Code, you can install the following extensions to improve your development experience: