Giter VIP home page Giter VIP logo

blog-kemalyst's Introduction

Blog using Crystal and Kemalyst

Build Status

This is a sample application that shows how to build a crud application. This also provides an example of securing specific pages and leveraging the session to maintain authorization.

Installation

Create a pg database called blog and configure the config/database.yml to provide the credentials to access the table. Then:

shards update
crystal db/migrate.cr

Usage

To run the sample blog:

crystal build src/app.cr
./app

username: admin password: password

Docker and Docker Compose

The Docker scripts are compatible with Heroku Cedar Images.

You can skip the above and run:

docker-compose up -d

This will start an instance of postgres, migrate the database, run the specs, and launch the site at http://localhost:80

To view the logs:

docker-compose logs -f

Contributing

  1. Fork it ( https://github.com/[your-github-name]/kemalyst-blog/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Contributors

blog-kemalyst's People

Contributors

drujensen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

genki

blog-kemalyst's Issues

form won't accept username

form specifies the field is an email, which browser enforces to need a @ character, but sessions controller wants admin

I get an error when run "crystal db/migrate.cr"

Error in ./db/migrate.cr:1: while requiring "../src/models/*"

require "../src/models/*"
^

in ./src/models/post.cr:1: while requiring "kemalyst-model/adapter/pg"

require "kemalyst-model/adapter/pg"
^

Syntax error in ./libs/kemalyst-model/adapter/pg.cr:63: unterminated parenthesized expression

      if db_alias_to_schema_type(type) != (column[1] as String)

I get an error when trying to build.

Error in ./src/models/post.cr:6: class variable '@@database' of Post must be Kemalyst::Adapter::Pg, not Nil

I have postgres on my computer and I followed the instructions in the readme. Is there somewhere else I need to configure?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.