.vscode | ||
bin | ||
config | ||
lib | ||
test | ||
views | ||
web | ||
.dockerignore | ||
.gitignore | ||
analysis_options.yaml | ||
CHANGELOG.md | ||
Dockerfile | ||
LICENSE | ||
pubspec.yaml | ||
README.md |
ORM Starter Application for Angel3 framework
This is an ORM starter application for Angel3 framework which is a full-stack Web framework in Dart. The default database is MariaDB. MySQL support is still in active development.
Installation & Setup
-
Download and install Dart.
-
Install
MariaDB
10.2.x or later -
Create a new user and database using MySQL Client. For example:
MariaDB [(none)]> CREATE DATABASE appdb; MariaDB [(none)]> CREATE USER 'appuser'@'localhost' IDENTIFIED BY 'App1970#'; MariaDB [(none)]> GRANT ALL PRIVILEGES ON appdb.* TO 'appuser'@'localhost';
-
Update the
mariadb
section in theconfig/default.yaml
file with the newly created user and database name.mariadb: host: localhost port: 3306 database_name: appdb username: appuser password: App1970#
-
Run the migration to generate
migrations
andgreetings
tables in the database.dart bin/migrate.dart up
Development
-
Run the following command to start Angel3 server in dev mode to hot-reloaded on file changes:
dart --observe bin/dev.dart
-
Modify the code and watch the changes applied to the application
-
Insert a message into DB:
curl -H "Content-Type: application/json" -X POST -d '{"message":"OK_Message" }' "http://localhost:3000/greetings/"
or
curl -X POST -d 'message=OK_Message2' "http://localhost:3000/greetings/"
-
Query DB:
curl http://localhost:3000/greetings/
Production
-
Run the following command:
dart bin/prod.dart
-
Run as docker. Edit and run the provided
Dockerfile
to build the image.
Building ORM Model
-
Run the followig command:
dart run build_runner build
Resources
Visit the Developer Guide for dozens of guides and resources, including video tutorials, to get up and running as quickly as possible with Angel3.
Examples and complete projects can be found here.
You can also view the API Documentation.