This is a CRUD Aqueduct framework project. What's in the project?
- Making CRUD requests
- Basic pagination
For accompanying article explaning how to get to an end result like this, kindly check out the "Getting Started with the Aqueduct Framework - From Beginner to Intermediate", written by @nkansahrexford. Learn more about what I do on my website
To get up and running locally, do these pre-requisites.
- Install Dart
- Install Postgres Database
- Install Aqueduct
- Clone this repository Aqueduct-CRUD
Create a postgreSQL database, call it anything you want.
$ sudo -u postgres psql
> CREATE USER projectuser WITH PASSWORD 'password';
> CREATE DATABASE mydatabase;
> GRANT ALL PRIVILEGES ON DATABASE mydatabase TO projectuser;
> \q
Then create a database.yaml
file in the root project (same location as the pubspec.yaml
), and put in these:
username: 'projectuser'
password: 'password'
host: 'localhost'
port: 5432
databaseName: 'mydatabase'
Last but not least, run the migration, to convey what database scheme we have and want to the database for real. You can check the migrations/00000001_initial.migration.dart
file to see what is gonna happen.
Also, seed/fixture data is added.
Run aqueduct db upgrade
to commit the migration to database.
- In the project root folder, run
aqueduct serve
Since this project is API endpoints only, you'll have to consume using a REST Client, such as Postman.
If using Postman, check out this API request collection to help you get started with consuming your endpoints
To run all tests for this application, run the following in this directory:
pub run test
The default configuration file used when testing is config.src.yaml
. This file should be checked into version control. It also the template for configuration files used in deployment.
See the documentation for Deployment.