Skip to content

donaldp/formidablejs-vercel-example

Repository files navigation

Formidable Example

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

Deploy your own Formidable project with Vercel.

Deploy with Vercel

Live Example: https://formidablejs-vercel-example-donaldpakkies.vercel.app/

How I Created This Example

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

Vercel Configuration

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.

Github Configuration

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

Formidable Environment Variables

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.

Deploying

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.

About

A formidablejs application deployed with Github Actions and Vercel

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published