Skip to content

cliffordkleinsr/convex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Convex + SolidJS

  • Contains a working better-auth port for solid js for both convex http and convex client. See signin.tsx, handler, and all the files under the directory src/components/auth-provider

  • Contains a working example showcasing full text search. See here

  • Contains a working example showcasing Real-time chat with live database updates. See here

  • Contains a working example showcasing Realtime File Uploads. See here

Self-Hosting (Dokploy)

Self Hosting convex on Dokploy is as follows:

  1. Download the compose file from this url

  2. On the Environment tab add the urls as below:

    # URL of the Convex API as accessed by the client/frontend.
    CONVEX_CLOUD_ORIGIN='https://api.my-domain.com'
    # URL of Convex HTTP actions as accessed by the client/frontend.
    CONVEX_SITE_ORIGIN='https://my-domain.com'
    # URL of the Convex API as accessed by the dashboard (browser).
    NEXT_PUBLIC_DEPLOYMENT_URL='https://dash.my-domain.com'
  3. Run deploy on the dokploy General tab.

  4. Once the deployment is complete go to the domains tab and add the NEXT_PUBLIC_DEPLOYMENT_URL='https://dash.my-domain.com' as below:
    alt text
    and the CONVEX_CLOUD_ORIGIN='https://api.my-domain.com' as below:
    alt text

  5. On the okploy General tab run reload to populate the deployment urls.

  6. SSH into your VPS and identify the backend docker container and run the following commands:

    docker exec -it [your-backend-container-name] sh
    # then
    ./generate_admin_key.sh

    copy the full key including the convex-self-hosted| part and go to the dns dash.my-domain.com and add the api dns to the deployment url and the key we just generated to the password and click login.

  7. Generate any project and add the following to a env.local:

    CONVEX_SELF_HOSTED_URL='https://api.my-domain.com'
    CONVEX_SELF_HOSTED_ADMIN_KEY='<your admin key>'

    and run npx convex dev

And thats it ! you've setup a project with convex and dokploy

DEPLOYMENT

Vercel

Set the following as your build command:

VERCEL="" bunx convex deploy --cmd "VERCEL=true vinxi build" --cmd-url-env-var-name VITE_CONVEX_URL

and the following environment variables:

CONVEX_SELF_HOSTED_URL='https://api.my-domain.com'
CONVEX_SELF_HOSTED_ADMIN_KEY='your key'
VITE_CONVEX_SITE_URL='https://site.my-domain.com'

Then deploy

NETLIFY

The steps should be the same as vercel but with the NETLIFY arguments

DOKPLOY

Select nixpacks as the build deployment then add the following env file:

NIXPACKS_BUILD_CMD='bunx convex deploy --cmd-url-env-var-name VITE_CONVEX_URL --cmd 'vinxi build''
CONVEX_SELF_HOSTED_URL='https://api.my-domain.com'
CONVEX_SELF_HOSTED_ADMIN_KEY='your key'
VITE_CONVEX_SITE_URL='https://site.my-domain.com'

Troubleshooting

Mixed Content: The page at https://api.my-domain.com' was loaded over HTTPS, but requested an insecure resource 'http://api.my-domain.com/api/check_admin_key'. This request has been blocked; the content must be served over HTTPS.

Ensure you are using https not http or serve the backend with https explicitly

About

SolidJS Convex BoilerPlate

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published