A simple todos application backend powered by the Streams API.
Besides the Blade front-end that is included, you may also be interested in:
- Clone this repository locally.
- Run
composer install
within the project. - Run
cp .env.example .env
and adjust as needed. - Run
php artisan key:generate
to secure your install. - Use
php artisan serve
to start your local server.
The API is now ready to use:
curl --location --request POST 'http://127.0.0.1:8000/api/streams/todos/entries' \
--header 'Content-Type: application/json' \
--data-raw '{
"title": "Your first todo!",
"description": "Remember to do the one thing."
}'
This backend uses a single todos
stream configured to use flat-file JSON data by default.
The stream definition and the corresponding data can be found in the /streams
directory.
To version control your data, delete the /streams/data/.gitignore
file.
To use a Laravel supported database first update the stream configuration:
// streams/todos.json
{
"config": {
"source": {
"type": "database",
"table": "todos"
}
}
}
Then, run the database migration:
php artisan migrate
You may choose any supported source adapter for your data storage.