Example Crystal/Kemal codebase that implements the RealWorld spec and API.
Clone this repository and install its dependencies:
$ git clone git@github.com:reiswindy/kemal-realworld.git
$ cd kemal-realworld
$ shards installCreate a file named .env.development and set up your database credentials. You may use the example file .env.dist as a base for this:
$ cp .env.dist .env.developmentRun Cake task dbmigrate to set up the database schema. Internally, this task uses micrate to run the migrations in the db folder:
$ cake dbmigrateBuild and run the server:
$ shards build realworld
$ bin/realworldThis repository uses cr-dotenv to set up the environment variables in non-production builds. You may specify which .env to load by providing the APP_ENV environment variable when running the server. By default this value is development, and the file loaded is .env.development as a result.
$ APP_ENV=integration bin/realworld # Will load .env.integration insteadWhen built in production mode, .env files will no longer be loaded. All values will be taken from the system's environment variables.
To build and run the server in production mode:
$ APP_ENV=production shards build realworld --production --release --no-debug --progress --stats
$ bin/realworldThis repository uses spec-kemal for testing responses returned by Kemal. This requires setting the environment variable KEMAL_ENV to test when running Crystal's built in testing framework:
$ KEMAL_ENV=test crystal specThis repository uses the integration test suite provided by https://github.com/gothinkster/realworld/tree/master/api in its Travis CI script. If the badge is currently green, all tests have passed.
- @humboldtux Benoit Benedetti - creator
- @reiswindy - creator, maintainer
