using the command
npm create astro@latest -- --template basicsInside of your Astro project, you'll see the following folders and files:
/
├── public/
│ └── favicon.svg
├── src/
│ ├── components/
│ │ ├── ProductGrid.astro
│ │ └── Welcome.astro
│ ├── layouts/
│ │ └── Layout.astro
│ ├── pages/
│ │ └── index.astro
│ └── utils/
│ └── api.js
├── .env
├── .env.example
└── package.json
To learn more about the folder structure of an Astro project, refer to a guide on project structure.
This project integrates with NocoDB to fetch and display product data and store the bookings. You'll need to set up environment variables to connect to your NocoDB instance.
- Create a
.envfile in the root of your project (or copy.env.exampleand rename it to.env) - Add the following variables to your
.envfile:
# NocoDB API Configuration
# The API token for authenticating with NocoDB
NOCODB_API_TOKEN=your_nocodb_api_token_here
# The NocoDB API endpoint URL for retrieving records
# Example: https://app.nocodb.com/api/v2/tables/{table_id}/records
PRODUCTS_TABLE_URL=your_nocodb_api_endpoint_here
BOOKING_TABLE_URL=your_nocodb_bookings_table
- API Token: Log into your NocoDB dashboard, go to Settings > API tokens, and create or copy an existing token
- API URL: This is the endpoint for your table data, formatted as:
https://app.nocodb.com/api/v2/tables/{table_id}/records
- Never commit your
.envfile to version control (it's already in.gitignore) - The
.env.examplefile is provided as a template and can be safely committed - For local development, make sure to restart your development server after changing environment variables
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 |
For sending confirmation emails we are looking into using Resend.com
Railway.com or similar