Pomodoro.aliday.me. Built with React / Ruby Sinatra / Docker compose / Nginx / Traefik
- Add this to
/etc/hosts->127.0.0.1 dev.pomodoro.aliday.me dev-api.pomodoro.aliday.me dev-traefik.pomodoro.aliday.me(dev url is already added to Google). Then gettoken_idfrom the google console, and save it to./app/.env.prod - Cd to root of project and run
docker-compose -f docker-compose-dev.yml up --build
Now you can check app at dev.pomodoro.aliday.me and traefik at dev-traefik.pomodoro.aliday.me
- Connect to DB:
docker exec -it pomodoro_db_1 shpsql -U pomodoro\c pomodoro
- Create new migration with
bundle exec rake db:create_migration NAME=create_users - Run migrations with
bundle exec rake db:migrate - Run migration for other ENVs
bundle exec rake db:migrate RACK_ENV=test - Run to see StoryBook
npm run storybook - Run
yarnto install dependencies andyarn upgardeto upgarde all dependencies. - Run
npx eslint [file_name] --fixto autofix - Cert managed by CloudFlare
- Clone this repo, change the values in
api/.env.dband then address it in docker-compose-prod file indbsection. - Setup nginx 'sudo systemctl restart nginx'. Files are in nginx folder in root.
- In production run
GOOGLE_CLIENT_ID=$GOOGLE_CLIENT_ID docker-compose -f docker-compose-prod.yml up --build - CI is triggered on each commit on master
-
fix login on development
-
access_id is returning as null in prod 🤷
-
show no activity if non exists
-
white page in all pages but pomodoro
-
show total for a week
-
In production, all requests for inner urls are redirected to index (react router). I hard coded paths in traefik label because I don't want to create a Nginx file just for this. But it is not clean. In the future create an Nginx config for app container and do
location / {
try_files $uri /index.html;
}