This is the code for converge. An app that aims to make it easier to work out what days people are free.
This app is built with the Lucky Framework for the Crystal programming language. The frontend is written in Typescript + Vue3
For local development you'll have to change API_BASE and LINK_BASE to:
const API_BASE = "http://localhost:3000"
and:
const LINK_BASE = "http://localhost:5173/?event_uuid=";
- Install required dependencies
- Update database settings in
config/database.cr
- Run
script/setup
- Run
lucky dev
to start the app
- Install Docker
- Run
docker compose up
The Docker container will boot all of the necessary components needed to run your Lucky application.
To configure the container, update the docker-compose.yml
file, and the docker/development.dockerfile
file.
cd frontend
npm install
npm run dev
Lucky uses the Crystal programming language. You can learn about Lucky from the Lucky Guides.
I am mostly writing this down in case I have to change servers at some point.
Deploys are via dokku, to deploy this app:
First locally (or in Docker with lucky setup) run:
lucky gen.secret_key
On server:
dokku apps:create converge-api.<domain.tld>
sudo dokku plugin:install https://github.com/dokku/dokku-postgres.git
dokku postgres:create converge
dokku postgres:link converge converge-api.<domain.tld>
dokku config:set converge-api.<domain.tld> LUCKY_ENV=production
dokku config:set converge-api.<domain.tld> APP_DOMAIN=converge-api.<domain.tld>
dokku config:set converge-api.<domain.tld> PORT=5000
dokku postgres:info converge
dokku config:set converge-api.<domain.tld> DATABASE_URL=<dsn_from_above_command>
dokku config:set converge-api.<domain.tld> SECRET_KEY_BASE=<secret_key_from_local>
dokku config:set converge-api.<domain.tld> SEND_GRID_KEY=unused
On local:
git remote add dokku dokku@SERVER_IP:converge-api.<domain.tld>
git push dokku main
And the app should get deployed! Follow the dokku docs to enable lets encrypt as well for https!
On server:
dokku apps.create converge.<domain.tld>
dokku config:set converge.<domain.tld> NGINX_ROOT=dist
On local:
cd frontend
git init
git add .
git commit -m "App for deploy"
git remote add dokku dokku@SERVER_IP:converge.<domain.tld>
git push dokku main
And the app should get deployed now too!
Now you can go to: http://converge.<domain.tld>
and you should see the app!