# Basics

Source: https://docs.anetos.dev/main/guides/basics/

- [Routing](https://docs.anetos.dev/main/guides/routing/index.md): Map URLs to handlers, group routes under shared prefixes and middleware, name them, and generate URLs from names.
- [Handlers and requests](https://docs.anetos.dev/main/guides/handlers/index.md): Write handlers that receive typed input, return typed output, and turn errors into proper HTTP responses.
- [Render HTML with templ](https://docs.anetos.dev/main/guides/views/index.md): Write pages as [templ](https://templ.guide) components (typed, compiled, escaped by default), share a layout, link to routes by name, serve static files with cache-busting URLs, and add interactivity with the bundled htmx.
- [Style your app](https://docs.anetos.dev/main/guides/styling/index.md): A new project looks finished from the first page. Its pages are made of components in `views/ui`, a package of your app, styled by one stylesheet, `public/static/app.css`. Change the colors, change a component, add your own, start with Pico, Bootstrap or Bulma, or start without styles.
- [Handle HTML forms](https://docs.anetos.dev/main/guides/forms/index.md): Protect forms against cross-site request forgery, send PUT and DELETE from plain HTML, and show validation errors next to the fields with the submitted values kept.
- [Validation](https://docs.anetos.dev/main/guides/validation/index.md): Declare rules on an input struct, get one clear message per field, and add checks of your own.
- [Sessions and flash messages](https://docs.anetos.dev/main/guides/sessions/index.md): Remember things about a visitor between requests, and show a message once after a redirect.
- [Configure your application](https://docs.anetos.dev/main/guides/configuration/index.md): Read settings from `.env` files and the environment into typed Go structs, with defaults, required keys and validation.
- [Commands](https://docs.anetos.dev/main/guides/commands/index.md): Your application builds to one binary. Its first argument picks what it does: run the app (the default), run only some process types, migrate the database, list the routes, or run commands of your own.
- [Test your app](https://docs.anetos.dev/main/guides/testing/index.md): Boot the app in a test, send it requests like a browser or an API client, and check the responses, the session, the database, the jobs, events and email the app sent, and its files, with `anetostest`; freeze or move the app's clock.
- [Describe an API with OpenAPI](https://docs.anetos.dev/main/guides/openapi/index.md): Package `web/openapi` writes an OpenAPI 3.1 document of your API from its routes and its typed handlers: what each operation reads and answers, which credentials it needs and how it fails. You commit the document (`openapi.json`) beside the code, a test fails when it's out of date, and the app serves it for clients and tools.
