-
Notifications
You must be signed in to change notification settings - Fork 35
Getting Started
In this tutorial, we will
- use
jaguar
cli to clone a boilerplate repository - Examine the boilerplate example
- Test run the boilerplate example
jaguar
cli has some nifty commands to clone boilerplate projects and assist in code generation. Install it using the following command:
pub global activate jaguar_cli
list::projects
command of jaguar
cli lists all available boilerplate/examples.
jaguar list::projects
... boilerplate_reflect: Boilerplate for jaguar_reflect ...
In this example, we will be using boilerplate_reflect. Since it uses, source generation instead of reflection, it is much easier to get started.
Lets use create::project
command of jaguar
cli to clone the desired boilerplate.
jaguar create::project -r boilerplate_reflect
Lets resolve all pub dependencies.
pub get
You might want to peek at the following files:
- lib/api.dart Declares the routes and route handlers
- bin/server.dart Main file for server
-
bin/client.dart
Main file for client.
dart:io
based client to test run the sample routes.
Run the server:
dart bin/server.dart
Run the client:
dart bin/client.dart
The client prints the response it received from the server on the terminal. It must be something similar to this:
=========================
body:
0.1
statusCode:
200
headers:
x-frame-options: SAMEORIGIN
content-type: text/plain; charset=utf-8
x-xss-protection: 1; mode=block
x-content-type-options: nosniff
transfer-encoding: chunked=========================
body:
{"name":"jaguar","motto":"Speed. Simplicity. Extensiblity.","degree of awesomeness":"infinity!"}
statusCode:
200
headers:
x-frame-options: SAMEORIGIN
content-type: application/json; charset=utf-8
x-xss-protection: 1; mode=block
x-content-type-options: nosniff
transfer-encoding: chunked
We recommend installing IntelliJ IDE and Dart plugin for IntelliJ IDE. We believe IntelliJ is the best IDE available for Dart. It makes developing Jaguar.dart applications a breeze.
Alternatively, atom.io with dart plugin is also a good editor.
Jaguar.dart wiki has several articles on introduction to various parts of Jaguar framework.
Basics
- Route handler
- Path matching
- Path parameters
- Query parameters
- Serving static files
- Cookies
- Controller
- Parameter binding
- Hot reload
Serialization
Forms
Sessions
Authentication
- Basic authentication
- Form authentication
- JSON authentication
- Authorization
- OAuth
- MongoDb
- PostgreSQL
- MySQL
- Establish connection
- ORM
- Server sent events (SSE)
- Websockets
- systemd
- Docker
- AppEngine