A starter template for building Slack apps using Bolt with Prisma in TypeScript
- Bolt v3.12
- Prisma v4.8
- TypeScript v4.9
Use degit
to download the repository locally.
❓ What is degit?
degit downloads a copy of git repository with downloading its entire git history.
Install degit globally.
npm install -g degit
Download the latest version
degit utsavdotpro/starter-bolt-prisma-ts
Run locally
yarn dev
Build app
yarn build
Run build version
yarn start
After you've started the Bolt app using any of the commands above, run the following to expose your local server to the world.
yarn serve
You will receive a url, for example https://random-words.loca.lt, that you can use directly on Slack. Made possible using localtunnel
Update the port in package.json for the
serve
script if you want to use anything other than3000
for the Bolt app
Bolt doesn't require a separate Express app but it's good to have to quickly test your APIs locally
Run locally
yarn dev:express
yarn migrate:dev # migrate to dev
yarn migrate:reset # reset DB
yarn migrate:deploy # deploy migrations
yarn prisma:studio # start DB interface
yarn prisma:generate # generate prisma modals
yarn prisma:generate:watch # generate prisma modals on change
project
|-- prisma ℹ️ schema and migrations
|-- src
| |-- listeners ℹ️ listeners for different event types
| | |-- actions
| | |-- events
| | |-- shortcuts
| | |-- views
| |-- models
| |-- ui
| | |-- modals ℹ️ keep your modal UIs
| | | ℹ️ keep your UI functions
| |-- utils
| | |-- constants ℹ️ keep your constants
| | | ℹ️ keep your util functions
Bolt is basically a NodeJS app and so can be easily hosted on platforms like Heroku.
Deploy for free on Render
- Add the following script in your
package.json
file to automatically generate your Prisma models on every install"scripts": { "postinstall": "npm run prisma:generate" }