This repo is a brief example of a Formidable app that can be deployed with Vercel.
Note: this is a hacky solution and should not be implemented for production apps.
Deploy your own Formidable project with Vercel.
Live Example: https://formidablejs-vercel-example-donaldpakkies.vercel.app/
To get started with Formidable, you can use the craftsman new hello-world
command to initialize a new project:
Install the craftsman
cli globally with:
npm install -g @formidablejs/craftsman
You can then create a new project with:
$ craftsman new hello-world
Before you deploy your app, you'll need to know your project ID and org ID. You can get them from Vercel. You can find your project ID from your project settings, and your org ID from your account settings. Alternatively, you can link your project to Vercel. This can be done by using npx vercel link
. This will create a .vercel
folder with the project.json
file which contains the projectId
and orgId
.
You will also need a token from Vercel. You can generate one from your Vercel account settings.
To setup automatic deployments, you will need to go to your Github project settings, and add the folllowing secrets:
VERCEL_ORG_ID
- to your Vercel org ID
VERCEL_PROJECT_ID
- to your Vercel project ID
VERCEL_TOKEN
- to your Vercel token
You will need to add the following secrets to your Github project:
APP_NAME
- the name of your application, .e.g. Formidable Example
.
APP_ENV
- the environment of your application, .e.g. development
.
APP_KEY
- the key of your application, run craftsman key
to generate one.
APP_DEBUG
- set to true
to enable debug mode. Debug mode is disabled by default.
APP_URL
- the url of your application, .e.g. https://formidablejs-vercel-example.vercel.app
. You can skip this if you don't know your application url.
Don't forget to also add your
.env
variables to your Vercel project.
Assuming your default branch is dev
, your application should now be deployed to Vercel.
You can change the branch name under the .github/workflows/deploy.yml
file.
Use the preview url to access your application.