Deploy Template to Vercel
- ✅ 100/100 Lighthouse performance
- ✅ SEO-friendly with canonical URLs and OpenGraph data
- ✅ Dynamic content updates from caisy without redeployment
- ✅ Sitemap support
In order to have the right blueprints configured, make sure to follow the onboarind on caisy.io and select the starter template "Qwik Simple Blog"
To run this project a .env
file like this (with your own projects values) is required:
CAISY_PROJECT_ID=xxxx-xxxx-xxxx-xxxx-xxx
CAISY_API_KEY=xxxx
-
git clone https://github.com/caisy-io/starter-template-qwik-simple-blog.git
- create
.env
file with your project id and API key - see.env.sample
-
npm install
-
npm run dev
-
npm run gen
to fetch the schema types from your project
In order to have the right blueprints configured, make sure to follow the onboarind and select the starter template "Simple Blog"
- Qwik as server and server side rendering framework
- tailwindcss for styling
- @caisy/rich-text-qwik-renderer to render the caisy richtexts in Qwik
- graphql and graphql-request to fetch data from caisy
During development we generate code using
- @graphql-codegen/cli and plugins
All commands are run from the root of the project, from a terminal:
Command | Action |
---|---|
npm install |
Installs dependencies |
npm run start |
Starts local dev server at localhost:3000 |
npm run gen |
Regenerates generated types and SDK |
npm run gen:watch |
Wachting changes and regenerates generated types and SDK |
npm run build |
Build your production site to ./dist/ |
Feel free to check caisy documentation Feel free to check Next.js documentation
This command will generate html files for all pages in the dist folder. The downside with this approach is that you have to rebuild on every content change in the cms. That is why we do not recommend this. But for some cases this might be a valid choice.
npm run build.server
This starter site is configured to deploy to Vercel Edge Functions, which means it will be rendered at an edge location near to your users.
The adaptor will add a new vite.config.ts
within the adapters/
directory, and a new entry file will be created, such as:
└── adapters/
└── vercel-edge/
└── vite.config.ts
└── src/
└── entry.vercel-edge.tsx
Additionally, within the package.json
, the build.server
script will be updated with the Vercel Edge build.
To build the application for production, use the build
command, this command will automatically run npm run build.server
and npm run build.client
:
npm run build
To deploy the application for development:
npm run deploy
Notice that you might need a Vercel account in order to complete this step!
The project is ready to be deployed to Vercel. However, you will need to create a git repository and push the code to it.
You can deploy your site to Vercel either via a Git provider integration or through the Vercel CLI.