Quickstart
This page gets a minimal API running. For the full walkthrough, with a database, auth and tests, follow the framework guides.
Prerequisites
Section titled “Prerequisites”- Dart SDK 3.3 or newer
1. Create a project
Section titled “1. Create a project”dart create -t console my_apicd my_apidart pub add gisiladart pub add --dev build_runner2. Write a controller
Section titled “2. Write a controller”import 'package:gisila/gisila.dart';
part 'hello_controller.g.dart';
@Controller('/hello')class HelloController { @Get('/') @Public() Future<Map<String, Object?>> hello() async => {'message': 'Hello, Gisila'};}Every file that declares a @Controller needs a part directive. The generator writes the routing glue into it.
3. Generate the routing code
Section titled “3. Generate the routing code”dart run build_runner build4. Start the app
Section titled “4. Start the app”import 'package:gisila/gisila.dart';import 'package:my_api/hello_controller.dart';
Future<void> main() async { final app = GisilaApp(config: AppConfig()); app.registerController(attacher: HelloController().attachToApp); await app.start(host: '0.0.0.0', port: 8080);}dart run bin/my_api.dartcurl http://localhost:8080/hello/Next steps
Section titled “Next steps”- Framework concepts: the request lifecycle, forms, services and permissions.
- Add a database with
gisila_orm. - Deploy it on gisila-panel.