Get Started

Thu Jul 03

This is an explanation of the project structure and commands of the Astrto Starter template.

This page contains the full README for the template, including usage instructions and the project’s directory structure. If you’re looking for a clean, powerful starter built with Astro, Tailwind CSS, and TypeScript, feel free to make use of this template! πŸš€

πŸš€ Astro + Tailwind + TypeScript Template

A clean and modern starter template built with Astro, Tailwind CSS, and TypeScript. Ideal for building fast, accessible, and SEO-friendly static websites.

Demo β†’ https://dev-astro-three.vercel.app/ β†—

πŸ”§ Tech Stack Versions

This template uses the following versions at release:

πŸ“ Directory Structure

/
β”œβ”€β”€ public/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ assets/         # Static assets (images, fonts, etc.)
β”‚   β”œβ”€β”€ components/     # Reusable UI components
β”‚   β”œβ”€β”€ content/        # Markdown blog content
β”‚   β”‚   └── blog/
β”‚   β”œβ”€β”€ env.ts          # Defines base URL for Astro environment
β”‚   β”œβ”€β”€ icons/          # Assets for Astro Icon
β”‚   β”œβ”€β”€ layouts/        # Layout components
β”‚   β”œβ”€β”€ pages/          # Astro page files
β”‚   β”œβ”€β”€ scripts/        # Client-side scripts
β”‚   β”œβ”€β”€ styles/         # Global CSS
β”‚   └── types/          # TypeScript type definitions
└── package.json

πŸš€ Getting Started

1. Install dependencies

npm install

2. Start the development server

npm run dev

Starts local dev server at http://localhost:4321 β†—

Note:
Pagefind (the search function) will not work in development mode. Run npm run build to enable it.

3. Build for production

npm run build

4. Preview the production build

npm run preview

πŸ› οΈ Astro CLI

You can use the official Astro CLI with the following commands:

CommandDescription
npm run astro ...Run Astro CLI commands like astro add, astro check
npm run astro -- --helpGet help using the Astro CLI

βš™οΈ Environment Base URL

You can change the base URL by specifying ASTRO_BASE during the build process.

In src/env.ts, the BASE_URL constant is exported to be reused throughout the site:

export const BASE_URL = (import.meta.env.ASTRO_BASE || '/').replace(/\/?$/, '/');

By using BASE_URL in your links, your site will work correctly even when deployed under a subdirectory:

<a href={`${BASE_URL}`}>

πŸ”§ Customization

You can customize colors, fonts, OGP, and more in the following locations:

βœ… Features

πŸ“¦ Deployment

You can deploy easily to Vercel, Netlify, GitHub Pages, etc.

npm run build

β†’ Upload the generated dist/ folder to your hosting platform.

πŸ“œ License

MIT

Note:
This template is licensed under the MIT License.
However, redistribution or resale of this template (modified or unmodified) as a competing product is not allowed without explicit permission from the author.

πŸ™Œ Special Thanks

This template is dedicated to everyone who loves Astro and Tailwind.

Created by: mooonycat ✨