Skip to content

Commit d58f7a5

Browse files
committed
Fly customizations
1 parent 3d2738d commit d58f7a5

File tree

7 files changed

+336
-14
lines changed

7 files changed

+336
-14
lines changed

.dockerignore

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
node_modules
5+
.pnp
6+
.pnp.js
7+
8+
# testing
9+
coverage
10+
11+
# next.js
12+
.next/
13+
out/
14+
build
15+
16+
# misc
17+
.DS_Store
18+
*.pem
19+
20+
# debug
21+
npm-debug.log*
22+
yarn-debug.log*
23+
yarn-error.log*
24+
.pnpm-debug.log*
25+
26+
# local env files
27+
.env.local
28+
.env.development.local
29+
.env.test.local
30+
.env.production.local
31+
32+
# turbo
33+
.turbo
34+
35+
.contentlayer
36+
.env

README.md

Lines changed: 36 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
</picture>
66
</a>
77

8-
# Arcjet example app
8+
# Arcjet + Fly.io example app
99

1010
[Arcjet](https://arcjet.com) helps developers protect their apps in just a few
1111
lines of code. This is an example application demonstrating the use of multiple
@@ -29,14 +29,44 @@ This example is deployed at
2929
Shield, which detects suspicious behavior, such as SQL injection and
3030
cross-site scripting attacks.
3131

32-
## Deploy it now
32+
##  Deploy to Fly.io
3333

34-
[![Deploy with
35-
Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Farcjet%2Farcjet-js-example&project-name=arcjet-example&repository-name=arcjet-example&developer-id=oac_1GEcKBuKBilVnjToj1QUwdb8&demo-title=Arcjet%20Example%20&demo-description=Example%20rate%20limiting%2C%20bot%20protection%2C%20email%20verification%20%26%20form%20protection.&demo-url=https%3A%2F%2Fgithub.com%2Farcjet%2Farcjet-js-example&demo-image=https%3A%2F%2Fapp.arcjet.com%2Fimg%2Fexample-apps%2Fvercel%2Fdemo-image.jpg&integration-ids=oac_1GEcKBuKBilVnjToj1QUwdb8&external-id=arcjet-js-example)
34+
1. Set up a new Fly.io app
35+
36+
```bash
37+
fly launch --name $YOUR_APP_NAME --no-deploy
38+
```
39+
40+
Replace `$YOUR_APP_NAME` with whatever name you'd like. This command will
41+
generate a `Dockerfile` and a `fly.toml` for you.
42+
43+
2. Create an Arcjet account and link it to your Fly.io app:
44+
45+
```bash
46+
fly ext arcjet create
47+
```
48+
49+
3. Deploy to Fly.io:
50+
51+
```bash
52+
fly deploy
53+
```
54+
55+
4. Open your app in your browser and try out the features.
56+
57+
5. Review the request details in your Arcjet dashboard:
58+
59+
```bash
60+
fly ext arcjet dashboard
61+
```
3662

3763
## Run locally
3864

39-
1. [Register for a free Arcjet account](https://app.arcjet.com).
65+
1. Log into your Arcjet dashboard to get the `ARCJET_KEY` for your app.
66+
67+
```bash
68+
fly ext arcjet dashboard
69+
```
4070

4171
2. Install dependencies:
4272

@@ -67,4 +97,4 @@ npm run dev
6797
example](https://github.com/arcjet/arcjet-js/tree/main/examples/nextjs-14-react-hook-form))
6898
- Client-side validation: [Zod](https://zod.dev/)
6999
- Security: [Arcjet](https://arcjet.com/)
70-
- Platform: [Vercel](https://vercel.com/) (see [our integration](https://vercel.com/integrations/arcjet))
100+
- Platform: [Fly.io](https://fly.io/)

app/page.tsx

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export default function IndexPage() {
66
<section className="container grid items-center gap-6 pb-8 pt-6 md:py-10">
77
<div className="flex max-w-[980px] flex-col items-start gap-2">
88
<h1 className="text-3xl font-extrabold leading-tight tracking-tighter md:text-4xl">
9-
Arcjet example app
9+
Arcjet + Fly.io example app
1010
</h1>
1111
<p className="max-w-[700px]">
1212
<Link
@@ -52,11 +52,6 @@ export default function IndexPage() {
5252
</Link>
5353
</div>
5454

55-
<h2 className="text-xl font-bold">Deploy it now</h2>
56-
<a href="https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Farcjet%2Farcjet-js-example&project-name=arcjet-example&repository-name=arcjet-example&developer-id=oac_1GEcKBuKBilVnjToj1QUwdb8&demo-title=Arcjet%20Example%20&demo-description=Example%20rate%20limiting%2C%20bot%20protection%2C%20email%20verification%20%26%20form%20protection.&demo-url=https%3A%2F%2Fgithub.com%2Farcjet%2Farcjet-js-example&demo-image=https%3A%2F%2Fapp.arcjet.com%2Fimg%2Fexample-apps%2Fvercel%2Fdemo-image.jpg&integration-ids=oac_1GEcKBuKBilVnjToj1QUwdb8&external-id=arcjet-js-example">
57-
<img src="https://vercel.com/button" alt="Deploy with Vercel" />
58-
</a>
59-
6055
<h2 className="text-xl font-bold">What next?</h2>
6156
<div className="flex gap-4">
6257
<Link

components/main-nav.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ export function MainNav({ items }: MainNavProps) {
1313
<div className="flex gap-6 md:gap-10">
1414
<Link href="/" className="flex items-center space-x-2">
1515
<LogoMarkSpark className="size-[24.4px]" />
16-
<span className="inline-block font-bold">Arcjet Example App</span>
16+
<span className="inline-block font-bold">
17+
Arcjet + Fly.io Example App
18+
</span>
1719
</Link>
1820
{items?.length ? (
1921
<nav className="flex gap-6">

0 commit comments

Comments
 (0)