My personal portfolio website built with Astro project. It uses Sanity as the CMS (data store). The project is statically generated and deployed to Cloudflare Pages.
Fill up the .dev.vars file with the variables in the .env.example
| Key | Description |
|---|---|
WEBSITE_URL |
URL of the website. Defaults to https://obifortune.com |
PUBLIC_SANITY_VISUAL_EDITING_ENABLED |
Enable visual editing in the studio. Defaults to false |
SANITY_API_READ_TOKEN |
Read token for the sanity project |
PUBLIC_POSTHOG_API_KEY |
API key for Posthog |
PUBLIC_POSTHOG_API_HOST |
Host for Posthog events. Defaults to https://us.i.posthog.com |
PUBLIC_POSTHOG_UI_HOST |
UI Host for Posthog events. Defaults to https://us.posthog.com |
WAKATIME_API_KEY |
API key for the wakatime API |
LASTFM_API_KEY |
Last.fm API key |
LASTFM_USER |
Last.fm username |
PUBLIC_PARTY_URL |
PartyKit location. Defaults to http://localhost:1999 |
All commands are run from the root of the project, from a terminal with pnpm run:
| Command | Action |
|---|---|
dev |
Starts local dev server at localhost:4321 |
build |
Build your production site to ./dist/, will generate app types and check astro setup |
preview |
Deploy a local preview of the build with wrangler |
typegen |
Generate all user types |
cf-typegen |
Generate types from bindings and module rules in configuration |
sa-dev |
Starts sanity dev server at localhost:3333 |
sa-deploy |
Deploy sanity schema to the cloud |
sa-typegen |
Extract sanity schema info and generate types |
lint |
Run eslint on the project |
lint:fix |
Run eslint on the project and resolve auto-fixable issues |
typecheck |
Run tsc to check for type errors |
Setting up Sanity
You need to create a sanity project to work with this portfolio. This can be done by running this in the root of the app
pnpm create sanity@latestThis will prompt you to do a few things
- Login to your sanity
- Create a new project
- Don't add configuration files (this has already been done for you)
- Select
clean project with no predefined schemas. You can delete the newly created sanity changes - Go to the Sanity dashboard and select your project to view your project ID and other details