This is a clone of LetterLoop as a fun side project.
- Orbstack or Docker Installed
- node v18 or greater
- pnpm
- oh-my-zsh (recommended)
curl -LsSf https://astral.sh/uv/install.sh | sh
uv python install 3.12
There is a pyproject.toml
file that will install local ring
commands and requirements.
uv sync
There are a few setup steps to get the project running locally.
ring setup requirements
ring setup local-ssl
Add a .env
file with the following:
ENVIRONMENT=LOCAL
API_PORT=8001
CELERY_BROKER_URL=redis://redis:6379/0
CELERY_RESULT_BACKEND=redis://redis:6379/0
SQLALCHEMY_DATABASE_URI=postgresql://ring-postgres:ring-postgres@db:5432/ring
JWT_SIGNING_ALGORITHM=HS256
VITE_API_URL=https://localhost
BACKEND_CORS_ORIGINS="https://localhost:5173 http://localhost:5173"
We'll need a JWT_SIGNING_KEY
as well which can be generated with openssl
echo "JWT_SIGNING_KEY=$(openssl rand -hex 32)" >> .env
Highly recommend to use oh-my-zsh
with the virtualenvwrapper
and dotenv
plugins.
ring compose up
API accessible and localhost/api/v1/docs
cd react
pnpm
pnpm run dev
Accessible at localhost:5173
Usage: ring [OPTIONS] COMMAND [ARGS]...
Options:
--help Show this message and exit.
Commands:
compose
db
docker
run
A wrapper around docker compose. By default it will use the compose.dev.yml and always build the images. Pass --prod to use the compose.prod.yml file.
Usage: ring compose [OPTIONS] COMMAND [ARGS]...
Options:
--help Show this message and exit.
Commands:
any
ps
up
Entrypoint to working with the database. Can open pgcli or run migrations.
Usage: ring db [OPTIONS] COMMAND [ARGS]...
Options:
--help Show this message and exit.
Commands:
alembic
generate
pgcli
upgrade
Entrypoint to working with the docker registry. Can tag and push images to the registry.
Usage: ring docker [OPTIONS] COMMAND [ARGS]...
Options:
--help Show this message and exit.
Commands:
push
tag
tp
Run scripts or start a shell.
Usage: ring run [OPTIONS] COMMAND [ARGS]...
Options:
--help Show this message and exit.
Commands:
script
shell
Frontend commands
Usage: ring fe [OPTIONS] COMMAND [ARGS]...
Options:
--help Show this message and exit.
Commands:
build
dev
regen
VITE_API_URL=http://ring.neilsriv.tech ring compose any --prod build
ring docker tp
- ssh into the server
cd ring
git pull
./dev_util/prod.sh
ring db upgrade
ring compose any --prod up -d
# may need to restart nginx
ring compose any --prod restart nginx