Skip to content

Commit 89dcc6e

Browse files
committed
UPDATE: header and basics working
1 parent 6fc79ca commit 89dcc6e

13 files changed

+762
-30
lines changed

.dockerignore

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Dockerfile
2+
.dockerignore
3+
*.env
4+
*.md
5+
*.sh

Dockerfile

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# syntax=docker/dockerfile:1.7-labs
2+
FROM node:20-bookworm AS base
3+
4+
WORKDIR /app
5+
6+
USER root
7+
8+
RUN apt-get update && apt-get install -y dumb-init
9+
10+
# Copy the just the files necessary for npm ci
11+
COPY package.json package-lock.json /app/
12+
RUN npm install --audit=false --fund=false --omit dev
13+
14+
15+
FROM base AS builder
16+
17+
COPY . /app/
18+
19+
RUN npm install --audit=false --fund=false
20+
RUN npm run build
21+
22+
23+
FROM gcr.io/distroless/nodejs20-debian12:latest AS runner
24+
25+
ARG COMMIT="(not set)"
26+
ARG LASTMOD="(not set)"
27+
ENV COMMIT=$COMMIT
28+
ENV LASTMOD=$LASTMOD
29+
ENV NODE_ENV=production
30+
31+
USER nonroot
32+
COPY --chown=nonroot:nonroot --from=base /usr/bin/dumb-init /usr/bin/dumb-init
33+
COPY --chown=nonroot:nonroot --from=builder /app/build /app/build
34+
COPY --chown=nonroot:nonroot --from=builder /app/node_modules /app/node_modules
35+
COPY --chown=nonroot:nonroot ./server.js /app/server.js
36+
COPY --chown=nonroot:nonroot ./package.json /app/package.json
37+
38+
WORKDIR /app
39+
ENTRYPOINT ["/usr/bin/dumb-init", "--"]
40+
CMD ["/nodejs/bin/node", "./server.js"]

LICENSE.txt

+428
Large diffs are not rendered by default.

README.md

+39-22
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,53 @@
1-
# Welcome to Remix + Vite!
1+
# Regex Zone [<img alt="Logo for Regex Zone" src="public/favicon.svg" height="96" align="right"/>](https://www.regex.zone/)
22

