├── .gitignore
├── .vscode
├── extensions.json
└── launch.json
├── README.md
├── astro.config.mjs
├── package-lock.json
├── package.json
├── public
└── favicon.svg
├── src
├── components
│ └── EmailForm.tsx
├── emails
│ └── SampleEmail.tsx
├── env.d.ts
└── pages
│ ├── api
│ └── sendEmail.json.ts
│ └── index.astro
├── tailwind.config.mjs
└── tsconfig.json
/.gitignore:
--------------------------------------------------------------------------------
1 | # build output
2 | dist/
3 | # generated types
4 | .astro/
5 |
6 | # dependencies
7 | node_modules/
8 |
9 | # logs
10 | npm-debug.log*
11 | yarn-debug.log*
12 | yarn-error.log*
13 | pnpm-debug.log*
14 |
15 |
16 | # environment variables
17 | .env
18 | .env.production
19 |
20 | # macOS-specific files
21 | .DS_Store
22 |
--------------------------------------------------------------------------------
/.vscode/extensions.json:
--------------------------------------------------------------------------------
1 | {
2 | "recommendations": ["astro-build.astro-vscode"],
3 | "unwantedRecommendations": []
4 | }
5 |
--------------------------------------------------------------------------------
/.vscode/launch.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": "0.2.0",
3 | "configurations": [
4 | {
5 | "command": "./node_modules/.bin/astro dev",
6 | "name": "Development server",
7 | "request": "launch",
8 | "type": "node-terminal"
9 | }
10 | ]
11 | }
12 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Astro Starter Kit: Minimal
2 |
3 | ```sh
4 | npm create astro@latest -- --template minimal
5 | ```
6 |
7 | [](https://stackblitz.com/github/withastro/astro/tree/latest/examples/minimal)
8 | [](https://codesandbox.io/p/sandbox/github/withastro/astro/tree/latest/examples/minimal)
9 | [](https://codespaces.new/withastro/astro?devcontainer_path=.devcontainer/minimal/devcontainer.json)
10 |
11 | > 🧑🚀 **Seasoned astronaut?** Delete this file. Have fun!
12 |
13 | ## 🚀 Project Structure
14 |
15 | Inside of your Astro project, you'll see the following folders and files:
16 |
17 | ```text
18 | /
19 | ├── public/
20 | ├── src/
21 | │ └── pages/
22 | │ └── index.astro
23 | └── package.json
24 | ```
25 |
26 | Astro looks for `.astro` or `.md` files in the `src/pages/` directory. Each page is exposed as a route based on its file name.
27 |
28 | There's nothing special about `src/components/`, but that's where we like to put any Astro/React/Vue/Svelte/Preact components.
29 |
30 | Any static assets, like images, can be placed in the `public/` directory.
31 |
32 | ## 🧞 Commands
33 |
34 | All commands are run from the root of the project, from a terminal:
35 |
36 | | Command | Action |
37 | | :------------------------ | :----------------------------------------------- |
38 | | `npm install` | Installs dependencies |
39 | | `npm run dev` | Starts local dev server at `localhost:4321` |
40 | | `npm run build` | Build your production site to `./dist/` |
41 | | `npm run preview` | Preview your build locally, before deploying |
42 | | `npm run astro ...` | Run CLI commands like `astro add`, `astro check` |
43 | | `npm run astro -- --help` | Get help using the Astro CLI |
44 |
45 | ## 👀 Want to learn more?
46 |
47 | Feel free to check [our documentation](https://docs.astro.build) or jump into our [Discord server](https://astro.build/chat).
48 |
--------------------------------------------------------------------------------
/astro.config.mjs:
--------------------------------------------------------------------------------
1 | import { defineConfig } from 'astro/config';
2 | import node from "@astrojs/node";
3 | import react from "@astrojs/react";
4 |
5 | import tailwind from "@astrojs/tailwind";
6 |
7 | // https://astro.build/config
8 | export default defineConfig({
9 | output: "server",
10 | adapter: node({
11 | mode: "standalone"
12 | }),
13 | integrations: [react(), tailwind()]
14 | });
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "resend-overview",
3 | "type": "module",
4 | "version": "0.0.1",
5 | "scripts": {
6 | "dev": "astro dev",
7 | "start": "astro dev",
8 | "build": "astro check && astro build",
9 | "preview": "astro preview",
10 | "astro": "astro"
11 | },
12 | "dependencies": {
13 | "@astrojs/check": "^0.3.1",
14 | "@astrojs/node": "^6.0.4",
15 | "@astrojs/react": "^3.0.6",
16 | "@astrojs/tailwind": "^5.0.2",
17 | "@react-email/components": "^0.0.11",
18 | "@react-email/render": "^0.0.9",
19 | "@types/react": "^18.2.38",
20 | "@types/react-dom": "^18.2.17",
21 | "astro": "^3.6.0",
22 | "react": "^18.2.0",
23 | "react-dom": "^18.2.0",
24 | "react-email": "^1.9.5",
25 | "resend": "^2.0.0",
26 | "tailwindcss": "^3.3.5",
27 | "typescript": "^5.3.2"
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/public/favicon.svg:
--------------------------------------------------------------------------------
1 |
10 |
--------------------------------------------------------------------------------
/src/components/EmailForm.tsx:
--------------------------------------------------------------------------------
1 | import { render } from "@react-email/render";
2 | import SampleEmail from "../emails/SampleEmail";
3 | import { useState } from "react";
4 |
5 | const dbData = [
6 | {
7 | email: "chris@learnastro.dev",
8 | name: "Chris Pennington",
9 | sent: false,
10 | },
11 | {
12 | email: "chris@learnastro.dev",
13 | name: "Chris Alternate",
14 | sent: false,
15 | },
16 | {
17 | email: "chris@learnastro.dev",
18 | name: "Chris Tertiary",
19 | sent: false,
20 | },
21 | ];
22 |
23 | const EmailForm = () => {
24 | const [data, setData] = useState(dbData);
25 |
26 | const handleSubmit = async (e: React.FormEvent
75 |
76 |
92 | )}
93 |
96 |
77 |
81 |
82 |
83 | {data.map((row) => (
84 | Email
78 | Name
79 | Sent
80 |
85 |
89 | ))}
90 |
91 | {row.email}
86 | {row.name}
87 | {row.sent ? "✅" : "❌"}
88 |