Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bskimball/astro-fastify-starter
A simple example of using astro with fastify and trpc
https://github.com/bskimball/astro-fastify-starter
astro drizzle-orm fastify lucia-auth trpc typescript
Last synced: 3 months ago
JSON representation
A simple example of using astro with fastify and trpc
- Host: GitHub
- URL: https://github.com/bskimball/astro-fastify-starter
- Owner: bskimball
- Created: 2024-07-10T18:24:13.000Z (6 months ago)
- Default Branch: master
- Last Pushed: 2024-07-25T12:28:13.000Z (6 months ago)
- Last Synced: 2024-09-28T11:22:47.309Z (3 months ago)
- Topics: astro, drizzle-orm, fastify, lucia-auth, trpc, typescript
- Language: TypeScript
- Homepage:
- Size: 301 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Astro Fastify Starter
This is an example repo of having astro and fastify in the same app.
It's based off the fastify example in the
[node adapter](https://docs.astro.build/en/guides/integrations-guide/node/#middleware) section.
The main difference is this uses typescript. It also has an example of using the
[trpc fastify adapter](https://trpc.io/docs/server/adapters/fastify), so you have end-to-end type safety.## Auth
Auth is set up for [Lucia](https://lucia-auth.com/).
It's currently using username/password auth and storing to a session.
That information is available to astro as well as fastify and trpc.## ORM
Data access is done using [Drizzle](https://orm.drizzle.team/), and the example is set up for an SQLite database.
## 🚀 Project Structure
Inside of your Astro project, you'll see the following folders and files:
```text
/
├── public/
│ └── favicon.svg
├── src/
│ ├── api/
│ │ └── server.ts
│ │ └── dev.ts
│ ├── components/
│ │ └── Card.astro
│ ├── layouts/
│ │ └── Layout.astro
│ └── pages/
│ └── index.astro
└── run-server.mjs
└── package.json
```## 🧞 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 start` | Start your production build |
| `npm run astro ...` | Run CLI commands like `astro add`, `astro check` |
| `npm run astro -- --help` | Get help using the Astro CLI |