Built with astro.build
Inside of the project, you'll see the following folders and files:
/
├── public/
├── src/
│ └── pages/
│ └── index.astro
└── 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 components.
Any static assets, like images, can be placed in the public/
directory.
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 |
npm run contentful:types |
Generate Contentful types |
npm run contentful:create-merge |
Create a content merge from dev -> master |
npm run contentful:apply-merge |
Apply a created merge |
Content is stored in Contentful, and pulled into collections src/collections
, using generated types.
There are two environments in our Contentful space - dev
and master
. Dev is used for local development, and testing content model changes.
- Make changes in dev environment
- Use
contentful:types
script to generate types - Test locally
- Open a PR, and test the deploy preview (this will use the dev space)
- Create a new environment in Contentful
master-<todays date>
- Use Merge app in Contentful to merge model changes from dev to your new environment
- Update
master
alias in Contentful to point at your new environment - Merge your PR
- Use
contentful:create-merge
andcontentful:apply-merge
to push any content changes tomaster
environment - App will redeploy via CF->Netlify webhook. Once it's done, test production
If anything goes wrong, the master
alias can be pointed to its previous location, and a redeploy from Netlify will restore the previous version.
Stripe is used as a checkout/payment processor. Wherever possible, data should be pulled into astro collections, but when unavoidable use stripe.json
to hold payment related configuration.
Retool hosts some workflows which are triggered by webhook (e.g. save data to a GSheet on player registration). Any configuration goes in retool.json
Google maps provides us with maps for cricket games.
Used to provide authentication to members' area.
Distributed SQLite database storing authentication data
Email sending. Emails are written with react-email
, and stored in the emails
folder. A preview UI can be seen by running npm run email
Locally you'll need a .env
file containing the follwing:
BASE_URL=http://localhost:4321
# From contentful
CDN_TOKEN=
CDN_SPACE_ID=
CDN_ENVIRONMENT=
CDN_CMA_TOKEN=
CDN_PREVIEW_TOKEN=
# From stripe
STRIPE_PUBLIC_KEY=
STRIPE_SECRET_KEY=
STRIPE_WEBHOOK_SECRET=
# From GCloud
MAPS_API_KEY=
MAPS_MAP_ID=
# From Better Auth
BETTER_AUTH_SECRET=
BETTER_AUTH_URL=
# From Turso
DB_TOKEN=
DB_SYNC_URL=
# From Mailgun
MAILGUN_DOMAIN=
MAILGUN_API_KEY=
MAILGUN_URL=