crystal_lucky

Version, currently master branch1 version
  • master branchlatestJul 21, 2021

github.com/alextanhongpin/crystal-lucky

Crystal Lucky Framework

0 stars
0 dependents
License: not declared

Installation

# Add this to your shard.yml
dependencies:
  crystal_lucky:
    github: alextanhongpin/crystal-lucky
    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.36.1
Author
alextanhongpin
Target
  • crystal_lucky from src/crystal_lucky.cr

Dependencies

Runtime Dependencies

  • jwt~> 1.5.0github: crystal-community/jwt
  • lucky~> 0.27.0github: luckyframework/lucky
  • carbon~> 0.1.4github: luckyframework/carbon
  • dotenv~> 1.0.0github: gdotdesign/cr-dotenv
  • authentic~> 0.7.3github: luckyframework/authentic
  • lucky_task~> 0.1.0github: luckyframework/lucky_task

README

crystal_lucky

This is a project written using Lucky. Enjoy!

Setting up the project

  1. Install required dependencies
  2. Update database settings in config/database.cr
  3. Run script/setup
  4. Run lucky dev to start the app

Learning Lucky

Lucky uses the Crystal programming language. You can learn about Lucky from the Lucky Guides.

Installation

  1. Installation of Crystal is done using asdf version manager. At the time this is written, Lucky framework only supports Crystal v0.36.1, not v1.0.x.
  2. Overmind is used as the process manager.

API

$ curl -X POST -H 'content-type: application/json' -d '{"user":{"email": "john.doe@mail.com", "password": "123456", "password_confirmation":"123456"}}' http://127.0.0.1:5000/api/sign_ups
{"token":<generated_token>}%

# Visit
http://127.0.0.1:5000/api/me?auth_token=<generated_token>

Creating a new model

$ lucky gen.model Post
$ lucky db.migrate

API

$ curl -X POST -H 'content-type: application/json' -d '{"post":{"body": "hello world"}}' http://127.0.0.1:5000/api/posts
{"id":"7cb6e887-cce5-4584-a7e0-fbbecaaf312e","body":"hello world"}%

# Visit
http://127.0.0.1:5000/api/posts