diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml deleted file mode 100644 index ce3081f..0000000 --- a/.github/FUNDING.yml +++ /dev/null @@ -1,3 +0,0 @@ -# These are supported funding model platforms - -github: [thosakwe] diff --git a/.idea/angel.iml b/.idea/angel.iml deleted file mode 100644 index eae1301..0000000 --- a/.idea/angel.iml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml deleted file mode 100644 index c65900a..0000000 --- a/.idea/misc.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - - - General - - - XPath - - - - - AngularJS - - - - - - \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml deleted file mode 100644 index b034384..0000000 --- a/.idea/modules.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/.idea/runConfigurations/dev_dart.xml b/.idea/runConfigurations/dev_dart.xml deleted file mode 100644 index 418187f..0000000 --- a/.idea/runConfigurations/dev_dart.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - \ No newline at end of file diff --git a/.idea/runConfigurations/prod_dart.xml b/.idea/runConfigurations/prod_dart.xml deleted file mode 100644 index e93c56a..0000000 --- a/.idea/runConfigurations/prod_dart.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 9bc609b..3caa28e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,2 +1,8 @@ -# 1.0.0 -* Application template to build web application with `Angel3` framework +# Change Log + +## 1.0.0 + +* Changed to use `angel3` packages +* Updated to support NNBD +* Updated README +* Updated default `postgresql` setup diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index be2f075..b34fbca 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,3 +1,24 @@ -# Contributing Angel3 +# Contribution -Any contributions from the community are welcome. +Any help from the open-source community is always welcome and needed: + +1. Found an issue? + - Please [fill a bug report][tracker] with error message and steps to reproduce it. +2. Wish a feature? + - Open a feature request with use cases. +3. Are you using and liking the project? + - Create an article about your use case + - Do a post on your likes and dislikes + - Make a donation. +4. Are you a developer? + - Fix a bug and send a [pull request][pull_request] + - Implement a new feature + - Improve the Unit Tests + - Improve the [User Guide][doc] and send a [document pull request][doc_repo] +5. Have you already helped in any way? + - **Many thanks to the contributors and everybody that uses this project!** + +[tracker]: https://github.com/dukefirehawk/angel/issues +[pull_request]: https://github.com/dukefirehawk/angel/pulls +[doc]: https://angel3-docs.dukefirehawk.com +[doc_repo]: https://github.com/dukefirehawk/angel3-guide/pulls \ No newline at end of file diff --git a/LICENSE b/LICENSE index 50a7c9c..ee2937d 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2016 dukefirehawk.com +Copyright (c) 2021 dukefirehawk.com Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 2443dc5..dedb098 100644 --- a/README.md +++ b/README.md @@ -1,61 +1,58 @@ -[![Angel 3 Framework](./logo3.png)](https://github.com/dukefirehawk/angel) +# ORM Starter Application for Angel3 framework -[![Version](https://img.shields.io/badge/pub-v4.0.0-brightgreen)](https://pub.dartlang.org/packages/angel3_framework) -[![Null Safety](https://img.shields.io/badge/null-safety-brightgreen)](https://dart.dev/null-safety) -[![Gitter](https://img.shields.io/gitter/room/angel_dart/discussion)](https://gitter.im/angel_dart/discussion) - -[![License](https://img.shields.io/github/license/dukefirehawk/angel)](https://github.com/dukefirehawk/boilerplates/blob/angel3-orm/LICENSE) - -**A polished, production-ready backend framework in Dart.** - -*Note: This repo is an application boilerplate ,and not the underlying framework library.* - ------ -## About -Angel is a full-stack Web framework in Dart. It aims to -streamline development by providing many common features -out-of-the-box in a consistent manner. - -With features like the following, Angel is the all-in-one framework you should choose to build your next project: -* [GraphQL Support](https://github.com/dukefirehawk/angel/tree/master/packages/graphql) -* [PostgreSQL ORM](https://github.com/dukefirehawk/angel/tree/master/packages/orm) -* [Dependency Injection](https://angel3-docs.dukefirehawk.com/guides/dependency-injection) -* And [much more](https://github.com/dukefirehawk/angel)... +This is an ORM starter application for [Angel3 framework](https://pub.dartlang.org/packages/angel3_framework) which is a full-stack Web framework in Dart. The default database is `postgresql`. `mysql` support is still in active development. ## Installation & Setup -Once you have [Dart](https://dart.dev/get-dart) installed, bootstrapping a project is as simple as running a few shell commands: +1. Download and install [Dart](https://dart.dev/get-dart). +2. Install `postgresql` version 9, 10, 11 or 12. **postgresql 13 is not working as the driver do not support SCRAM** +3. Create a new user and database in postgres using `psql` cli. For example: -Install the [Angel3 CLI](https://github.com/dukefirehawk/angel3-cli): + ```sql + postgres=# create database appdb; + postgres=# create user appuser with encrypted password 'App1970#'; + postgres=# grant all privileges on database appdb to appuser; + ``` -```bash -pub global activate angel3_cli -``` +4. Update the `postgres` section in the `config/default.yaml` file with the newly created user and database name. -Bootstrap a project: + ```yaml + postgres: + host: localhost + port: 5432 + database_name: appdb + username: appuser + password: App1970# + useSSL: false + time_zone: UTC + ``` -```bash -angel init hello -``` +### Development -You can even have your server run and be *hot-reloaded* on file changes: +1. Run the following command to start Angel3 server in dev mode to *hot-reloaded* on file changes: -```bash -dart --observe bin/dev.dart -``` + ```bash + dart --observe bin/dev.dart + ``` -Next, check out the [detailed documentation](https://angel3-docs.dukefirehawk.com/guides) to learn to flesh out your project. +2. Modify the code and watch the changes applied to the application -## Examples and Documentation -Visit the [documentation](https://angel3-docs.dukefirehawk.com/guides) -for dozens of guides and resources, including video tutorials, -to get up and running as quickly as possible with Angel. +### Production -Examples and complete projects can be found -[here](https://github.com/dukefirehawk/angel3-examples). +1. Run the following command: + ```bash + dart bin/prod.dart + ``` + +2. Run as docker. Edit and run the provided `Dockerfile` to build the image. + +## Resources + +Visit the [Developer Guide](https://angel3-docs.dukefirehawk.com/guides) 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](https://github.com/dukefirehawk/angel3-examples). You can also view the [API Documentation](https://pub.dev/documentation/angel3_framework/latest/). There is also an [Awesome Angel :fire:](https://github.com/dukefirehawk/angel3-awesome) list. - diff --git a/config/default.yaml b/config/default.yaml index c171e6e..df1451a 100644 --- a/config/default.yaml +++ b/config/default.yaml @@ -1,9 +1,12 @@ # Default server configuration. jwt_secret: INSECURE_DEFAULT_SECRET host: 127.0.0.1 -# mongo_db: mongodb://localhost:27017/angel port: 3000 postgres: - database_name: angel - username: angel - password: angel2020 + host: localhost + port: 5432 + database_name: appdb + username: appuser + password: App1970# + useSSL: false + time_zone: UTC diff --git a/lib/angel.dart b/lib/angel.dart index 59d8bde..baaf97c 100644 --- a/lib/angel.dart +++ b/lib/angel.dart @@ -1,6 +1,4 @@ /// Your very own web application! -library angel; - import 'dart:async'; import 'package:angel3_framework/angel3_framework.dart'; import 'package:file/local.dart'; diff --git a/lib/src/config/config.dart b/lib/src/config/config.dart index 6aeb9e8..9dc78fc 100644 --- a/lib/src/config/config.dart +++ b/lib/src/config/config.dart @@ -1,6 +1,3 @@ -/// Configuration for this Angel instance. -library angel.src.config; - import 'package:angel3_configuration/angel3_configuration.dart'; import 'package:angel3_framework/angel3_framework.dart'; import 'package:angel3_jael/angel3_jael.dart'; diff --git a/lib/src/config/plugins/orm.dart b/lib/src/config/plugins/orm.dart index 9e836dd..be286f8 100644 --- a/lib/src/config/plugins/orm.dart +++ b/lib/src/config/plugins/orm.dart @@ -24,7 +24,8 @@ Future connectToPostgres(Map configuration) async { postgresConfig['port'] as int? ?? 5432, postgresConfig['database_name'] as String? ?? Platform.environment['USER'] ?? - Platform.environment['USERNAME']!, + Platform.environment['USERNAME'] ?? + '', username: postgresConfig['username'] as String?, password: postgresConfig['password'] as String?, timeZone: postgresConfig['time_zone'] as String? ?? 'UTC', diff --git a/lib/src/config/plugins/plugins.dart b/lib/src/config/plugins/plugins.dart index 8bb1737..acda711 100644 --- a/lib/src/config/plugins/plugins.dart +++ b/lib/src/config/plugins/plugins.dart @@ -1,6 +1,3 @@ -/// Custom plugins go here. -library angel.src.config.plugins; - import 'dart:async'; import 'package:angel3_framework/angel3_framework.dart'; import 'orm.dart' as orm; diff --git a/lib/src/routes/controllers/controllers.dart b/lib/src/routes/controllers/controllers.dart index e55e239..1942aaf 100644 --- a/lib/src/routes/controllers/controllers.dart +++ b/lib/src/routes/controllers/controllers.dart @@ -1,5 +1,3 @@ -library angel.src.routes.controllers; - import 'dart:async'; import 'package:angel3_framework/angel3_framework.dart'; diff --git a/lib/src/routes/routes.dart b/lib/src/routes/routes.dart index fa52d5c..b332219 100644 --- a/lib/src/routes/routes.dart +++ b/lib/src/routes/routes.dart @@ -1,6 +1,3 @@ -/// This app's route configuration. -library angel.src.routes; - import 'package:angel3_framework/angel3_framework.dart'; import 'package:angel3_orm/angel3_orm.dart'; import 'package:angel3_static/angel3_static.dart'; @@ -11,8 +8,8 @@ import '../models/greeting.dart'; /// Put your app routes here! /// /// See the wiki for information about routing, requests, and responses: -/// * https://github.com/angel-dart/angel/wiki/Basic-Routing -/// * https://github.com/angel-dart/angel/wiki/Requests-&-Responses +/// * https://angel3-docs.dukefirehawk.com/guides/basic-routing +/// * https://angel3-docs.dukefirehawk.com/guides/requests-and-responses AngelConfigurer configureServer(FileSystem fileSystem) { return (Angel app) async { // Typically, you want to mount controllers first, after any global middleware. @@ -55,7 +52,7 @@ AngelConfigurer configureServer(FileSystem fileSystem) { // // Read the following two sources for documentation: // * https://medium.com/the-angel-framework/serving-static-files-with-the-angel-framework-2ddc7a2b84ae - // * https://github.com/angel-dart/static + // * https://pub.dev/packages/angel3_static if (!app.environment.isProduction) { var vDir = VirtualDirectory( app, @@ -71,7 +68,7 @@ AngelConfigurer configureServer(FileSystem fileSystem) { // Set our application up to handle different errors. // // Read the following for documentation: - // * https://github.com/angel-dart/angel/wiki/Error-Handling + // * https://angel3-docs.dukefirehawk.com/guides/error-handling var oldErrorHandler = app.errorHandler; app.errorHandler = (e, req, res) async { diff --git a/lib/src/services/services.dart b/lib/src/services/services.dart index 1d68f07..bf1ce7c 100644 --- a/lib/src/services/services.dart +++ b/lib/src/services/services.dart @@ -1,6 +1,3 @@ -/// Declare services here! -library angel.services; - import 'dart:async'; import 'package:angel3_framework/angel3_framework.dart'; diff --git a/logo3.png b/logo3.png deleted file mode 100644 index 2f0202a..0000000 Binary files a/logo3.png and /dev/null differ diff --git a/pubspec.yaml b/pubspec.yaml index 0a8be2d..6db7c9c 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,10 +1,9 @@ name: angel version: 1.0.0 -description: A boilerplate template for building Angel3 application with ORM enabled +description: An ORM starter application for Angel3 framework publish_to: none environment: sdk: '>=2.12.0 <3.0.0' -homepage: https://github.com/dukefirehawk/boilerplates dependencies: angel3_auth: ^4.0.0 angel3_configuration: ^4.0.0