an exploration of web development in Clojure.
register, login, and make lists!
listopia uses postgresql; you'll need this availalbe for local dev. to create a local dev database run the following command.
createdb listopia-devcreate a profiles.clj in the project root (which is ignored by git) to define your local dev database connection. an example would look like this:
{:dev
{:env
{:database-url "jdbc:postgresql://localhost/listopia-dev"
:reported-log-level "debug"
:session-cookie-key "changecookiekey1"}}
:test
{:env
{:database-url "jdbc:postgresql://localhost/listopia-test"
:reported-log-level "debug"
:session-cookie-key "changecookiekey2"}}}to run locally (after migrations have been run, see below) use lein run this will start on port 8000 by default, but accepts a port number as an argument as well. to run interactively for local development run lein ring server to continually apply code changes as you develop.
- the clojure migratus library is used to handle db schema changes.
- migrations are located in the
resources/migrationsfolder. - to create a new migration
lein migratus create <descriptive-name>and then edit theupanddownfiles created. - to apply migrations to your local dev instance
lein migratus migrate - production migrations are applied automatically; see
circle.yml
you'll need to load the following environment variables in your production environment:
DATABASE_URLPORTSESSION_COOKIE_KEY
optionally you can customize the following variables in your production environment:
REPORTED_LOG_LEVEL(defaults to "warn"; set's min level to write to production log)LOG_APPENDER(options "println" "sentry")SENTRY_DSN(required only if you've set log-appender to "sentry")
Copyright © Chad Stovern
Distributed under the BSD 3-Clause License