Dev Setup
For the local development setup, there are a few additional external steps you need to follow.
Setup Admin
- Navigate to the
example-adminfolder. - Run the command
npm install. - Create a
.envfile and add all the environmental variables, just like in the production app.
| Name | Value |
|---|---|
VITE_UPLOAD | WSRV |
VITE_SITE | EX |
VITE_SUPER_ADMIN | super admin email |
VITE_OPENAI_API_KEY | ************* |
VITE_OPENAI_IMAGE_API_KEY | ************* |
VITE_PEXELS_API_KEY | ************* |
VITE_UNSPLASH_ACCESS_KEY | ************* |
VITE_ADMIN | https://example-admin.pages.dev |
✨ To resolve the CORS issue, we will use VITE_ADMIN as a proxy.
- Run the command
npm run dev. - The site should now load at
http://localhost:5173.
Since this is local development, follow these steps for authentication:
- Go to
admin.example.comand open the browser's developer tools. - Navigate to the
Applicationtab, and underCookies, selecthttps://admin.example.com. - Copy the value of the
CF_Authorizationcookie. - Now, go to your local project editor and open
src > stores > admin.jsfile. - Go to
line 46, uncheck thecookies.setline, and set the value to the copiedCF_Authorizationkey.
cookies.set('CF_Authorization', 'copied CF_Authorization value goes here');
- Save the file and reload localhost. You are now authenticated.
- You can revert the changes in
admin.jsand continue working on the project.
Setup Frontend
- Navigate to the
examplefolder. - Run the command
npm install. - Create a
.envfile and add all the environmental variables, just like in the production app.
| Name | Value |
|---|---|
VITE_NAME | Example.com |
VITE_CDN | https://cdn.example.com |
VITE_ADMIN | https://example.pages.dev |
✨ To resolve the CORS issue, we will use VITE_ADMIN as a proxy.
- Run the command
npm run dev. - The site should now load at
http://localhost:5173.
✨ Everything is set for development! If you have any questions, feel free to let us know.
Table of Contents

