Skip to content

chadhs/listopia

Repository files navigation

listopia CircleCI

an exploration of web development in Clojure.

usage

register, login, and make lists!

local dev setup

listopia uses postgresql; you'll need this availalbe for local dev. to create a local dev database run the following command.

createdb listopia-dev

create 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.

database migrations

  • the clojure migratus library is used to handle db schema changes.
  • migrations are located in the resources/migrations folder.
  • to create a new migration lein migratus create <descriptive-name> and then edit the up and down files created.
  • to apply migrations to your local dev instance lein migratus migrate
  • production migrations are applied automatically; see circle.yml

production setup

you'll need to load the following environment variables in your production environment:

  • DATABASE_URL
  • PORT
  • SESSION_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")

license

Copyright © Chad Stovern

Distributed under the BSD 3-Clause License

About

An exploration of web development in Clojure.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published