not affiliated with T3Chat or T3Tools
- Nuxt
- Shadcn-vue
- Better-Auth
- Drizzle Orm with LibSql (i.e. you can use Turso)
- Pusher sdks
- Sockudo
There's a list of required and optional environment variables that are needed for M3-Chat to run
-
BETTER_AUTH_SECRET: the secret used by better auth
-
BETTER_AUTH_URL: basically the url of your application (i.e. chat.mgassend.sh)
-
DATABASE_URL: url of your database (or your Turso instance)
-
DATABASE_TOKEN: token for your database authentication (or your Turso instance) (optional)
-
GITHUB_CLIENT_ID: github client id used for oauth
-
GITHUB_CLIENT_SECRET: github client secret used for oauth
-
GOOGLE_CLIENT_ID: google client id used for oauth
-
GOOGLE_CLIENT_SECRET: google client secret used for oauth
-
OPENROUTER_API_KEY: api key used for free models on openrouter
-
GOOGLE_API_KEY: api key used for free models on google
-
PUSHER_HOST: host for pusher-compatible service (i.e. sockudo) (optional)
-
PUSHER_PORT: port for pusher-compatible service (optional)
-
PUSHER_CLUSTER: cluster for pusher-compatible service (optional)
-
PUSHER_KEY: key for pusher-compatible service
-
PUSHER_SECRET: secret fro pusher-compatible service
-
NUXT_PUBLIC_PUSHER_SECURE: "true" | "false" determines whether to use wss or ws protocol
-
PUSHER_APP: app name for pusher-compatible service
-
CHAT_BATCH_LENGTH: minimum length of text message before it gets emitted and saved to db (defaults to 100)
-
REASON_BATCH_LENGTH: minimum length of reasoning message before it gets emitted and saved to db (defaults to 50)
In development, the script tries to create a local libsql database. For this, you will need to install the turso cli
I would also advise using a local pusher-compatible websocket service. I used sockudo and it has worked really well.
To run the migrations, make sure the db is setup correctly (either on Turso or locally), then run:
(p)npm run db:migratesimply run
(p)npm run devAfter building the application with
(p)npm run buildYou can run it by using
node --env-file .env .output/server/index.mjsThis will load the .env file you created and run the built nitro server
There's also a docker image at ghcr.io/matfire/m3-chat. It listens on port 80