Skip to content

spiceworm/ecaz

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

265 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Run Locally

# Run locally
docker compose up --build

# Flask shell
docker exec -it ecaz_xyz-app-1 flask shell

# Flask CLI commands
docker exec -it ecaz_xyz-app-1 flask cli --help

Helper Scripts

Database

Connect to postgres database

docker exec -it ecaz-app-1 ./db.sh

Execute query in postgres database

docker exec -it ecaz-app-1 ./db.sh "SELECT * FROM public.user;"

Start Flower server to inspect celery workers (only works locally)

docker exec -it ecaz-app-1 ./celery.sh flower --port=5555
# Access at http://localhost:5555

Debugging

Stop all gunicorn workers in and start a single worker in the foreground

# This makes it easy to see tracebacks or drop into ipython
docker exec -it ecaz-app-1 ./debug.sh

Deploy to production

./deploy.py [--push] [--tag TAG]

Run tests

./test.sh
# or
./test.sh 'application/tests/test_some_file.py::test_some_function'

API

import requests

jwt = ""  # Generate JWT through UI after logging in
url = 'http://localhost'  # or 'https://ecaz.xyz'
resp = requests.get(f'{url}/api/v1/comment/<comment-id>', headers={'Authorization': f'Bearer {jwt}'})
resp.json()

About

Reddit clone

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors