- install chainlit from my minimal-change fork
pip install git+https://github.com/guyvandam/chainlit.git#subdirectory=backend/
(might need to install pnpm
)
- run
chainlit create-secret
to generate a JWT secret key
- run the demo app locally
chainlit run app.py
or
add this snippet to app.py
and run 'as usual'
if __name__ == "__main__":
from chainlit.cli import run_chainlit
run_chainlit(__file__)
- create a new railway project w/ a postgres DB service
- create the DB table by setting
DATABASE_URL=postgresql://postgres:Uhx...
which you can find on the railway variables tab and run
npx prisma migrate deploy
to create the tables needed for chainlit.
note: run it locally again, your db should be connected
- deploy to railway
w/ the modified
Dockerfile
from this template. The modification is for installing chainlit from my minimal-change fork. - add the env variables - make sure to create a reference env variable
DATABASE_URL
from the DB serviceDATABASE_PUBLIC_URL