3-
📖 See the [Remix docs](https://remix.run/docs) and the [Remix Vite docs](https://remix.run/docs/en/main/future/vite) for details on supported features.
3+
[![build](https://github.com/regexplanet/regex-zone/actions/workflows/gcr-deploy.yaml/badge.svg)](https://github.com/regexplanet/regex-zone/actions/workflows/gcr-deploy.yaml)
44

5-
## Development
5+
A catalog of useful regular expressions and related resources.
66

7-
Run the Vite dev server:
7+
## License
88

9-
```shellscript
10-
npm run dev
11-
```
9+
CC BY-SA 4.0: [Overview](https://creativecommons.org/licenses/by-sa/4.0/), [legal text](LICENSE.txt)
1210

13-
## Deployment
11+
## Contributing
1412

15-
First, build your app for production:
13+
LATER
1614

17-
```sh
18-
npm run build
19-
```
15+
## Links
2016

21-
Then run the app in production mode:
17+
- [Wikipedia:Regular_Expression](https://en.wikipedia.org/wiki/Regular_expression)
2218

23-
```sh
24-
npm start
25-
```
19+
## Other Libraries of Regex Patterns
2620

27-
Now you'll need to pick a host to deploy it to.
21+
- [GitLeaks](https://github.com/gitleaks/gitleaks/blob/master/config/gitleaks.toml)
22+
- [iHateRegex](https://github.com/geongeorge/i-hate-regex/tree/master/static/regex)
23+
- [mingrammer/commonregex](https://github.com/mingrammer/commonregex)
24+
- [pyWhat](https://github.com/bee-san/pyWhat/blob/main/pywhat/Data/regex.json)
25+
- [RegexHub](https://projects.lukehaas.me/regexhub/)
26+
- [RegExLib](https://regexlib.com/Default.aspx)
27+
- [sindresorhus](https://github.com/sindresorhus?tab=repositories&q=regex&type=&language=&sort=)
2828

29-
### DIY
29+
## Credits
3030

31-
If you're familiar with deploying Node applications, the built-in Remix app server is production-ready.
31+
[![Google CloudRun](https://www.vectorlogo.zone/logos/google_cloud_run/google_cloud_run-ar21.svg)](https://cloud.google.com/run/ "Hosting")
32+
[![Git](https://www.vectorlogo.zone/logos/git-scm/git-scm-ar21.svg)](https://git-scm.com/ "Version control")
33+
[![Github](https://www.vectorlogo.zone/logos/github/github-ar21.svg)](https://github.com/ "Code hosting")
34+
[![Google Noto Emoji](https://www.vectorlogo.zone/logos/google/google-ar21.svg)](https://github.com/googlefonts/noto-emoji/blob/master/svg/emoji_u1f441.svg "Logo/Favicon")[![NodePing](https://www.vectorlogo.zone/logos/nodeping/nodeping-ar21.svg)](https://nodeping.com?rid=201109281250J5K3P "Uptime monitoring")
35+
[![npm](https://www.vectorlogo.zone/logos/npmjs/npmjs-ar21.svg)](https://www.npmjs.com/ "JS Package Management")
36+
[![Phosphor Icons](https://www.vectorlogo.zone/logos/phosphoricons/phosphoricons-ar21.svg)](https://phosphoricons.com/ "Toolbar icons")
37+
[![react.js](https://www.vectorlogo.zone/logos/reactjs/reactjs-ar21.svg)](https://reactjs.org/ "UI Framework")
38+
[![Remix](https://www.vectorlogo.zone/logos/remix/remix-ar21.svg)](https://remix.run/ "React Framework")
39+
[![TypeScript](https://www.vectorlogo.zone/logos/typescriptlang/typescriptlang-ar21.svg)](https://www.typescriptlang.org/ "Programming Language")
40+
[![Vite](https://www.vectorlogo.zone/logos/vitejsdev/vitejsdev-ar21.svg)](https://vitejs.dev/ "Bundler")
3241

33-
Make sure to deploy the output of `npm run build`
42+
## Font
43+
44+
- Roboto Slab
45+
- OpenSans for body
46+
- Nimbus Mono for code
47+
48+
- Jetbrains mono
49+
- roboto mono
50+
- b612-mono
51+
- DM Mono
52+
- Courier Prime
3453

35-
- `build/server`
36-
- `build/client`

TODO.md

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# To Do
2+
3+
- [ ] /library/
4+
- [ ] /library/xxx/
5+
- [ ] nodeping
6+
- [ ] /tag/
7+
- [ ] /tag/xxx/
8+
- [ ] comments via utteranc.es
9+
- [ ] homepage: search
10+
- [ ] homepage: featured
11+
- [ ] homepage: latest
12+
- [ ] sitemap.xml
13+
- [ ] post to RegexPlanet
14+
- [ ] JSON schema for library
15+
- [ ] CI for yaml validated via json schema
16+
- [ ] more regex in the catalog
17+
- [ ] post to places besides RXP
18+
- [ ] 404 page
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
.header {
2+
height: rem(56px);
3+
margin-bottom: rem(120px);
4+
background-color: var(--mantine-color-body);
5+
border-bottom: rem(1px) solid light-dark(var(--mantine-color-gray-3), var(--mantine-color-dark-4));
6+
padding-left: var(--mantine-spacing-md);
7+
padding-right: var(--mantine-spacing-md);
8+
}
9+
10+
.inner {
11+
height: rem(56px);
12+
display: flex;
13+
justify-content: space-between;
14+
align-items: center;
15+
}
16+
17+
.link {
18+
display: block;
19+
line-height: 1;
20+
padding: rem(8px) rem(12px);
21+
border-radius: var(--mantine-radius-sm);
22+
text-decoration: none;
23+
color: light-dark(var(--mantine-color-gray-7), var(--mantine-color-dark-0));
24+
font-size: var(--mantine-font-size-sm);
25+
font-weight: 500;
26+
27+
@mixin hover {
28+
background-color: light-dark(var(--mantine-color-gray-0), var(--mantine-color-dark-6));
29+
}
30+
}
31+
32+
.sitename {
33+
font-size: var(--mantine-font-size-lg);
34+
font-weight: 700;
35+
color: light-dark(var(--mantine-color-gray-9), var(--mantine-color-dark-0));
36+
text-decoration: none;
37+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
import { Autocomplete, Group, Burger, rem, Anchor } from '@mantine/core';
2+
import { useDisclosure } from '@mantine/hooks';
3+
import { PiMagnifyingGlass } from 'react-icons/pi';
4+
5+
import classes from './HeaderSearch.module.css';
6+
import RegexZoneSvg from '../Logos/RegexZoneSvg';
7+
8+
const links = [
9+
{ link: '/library/', label: 'Library' },
10+
{ link: '/docs/', label: 'Docs' },
11+
{ link: 'https://www.regexplanet.com/', label: 'Testing' },
12+
{ link: 'https://github.com/regexplanet/regex-zone/discussions', label: 'Community' },
13+
];
14+
15+
export function HeaderSearch() {
16+
const [opened, { toggle }] = useDisclosure(false);
17+
18+
const items = links.map((link) => (
19+
<a
20+
key={link.label}
21+
href={link.link}
22+
className={classes.link}
23+
onClick={(event) => {
24+
if (!link.link.startsWith("https://")) {
25+
event.preventDefault()
26+
}
27+
}}
28+
>
29+
{link.label}
30+
</a>
31+
));
32+
33+
return (
34+
<header className={classes.header}>
35+
<div className={classes.inner}>
36+
<Group>
37+
<Burger opened={opened} onClick={toggle} size="sm" hiddenFrom="sm" />
38+
<RegexZoneSvg style={{ width: rem(32), height: rem(32) }} />
39+
<Anchor
40+
className={classes.sitename}
41+
href="/"
42+
visibleFrom="md"
43+
>Regex Zone</Anchor>
44+
</Group>
45+
46+
<Group>
47+
<Group ml={50} gap={5} className={classes.links} visibleFrom="sm">
48+
{items}
49+
</Group>
50+
<Autocomplete
51+
className={classes.search}
52+
placeholder="Search"
53+
leftSection={<PiMagnifyingGlass style={{ width: rem(16), height: rem(16) }} />}
54+
data={['React', 'Angular', 'Vue', 'Next.js', 'Riot.js', 'Svelte', 'Blitz.js']}
55+
/>
56+
</Group>
57+
</div>
58+
</header>
59+
);
60+
}

app/components/Logos/RegexZoneSvg.tsx

+94
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
import * as React from "react"
2+
3+
4+
const SvgComponent = (props) => (
5+
<svg
6+
xmlns="http://www.w3.org/2000/svg"
7+
xmlSpace="preserve"
8+
style={{
9+
enableBackground: "new 0 0 128 128",
10+
}}
11+
viewBox="0 0 128 128"
12+
{...props}
13+
>
14+
<path
15+
d="M63.04 7.57C36.72 6.97 7.69 28.8 8.25 64.16c.49 31.09 23.85 54.62 54.12 55.11 30.27.49 57.09-19.52 57.25-55.27.17-36.03-27.63-55.77-56.58-56.43z"
16+
style={{
17+
fill: "#ff2a23",
18+
}}
19+
/>
20+
<path
21+
d="M63.12 20.19c-20.88.71-41.95 16.29-42.44 43.76-.49 27.47 23.52 42.77 42.44 42.77 24.02 0 44.09-18.92 43.59-44.09-.49-25.16-19.41-43.26-43.59-42.44z"
22+
style={{
23+
fill: "#fffdfe",
24+
}}
25+
/>
26+
<path
27+
d="M63.61 30.89c-18.92-.43-32.9 16.29-33.07 32.24-.16 16.29 10.03 32.9 32.74 33.72S96.67 79.58 97 64.28c.34-15.3-11.84-32.9-33.39-33.39z"
28+
style={{
29+
fill: "#ff2a23",
30+
}}
31+
/>
32+
<path
33+
d="M41.98 63.73c-.16 14.31 10.03 22.54 22.37 22.54 11.21 0 22.21-7.07 22.21-22.04 0-13.49-10.2-21.55-21.55-22.04-11.35-.5-22.87 7.73-23.03 21.54z"
34+
style={{
35+
fill: "#fff",
36+
}}
37+
/>
38+
<path
39+
d="M52.1 63.62c-.61 8.53 6.33 12.61 12.58 12.61 5.92 0 11.76-3.89 11.93-11.79.15-7.42-5.67-11.95-11.93-12.17-6.46-.22-12.09 4.42-12.58 11.35z"
40+
style={{
41+
fill: "#fb2b22",
42+
}}
43+
/>
44+
<path
45+
d="m66.74 64.29-3.35 1.86 6.39 9.09s4.94.38 6.08-.91-.15-5.09-.15-5.09l-8.97-4.95z"
46+
style={{
47+
fill: "#cc1935",
48+
}}
49+
/>
50+
<path
51+
d="M87.42 54.41c-.9-1.86-1.82-3.35-4.26-2.89-2.43.46-6.92 3.04-7.76 4.26-.77 1.12-1.52 2.51-1.52 2.51s-8.6 4.7-9.96 5.47c-2.13 1.22-.66 3.7.84 3.42 2.05-.38 11.21-4.11 11.21-4.11s1.94.46 3.08.46c1.14 0 7.64-3.21 8.52-3.8 1.45-.99.76-3.42-.15-5.32z"
52+
style={{
53+
fill: "#acb1b5",
54+
}}
55+
/>
56+
<path
57+
d="M75.68 69.22s-.48 1.7-2.23 3.46c-1.82 1.82-3.69 2.54-3.69 2.54l5.77 8.46s4.29.31 7.41-2.73 1.76-7.02 1.76-7.02l-9.02-4.71z"
58+
style={{
59+
fill: "#c8c8c8",
60+
}}
61+
/>
62+
<path
63+
d="m81.4 92.57-5.88-8.9s.98-.52 2.27-1.4c2.37-1.62 3.69-2.91 5.38-5.55.92-1.42 1.51-2.8 1.51-2.8l9.09 4.49s-.2 7.02-3.17 10.44-9.2 3.72-9.2 3.72z"
64+
style={{
65+
fill: "#cc1935",
66+
}}
67+
/>
68+
<path
69+
d="m81.4 92.57 5.05 7.57s6.59.65 11.99-5.82 3.96-11.79 3.96-11.79l-8.63-4.13s-1.68 4.04-5.02 7.92-7.35 6.25-7.35 6.25z"
70+
style={{
71+
fill: "#c8c8c8",
72+
}}
73+
/>
74+
<path
75+
d="m93.93 111.33-7.47-11.18s5.63-3.29 9.63-8.02c4.15-4.91 6.32-9.58 6.32-9.58l12.09 6.01s-2.72 7.03-8.75 13.38c-5.9 6.19-11.82 9.39-11.82 9.39z"
76+
style={{
77+
fill: "#cc1935",
78+
}}
79+
/>
80+
<path
81+
d="M81.61 57.37c1.13 2.11 3 2.13 4.98 1.29 1.98-.84 11.33-7.45 11.33-7.45s12.7 6.39 20.91 3.19c8.21-3.19 7.98-11.86 7.98-11.86l-4.86-3.08s3.54-1.84 4.68-2.52c.56-.34 1.39-1.6.93-2.73-.36-.88-1.74-1.18-2.88-.72-1.14.46-4.43 1.49-4.43 1.49s1.31-5.45 1.08-5.75c-.23-.3-2.59-1.52-2.59-1.52s-7.68 0-8.67.38c-.99.38-8.59 7.91-8.59 7.91l-3.65 7.45-1.56 3.32s-10.65 4.77-12.25 5.45c-1.59.69-3.8 2.58-2.41 5.15z"
82+
style={{
83+
fill: "#006ca9",
84+
}}
85+
/>
86+
<path
87+
d="M98.54 45.85s4.48-3.24 7.67-4.84 9.11-3.55 10.86-3.76c1.75-.21 2.47.26 2.78 1.08.31.82-.72 1.85-1.6 2.32-.87.46-5.51 2.57-10.65 5.3s-7.58 4.73-9.66 5.2c-1.05.24-2.4-.7-2.48-2.27-.06-1.22.18-2.24.98-4.58.98-2.88 3.13-7.21 4.94-10.03 2.68-4.17 6.54-7 10.81-7.77 4.27-.77 7.77.31 8.65 1.03.87.72.82 1.46.51 1.71-.31.25-.77.45-3.09-.37-1.61-.57-6.74-.57-10.34 2.11-3.64 2.7-4.53 4.37-6.12 7.31s-3.26 7.56-3.26 7.56z"
88+
style={{
89+
fill: "#1f87fd",
90+
}}
91+
/>
92+
</svg>
93+
)
94+
export default SvgComponent

app/components/Welcome/Welcome.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ export function Welcome() {
55
return (
66
<>
77
<Title className={classes.title} ta="center" mt={100}>
8-
Welcome to{" "}
8+
<Text inherit>Welcome to the</Text>
99
<Text
1010
inherit
1111
variant="gradient"
1212
component="span"
1313
gradient={{ from: "pink", to: "yellow" }}
1414
>
15-
Mantine
15+
Regex Zone
1616
</Text>
1717
</Title>
1818
<Text color="dimmed" ta="center" size="lg" maw={580} mx="auto" mt="xl">

app/routes/_index.tsx

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
11
import type { MetaFunction } from "@remix-run/node";
22
import { Welcome } from "~/components/Welcome/Welcome";
33
import { ColorSchemeToggle } from "~/components/ColorSchemeToggle/ColorSchemeToggle";
4+
import { HeaderSearch } from "~/components/HeaderSearch/HeaderSearch";
45

56
export const meta: MetaFunction = () => {
67
return [
7-
{ title: "Mantine Remix App" },
8-
{ name: "description", content: "Welcome to Mantine!" },
8+
{ title: "Regex Zone" },
9+
{ name: "description", content: "A library of useful regular expressions" },
910
];
1011
};
1112

1213
export default function Index() {
1314
return (
14-
<div>
15+
<>
16+
<HeaderSearch />
1517
<Welcome />
1618
<ColorSchemeToggle />
17-
</div>
19+
</>
1820
);
1921
}

0 commit comments

Comments
 (0)