Documentation › JSON API › Getting started
After you generate a codebase with Autostrada, you'll be shown 'how to run your application' instructions tailored to the specific options you chose. Please follow them to get your application up and running for the first time.
You can also find a copy of these tailored instructions in the README.md file in your codebase.
Once your application is up and running, you're encouraged to start exploring and familiarizing yourself with the codebase. Remember: Everything in the codebase is designed to be editable. Feel free to change and adapt it to meet your needs.
The codebase contains three high-level directories:
assets folder contains the application's non-code assets. Its contents will vary depending on the options you select, but it will include things like email templates and SQL migration files.cmd/api directory contains the application-specific code for your API application. The code for starting the server and handling HTTP requests and responses lives here.internal directory contains various helper packages used by the cmd/api application.In the cmd/api/main.go file you'll notice the definition of an application struct type. This type is central to the design of the application. The application struct contains all the dependencies that your application needs, and your handlers, helpers and middleware are all defined as methods on this type.
The most important files to familiarize yourself with are:
cmd/api/main.go – this is the entry point for the API application. It's responsible for parsing configuration settings, initializing dependencies and adding them to the application struct, and running the server. Start here when you're exploring the codebase.cmd/api/routes.go – this contains the route mappings between URLs and your handlers, and also controls which middleware is used on which routes.cmd/api/handlers.go – this contains your application handlers, which read HTTP requests, execute your business logic, and write responses.Makefile – this contains various admin commands for working with your codebase. Please see the admin makefile documentation for more information.If you're pushed for time and don't want to read through all the Autostrada documentation, the most important things to look over are:
And if you selected them as options: