spidergazelletodo

Version, currently master branch1 version
  • master branchlatestAug 24, 2020

github.com/dukenguyenxyz/spider-gazelle-todo

To-do app built on Crystal

1 stars
0 dependents
License: MIT

Installation

# Add this to your shard.yml
dependencies:
  spidergazelletodo:
    github: dukenguyenxyz/spider-gazelle-todo
    branch: master

master is a branch, not a release, so this tracks it rather than pinning a version.

Then run:

shards install

shard.yml

Crystal
0.35.1
License
MIT
Author
Duke Nguyen
Target
  • spidergazelletodo from src/spidergazelletodo.cr

Dependencies

Runtime Dependencies

  • clear~> 0.8github: anykeyh/clear
  • secrets-env~> 1.0.0github: place-labs/secrets-env
  • simple_retry~> 1.1github: spider-gazelle/simple_retry
  • action-controller~> 3.0github: spider-gazelle/action-controller

Development Dependencies

  • ameba~> 0.13.1github: veelenga/amebadev

README

Spider-Gazelle To-do App

Build Status

Documentation

Routes

MethodPathController Actions
get/todosTasksController#index
get/todos/:idTasksController#show
post/todosTasksController#create
patch/todos/:idTasksController#update
delete/todos/:idTasksController#destroy

Task Resource

  • Attributes
    • Title : String
    • Order : Int32
    • Completed : Bool

Create a task

  • Send the Task object to TasksController#create { title: 'Going shopping' }

View a task

  • Set params ID to task ID /:id/ and send to TasksController#show

Update a task

  • Set params ID to task ID. Send single or multiple attributes of the Task object to TasksController#update { title: 'Going shopping in Parramatta, completed: true, order: 5' }

View all tasks

  • Send a request to TasksController#index

Delete a task

  • Set params ID to task ID /:id/ and send to TasksController#destroy

Running in Local Environment

With Docker

  • Test Environment: ENV_VAR=test docker-compose up --build --exit-code-from web

  • Production Environment: ENV_VAR=prod docker-compose up --build

Without Docker

  • to run in development mode crystal ./src/spidergazelletodo.cr

  • to run in watch mode

    • install node.js
    • install nodemon npm i -g nodemon
    • execute the following command nodemon --exec crystal ./src/spidergazelletodo.cr

Testing

  • to run all tests crystal spec
  • to watch all tests during edits nodemon --exec crystal spec

Compiling

crystal build ./src/spidergazelletodo.cr

Deploying

Once compiled you are left with a binary ./spidergazelletodo

  • for help ./spidergazelletodo --help
  • viewing routes ./spidergazelletodo --routes
  • run on a different port or host ./spidergazelletodo -b 0.0.0.0 -p 80