astro-pocketbase-template Tailwind Templates

Astro Pocketbase Template

Quick Web App with Astro, React, Tailwind, Shadcn ui and Pocketbase

Cheap Stack: Astro With Typescript, React, Tailwind, Shadcn UI and Pocketbase

[!CAUTION]
This boilerplate is still work in progress and expect any breaking changes will occured.

This is a mono repo that consist of frontend and backend with stack:

  • Astro (Typescript)
  • React
  • Tailwind CSS + Shadcn UI
  • Pocketbase
  • Docker

Use this repo as a template. You can also setup action-template-sync to update template with already created repo (since it's different with repo forking).

šŸš€ Project Structure

Inside of your Astro project, you'll see the following folders and files:

/
ā”œā”€ā”€ public/
ā”œā”€ā”€ src/
│   ā”œā”€ā”€ components/
│   │   ā”œā”€ā”€ app/
│   │   ā”œā”€ā”€ ui/
│   │   └── InteractiveComponent.tsx
│   ā”œā”€ā”€ layouts/
│   │   ā”œā”€ā”€ BlogPage.astro
│   │   ā”œā”€ā”€ DashboardPage.astro
│   │   └── LandingPage.astro
│   ā”œā”€ā”€ lib/
│   │   └── utils.ts
│   ā”œā”€ā”€ pages/
│   │   └── index.astro
│   ā”œā”€ā”€ services/backend/
│   │   ā”œā”€ā”€ pocketbase.ts
│   │   └── pocketbase-types.ts
│   ā”œā”€ā”€ styles/
│   │   └── global.css
│   └── types/
│       └── pages.ts
ā”œā”€ā”€ .env
└── package.json

Astro looks for .astro or .md files in the src/pages/ directory. Each page is exposed as a route based on its file name.

There's nothing special about src/components/, but that's where we like to put any Astro/React/Vue/Svelte/Preact components.

Any static assets, like images, can be placed in the public/ directory.

šŸ§ž Commands

All commands are run from the root of the project, from a terminal:

Command Action
npm install Installs dependencies
npm run dev Starts local dev server at localhost:4321
npm run build Build your production site to ./dist/
npm run preview Preview your build locally, before deploying
npm run astro ... Run CLI commands like astro add, astro check
npm run astro -- --help Get help using the Astro CLI

Pocketbase Backend

Go to backend folder and copy .env.example to .env.

Using docker locally

docker build -t cheapstack/backend .
docker run --env-file .env --rm -p 8080:8080 cheapstack/backend

Top categories

Loading Svelte Themes