Skip to content

Commit

Permalink
Squashed commits
Browse files Browse the repository at this point in the history
  • Loading branch information
mattsrobot committed Mar 8, 2024
0 parents commit 922acfa
Show file tree
Hide file tree
Showing 102 changed files with 31,754 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/purge-cache.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Purge cache
on:
push:
branches:
- main

jobs:
deploy:
runs-on: ubuntu-latest
steps:

- name: Purge cache
uses: jakejarvis/cloudflare-purge-action@master
env:
CLOUDFLARE_ZONE: ${{ secrets.CLOUDFLARE_ZONE }}
CLOUDFLARE_TOKEN: ${{ secrets.CLOUDFLARE_TOKEN }}
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
node_modules
dist
.DS_store
/public/build

/.cache
/build
/public/build
.env
.env.prod
5 changes: 5 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# this is needed if using pnpm with electron builder,
# as electron builder needs to copy _all_ node modules,
# and pnpm doesn't normally make them all available

shamefully-hoist = true
47 changes: 47 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# syntax=docker/dockerfile:1

FROM node:bookworm-slim as base

EXPOSE 3000
ENV NODE_ENV production

FROM base as deps

WORKDIR /myapp

ADD server.mjs ./
ADD package.json ./
RUN npm install --include=dev

FROM base as production-deps

WORKDIR /myapp

COPY --from=deps /myapp/node_modules /myapp/node_modules
ADD server.mjs ./
ADD package.json ./
RUN npm prune --omit=dev

FROM base as build

WORKDIR /myapp

COPY --from=deps /myapp/node_modules /myapp/node_modules

ADD . .
RUN npx remix build

FROM base

ENV NODE_ENV="production"

WORKDIR /myapp

COPY --from=production-deps /myapp/node_modules /myapp/node_modules

COPY --from=build /myapp/build /myapp/build
COPY --from=build /myapp/public /myapp/public
COPY --from=build /myapp/package.json /myapp/package.json
COPY --from=build /myapp/server.mjs /myapp/server.mjs

CMD ["node", "server.mjs"]
53 changes: 53 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Install dependencies (node_modules)

Run ```npm install```

# Setup .env file

Create a .env file in the project root with the following:

```
X_WICKED_HEADER='something'
API_URL='http://localhost:3003/v1'
HOT_URL='http://localhost:3005/v1'
```

X_WICKED_HEADER is a header used to identify clients connecting to the API. For running locally you can use any value, but for connecting to the production environment - Cloudflare will block requests without a valid header.

API_URL is the Auth server (usually port 3003 locally).

HOT_URL is the Hot server (usually port 3005 locally).

# Running the app locally

```npx remix dev```

You should see a Remix server running locally on port 3000

# Creating a new user

In order to create an account you'll need to create a new record in the beta_users table (assuming you have a MySQL server running and have run go migrate to setup the tables).

Create a new entry in beta_users with your email address, with redeemed set to 0, and enabled set to 1.

Now you can navigate your browser to http://localhost:3000/signup and create your user.

# Building web app app:

```
npx remix dev
```

# Building electron app:

```
npm run desktop-dev
```

# Installing ES modules

```
npx rmx-cli get-esm-packages framer-motion
```

Then modify remix.config
14 changes: 14 additions & 0 deletions app/api/sitemap.server.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { hotRequest } from "../wikid.server";
import env from "../environment.server";

const sitemap = async () => {
const request = {
url: `${env.readHotUrl}/internal/sitemap`,
method: 'get',
postData: null,
jwt: null
}
return hotRequest(request);
}

export default sitemap;
Loading

0 comments on commit 922acfa

Please sign in to comment.