1
1
# Astro Fastify Starter
2
2
3
3
This is an example repo of having astro and fastify in the same app.
4
- It's based off the fastify example in the
4
+ This example is based on the fastify example in the
5
5
[ node adapter] ( https://docs.astro.build/en/guides/integrations-guide/node/#middleware ) section.
6
6
The main difference is this uses typescript. It also has an example of using the
7
7
[ trpc fastify adapter] ( https://trpc.io/docs/server/adapters/fastify ) , so you have end-to-end type safety.
8
8
9
9
## Auth
10
10
11
- Auth is set up for [ Lucia] ( https://lucia-auth.com/ ) .
11
+ Auth was set up for [ Lucia] ( https://lucia-auth.com/ )
12
+ but has been changed to the guide at [ Lucia-next] ( https://lucia-next.pages.dev/ ) .
12
13
It's currently using username/password auth and storing to a session.
13
14
That information is available to astro as well as fastify and trpc.
14
15
@@ -18,7 +19,7 @@ Data access is done using [Drizzle](https://orm.drizzle.team/), and the example
18
19
19
20
## 🚀 Project Structure
20
21
21
- Inside of your Astro project, you'll see the following folders and files:
22
+ Inside your Astro project, you'll see the following folders and files:
22
23
23
24
``` text
24
25
/
@@ -32,8 +33,11 @@ Inside of your Astro project, you'll see the following folders and files:
32
33
│ │ └── Card.astro
33
34
│ ├── layouts/
34
35
│ │ └── Layout.astro
35
- │ └── pages/
36
- │ └── index.astro
36
+ │ |── pages/
37
+ │ | └── index.astro
38
+ | |-- middleware.ts
39
+ | |-- schema.ts
40
+ | |-- session.ts
37
41
└── run-server.mjs
38
42
└── package.json
39
43
```
@@ -43,10 +47,12 @@ Inside of your Astro project, you'll see the following folders and files:
43
47
All commands are run from the root of the project, from a terminal:
44
48
45
49
| Command | Action |
46
- | :------------------------ | :----------------------------------------------- |
50
+ | :-------------------------- | :------------------------------------------------- |
47
51
| ` npm install ` | Installs dependencies |
48
52
| ` npm run dev ` | Starts local dev server at ` localhost:4321 ` |
49
53
| ` npm run build ` | Build your production site to ` ./dist/ ` |
50
54
| ` npm run start ` | Start your production build |
51
55
| ` npm run astro ... ` | Run CLI commands like ` astro add ` , ` astro check ` |
52
- | ` npm run astro -- --help ` | Get help using the Astro CLI |
56
+ | ` npm run generate ` | Generate schema |
57
+ | ` npm run migrate ` | Run migrations |
58
+ | ` npm run studio ` | Run Drizzle-kit Studio |
0 commit comments