Skip to content

wolfgang000/micro_feeder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Subscribe to RSS feeds and receive updates via webhooks.

Backend CI badge Frontend CI badge E2E CI badge

Get started

touch backend/.env.local.dev

You need to add the following env variables to the env file:

GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET=
GOOGLE_REDIRECT_URI=http://localhost:8001/web/auth/callback

We need to generate the Google OAuth credentials to get the values for GOOGLE_CLIENT_ID and GOOGLE_CLIENT_SECRET

# Start the containers
docker compose up

# Run the migrations
(cd backend && make db-migrations)

Frontend: http://localhost:8000

Backend: http://localhost:8001

Backend(Debugging mode VS Code): http://localhost:8080

DB(Postgres): postgres://test_user:test_password@localhost:8004/postgres_dev

Message Broker(Rabbitmq): localhost:8005

Message Broker Store(Redis): localhost:8006

Tests

Backend

Frontend + E2E

Architectural diagram

Architectural diagram

Deployment

Setup server

# Install dokku
# wget -NP . https://dokku.com/bootstrap.sh
# sudo DOKKU_TAG=v0.32.4 bash bootstrap.sh
# dokku plugin:install https://github.com/dokku/dokku-postgres.git
# dokku plugin:install https://github.com/dokku/dokku-letsencrypt.git
# dokku plugin:install https://github.com/dokku/dokku-redis.git
# dokku plugin:install https://github.com/dokku/dokku-rabbitmq.git

dokku apps:create micro-feeder-back
dokku builder:set micro-feeder-back build-dir backend
dokku config:set micro-feeder-back \
  # Set the variables from backend/.env.example.prod

dokku ps:scale micro-feeder-back worker=1
dokku ps:scale micro-feeder-back scheduler=1

dokku apps:create micro-feeder-front
dokku builder:set micro-feeder-front build-dir frontend
dokku config:set micro-feeder-front \
  # Set the variables from frontend/.env.example.prod

# Setup database
dokku postgres:create micro-feeder-db
dokku postgres:link micro-feeder-db micro-feeder-back

# Setup redis
dokku redis:create micro-feeder-redis
dokku redis:link micro-feeder-redis micro-feeder-back

# Setup rabbitmq
dokku rabbitmq:create micro-feeder-rabbitmq
dokku rabbitmq:link micro-feeder-rabbitmq micro-feeder-back

# Setup SSL certificate
# Remember to open the 443 port

dokku letsencrypt:set micro-feeder-front email [email protected]
dokku letsencrypt:enable micro-feeder-front

dokku letsencrypt:set micro-feeder-back email [email protected]
dokku letsencrypt:enable micro-feeder-back

dokku letsencrypt:cron-job --add

# Setup domain
dokku domains:set micro-feeder-front micro-feeder.example.com

Deploy and push changes

git remote add server-backend [email protected]:micro-feeder-back
git remote add server-frontend [email protected]:micro-feeder-front

git push server-backend
git push server-frontend

OR

Use the Github Actions workflows, remember to set the env variables

Production debugging

Enter to the container

dokku enter micro-feeder-back web /bin/sh

Open celery events

dokku enter micro-feeder-back web celery -A backend.celery.main events

Show logs

dokku logs micro-feeder-back

Open a psql terminal

dokku postgres:connect micro-feeder-db

TODO:

  • add X-Hook-Signature header to webhook event

About

Subscribe to RSS feeds and receive updates via webhooks.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published