Skip to content

Gift list web app built with fulcro and pathom, development documented on https://chrisodonnell.dev

Notifications You must be signed in to change notification settings

codonnell/mygiftlist-blog

Repository files navigation

Gift List App

This is a work in progress web app that allows people to build and share gift lists. Invited participants can claim gifts without the creator knowing, similar to a baby or wedding registry. The development process is being documented on my blog; see the introductory post for context.

Setup

In order to run this application, you need to have the following installed:

With these installed, run

npm install

to install javascript dependencies.

Running

Database

We run a local postgres database inside docker-compose. To start the database, run

docker-compose up -d

After starting the database, you'll need to run migrations, which you can do with

make migrate

There's also a convenience script available at ./scripts/psql to open up a psql client connected to the database. There are resources to learn more about working with a database inside docker compose in the documentation.

Application

To run this application in development mode, start a shadow-cljs server with

npx shadow-cljs -A:dev:backend:frontend:test -d nrepl:0.8.2 -d cider/piggieback:0.5.1 -d refactor-nrepl:2.5.0 -d cider/cider-nrepl:0.25.3 server

With this running, you can control compilation by accessing the shadow-cljs server at http://localhost:9630. In addition, this command will start up an nrepl server, which you should connect to with your preferred REPL. Alternatively, CIDER users can run cider-jack-in-clj&cljs and choose shadow-cljs.

In your clojure repl, make sure you are in the user namespace and evaluate (go). This will start our web server. With the web server running, you can access the application at http://localhost:3000.

Tests

To run the test suite from the command line, run

make test

In order to run tests from the repl, you need to start up the test database. You can do this with

make test-up

With the test database up and running, you should be able to run tests. You can shut down the test database with

make test-down

Deployment

To create an uberjar target/mygiftlistrocks.jar that includes production frontend assets, run

make uberjar

You can then run this uberjar with

java -cp target/mygiftlistrocks.jar clojure.main -m rocks.mygiftlist.main

You can run database migrations with

clojure -X:migrate :database-url '"postgresql://me:password@mydbhost:port/dbname"'

You can deploy to dokku with

git push dokku master

Maintenance

To find outdated dependencies, you can run

make outdated

To create a build report documenting how large frontend dependencies are in your bundle, run

make build-report

About

Gift list web app built with fulcro and pathom, development documented on https://chrisodonnell.dev

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages