Requires Ruby 3.3.0 and Bundler
sudo apt update && sudo apt install libpq-dev
bundle install
bundle exec rake db:create
bundle exec rake db:migrate
bundle exec ruby myapp.rb
App cannot run while testing
Run tests with make test
Run api tests with make test_api
Before running playwright test for the first time run yarn install
and yarn playwright install
Run playwright tests with make test_e2e
Run simulator tests with make test_sim_api
Build the Dockerfile
docker build . -t minitwit
Run
docker run --rm -v /tmp:/tmp -it -p 5000:5000 minitwit [cmd]
The volume mount should point to the local database.
If <cmd>
is not supplied, will run the app
Virtual Machine provisioning is handled by Vagrant in DigitalOcean.
Run provisioning with vagrant up
The environment variables DIGITAL_OCEAN_PRIVATE_KEY_PATH
, SSH_KEY_NAME
and DIGITAL_OCEAN_PAT
are needed.
The first is the path to the authenticated private key, the second is the name of your SSH key for Digital Ocean and the third is the authenticated token for the team
The Vagrantfile syncs the local repository to the VM so be sure to have a database in ./db/minitwit.db
The API will be available at http://165.227.245.161:5001
The interface will be available at http://165.227.245.161:5000
On any commits to the main branch will trigger a workflow that causes the following steps to happen:
aguldborg/minitwit
deploy.sh
script is run to built and run the containers by pulling them from Docker Hub