This is the source code for the Perch Sensing website (v3), built with Astro. It features TinaCMS for content editing and is deployable to Cloudflare Pages.
- Modern static site generator using Astro
- Modular components and layouts
- SCSS styling and global resets
- Dynamic header and modal management
- SEO and social meta tags
- Font preloading and custom fonts
- Toast messages and notifications
- TinaCMS-powered content editing (blog, admin UI)
- Organized public assets (images, fonts, icons)
astro.config.mjs # Astro configuration
package.json # Project dependencies and scripts
op_run, op.env # Custom wrapper scripts/env for local dev
src/
components/ # Reusable UI components
layouts/ # Page layouts (e.g., BaseLayout.astro)
pages/ # Site pages (Astro, API, RSS, robots)
styles/ # SCSS/CSS styles (global, typography, utilities)
content/ # Content sources (blog, markdown)
interfaces/ # TypeScript interfaces
scripts/ # Utilities and remark definitions
consts.ts # Site metadata
env.d.ts # Environment type definitions
public/
admin/ # TinaCMS admin UI (auto-generated)
fonts/ # Custom fonts
icons/ # SVG icons
images/ # Site images
tina/
config.js # TinaCMS config/schema
tina-lock.json # TinaCMS lock file
- Install dependencies:
npm install
- Set up environment variables:
Create a
.envfile in the project root and add:(Get these from tina.io)NEXT_PUBLIC_TINA_CLIENT_ID=your-client-id TINA_TOKEN=your-tina-token TINA_INDEXER_TOKEN=your-indexer-token
- Run the development server:
npm run dev
- Starts Astro at
localhost:4321(with TinaCMS if configured)
- Starts Astro at
- Run TinaCMS admin UI:
npm run tina
- Starts TinaCMS at
/adminfor content editing
- Starts TinaCMS at
- Build for production:
npm run build
- Runs
tinacms buildandastro build
- Runs
- Preview production build:
npm run preview
- Builds and previews locally
| Command | Action |
|---|---|
npm install |
Installs dependencies |
npm run dev |
Starts local dev server at localhost:4321 |
npm run tina |
Starts TinaCMS admin UI for content editing |
npm run build |
Build your production site to ./dist/ (includes TinaCMS build) |
npm run preview |
Preview your build locally, before deploying (runs build first) |
npm run astro ... |
Run CLI commands like astro add, astro check |
npm run astro -- --help |
Get help using the Astro CLI |
tinacms init backend |
TinaCMS CLI: prepare backend for production |
- Update site metadata in
src/consts.tsandsrc/layouts/BaseLayout.astro. - Add or modify components in
src/components/. - Add pages in
src/pages/(Astro, API, RSS, robots). - Add blog/content in
src/content/blog/(editable via TinaCMS admin UI). - Place static assets in
public/(images, fonts, icons, admin UI). - Add global types/interfaces in
src/interfaces/. - Add or update SCSS styles in
src/styles/(global, typography, utilities).
- The site uses the Cloudflare adapter for Astro. Deploy to Cloudflare Pages or compatible platforms.
- Ensure environment variables are set in your deployment environment for TinaCMS.
- Static assets and TinaCMS admin UI are served from the
public/directory.
- Access the content editor at
/admin/(local or deployed site). - Configure content models in
tina/config.js. - Blog posts are stored in
src/content/blog/.
For questions or contributions, contact Eric Grossman:
- Email: contact@eric-grossman.com
- GitHub: ericgrossman5455
- Website: eric-grossman.com
Built with Astro & TinaCMS