-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 922acfa
Showing
102 changed files
with
31,754 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
Oops, something went wrong.