you can find the live version of Small World at: https://small-world-friends.herokuapp.com
lein install
- install postgres: https://postgresapp.com (database)
- create local postgres db called
smallworld-local
-
run
bin/start-dev.sh
- sets the environment variables
- starts the server: http://localhost:3001
- starts the frontend hot-reloading*
- starts the repl
-
connect Calva repl in VSCode to the repl running in the terminal (optional – the previous step starts a repl in your terminal, so this step is just for people who prefer to use the Calva repl instead of the terminal repl)
- command in VSCode:
Calva: Connect to a running REPL server in the project
- how to reload your code into the repl:
Calva: Load Current File and Dependencies
- how to reload the backend code in the running server:
(restart-server)
- command in VSCode:
* if you want to start just the frontend hot-reloading, without the server:
lein figwheel
. you probably won't use this often, aslein repl
starts the frontend hot-reloading as well as the server.
you have two options:
- reload the entire file into the repl
- command in VSCode:
Calva: load current file and dependencies
- pros: simpler because it just reloads everything that file needs, so you don't need to worry about it
- cons: slower
- command in VSCode:
- evaluate just the form that you want to update in the code
- e.g. you can evaluate just the `(defroutes app ...) form if you updated code within
- pros: faster
- cons: more likely that you forget to evaluate a dependency that's needed and the whole thing doesn't actually update as you expect
bin/make-and-deploy.sh
here are the steps that script follows, broken down into separate subscripts:
-
build a production version
bin/make-jar.sh
-
optional: run the jar locally to make sure it works, and open it at http://localhost:8080
bin/run-jar.sh
-
deploy the jar to heroku
bin/deploy
-
view heroku logs to check if deployment succeeded
bin/heroku-logs.sh
-
open Heroku Postgres instance in terminal:
heroku pg:psql postgresql-rigid-43177 --app small-world-friends
-
view all tables:
select table_name from information_schema.tables where table_schema = 'public';
-
make a user go through welcome flow again:
update settings set welcome_flow_complete = false where screen_name = 'devon_dos';
-
get column names of a table:
select column_name, data_type from information_schema.columns where table_name = 'friends';
-
reset a user: (BE CAREFUL, THIS IS VERY DESTRUCTIVE!)
delete from profiles where request_key = 'devon_dos'; delete from friends where request_key = 'devon_dos'; delete from settings where screen_name = 'devon_dos'; delete from access_tokens where request_key = 'devon_dos';