Skip to content

Commit

Permalink
feat(rewrite): Rewrote the whole thing in ReactJS 💅 (techno-tim#22)
Browse files Browse the repository at this point in the history
* feat(rewrite): Rewrote the whole thing in ReactJS 💅

* chore(docs): Updated
  • Loading branch information
timothystewart6 authored Aug 26, 2021
1 parent d9c4c97 commit 84b1a80
Show file tree
Hide file tree
Showing 70 changed files with 10,673 additions and 1,382 deletions.
6 changes: 6 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"presets": [
"@babel/preset-env",
"@babel/preset-react"
]
}
23 changes: 23 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# this is used for local debugging
# RAZZLE_ variable is passed to the server
# copy this to .env for testing

RAZZLE_META_TITLE=Techno Tim
RAZZLE_META_DESCRIPTION=Techno Tim Link page
RAZZLE_META_AUTHOR=Techno Tim
RAZZLE_THEME=Dark
RAZZLE_FAVICON_URL=https://pbs.twimg.com/profile_images/1286144221217316864/qIAsKOpB_200x200.jpg
RAZZLE_AVATAR_URL=https://pbs.twimg.com/profile_images/1286144221217316864/qIAsKOpB_200x200.jpg
RAZZLE_AVATAR_2X_URL=https://pbs.twimg.com/profile_images/1286144221217316864/qIAsKOpB_400x400.jpg
RAZZLE_AVATAR_ALT=Techno Tim Profile Pic
RAZZLE_NAME=TechnoTim
RAZZLE_BIO=Hey! Just a place where you can connect with me!
RAZZLE_GITHUB=https://github.com/timothystewart6
RAZZLE_TWITTER=https://twitter.com/TechnoTimLive
RAZZLE_INSTAGRAM=https://www.instagram.com/techno.tim
RAZZLE_YOUTUBE=https://www.youtube.com/channel/UCOk-gHyjcWZNj3Br4oxwh0A
RAZZLE_TWITCH=https://www.twitch.tv/technotim/
RAZZLE_DISCORD=https://discord.gg/DJKexrJ
RAZZLE_TIKTOK=https://www.tiktok.com/@technotim
RAZZLE_KIT=https://kit.co/TechnoTim
RAZZLE_FOOTER=Thanks for stopping by!
13 changes: 13 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
logs
*.log
npm-debug.log*
.DS_Store

coverage
node_modules
build
.env.local
.env.development.local
.env.test.local
.env.production.local
cache
42 changes: 42 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"parser": "@babel/eslint-parser",
"settings": {
"react": {
"pragma": "React",
"version": "detect"
}
},
"plugins": ["jsx","prettier"],
"extends": [
"eslint:recommended",
"plugin:react/recommended",
"prettier"
],
"env": {
"jest": true,
"jasmine": true,
"node": true,
"browser": true,
"es6": true

},
"rules": {
"prettier/prettier":
["error", {
"singleQuote": true,
"jsxSingleQuote": false,
"arrowParens": "avoid",
"semi": true,
"trailingComma": "all",
"spaceAfterFunction": true
}],
"no-console": ["error", { "allow": ["warn", "error"] }],
"no-alert": "error",
"no-debugger": "error",
"prefer-const": "error",
"prefer-arrow-callback": "error",
"no-unused-vars": ["error", {"args": "none"}],
"react/prop-types": 0,
"react/no-unescaped-entities": 0
}
}
2 changes: 2 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ jobs:
- name: Install Dependencies, Test, and Build
run: |
yarn install --frozen-lockfile --check-files
yarn lint
yarn test
env:
CI: true

Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,7 @@ jobs:
- name: Install Dependencies, Test, and Build
run: |
yarn install --frozen-lockfile --check-files
yarn lint
yarn test
env:
CI: true
30 changes: 9 additions & 21 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,26 +1,14 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# production
/build

# misc
logs
*.log
npm-debug.log*
.DS_Store

coverage
node_modules
build
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*

# this is is the output
www/index.html
.env
cache
13 changes: 13 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Attach to dev server",
"type": "node",
"request": "attach",
"protocol": "inspector",
"address": "localhost",
"port": 9229
}
]
}
29 changes: 17 additions & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,23 @@
FROM node:14.17.4-alpine
FROM node:14.17.4-alpine AS node-build
RUN apk --no-cache add \
gettext \
bash
ENV NODE_ENV=production

WORKDIR /usr/src/app
COPY package.json ./
COPY yarn.lock ./
COPY src ./src
COPY public ./public
RUN yarn install --frozen-lockfile --check-files
RUN yarn build --noninteractive
RUN yarn install --frozen-lockfile --check-files --production --modules-folder node_modules_prod

FROM node:14.17.4-alpine
WORKDIR /usr/src/app
COPY package.json yarn.lock ./
RUN yarn install --frozen-lockfile --check-files --production=true
COPY www ./www
COPY template ./template
COPY env.js ./
COPY app.js ./
COPY ./entrypoint.sh /
RUN chmod +x /entrypoint.sh
ENV NODE_ENV production
RUN mkdir -p /node_modules
COPY --from=node-build /usr/src/app/build ./build
COPY --from=node-build /usr/src/app/node_modules_prod ./node_modules
EXPOSE 3000
ENTRYPOINT ["/entrypoint.sh"]
CMD [ "node", "app.js" ]
CMD [ "node", "build/server.js" ]

11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# 🔗 LittleLink-Server

This project is based on the great work from [littlelink](https://github.com/sethcottle/littlelink)
It takes the same simple approach to a link page and hosts it within a nodeJS server containerized for you to use. Now, customizing `LittleLink` with `littlelink-server` is as easy as passing in some environment variables. If you need help configuring this, please see [this video that explains everything](https://www.youtube.com/watch?v=42SqfI_AjXU).
It takes the same simple approach to a link page and hosts it within a NodeJS server with React Server Side Rendering, containerized for you to use. Now, customizing `LittleLink` with `littlelink-server` is as easy as passing in some environment variables. If you need help configuring this, please see [this video that explains everything](https://www.youtube.com/watch?v=42SqfI_AjXU).

# 🚀 Getting Started

Expand Down Expand Up @@ -45,7 +45,9 @@ services:
# - MEDIUM=https://medium.com
# - PINTEREST=https://www.pinterest.com/
# - [email protected]
# - EMAIL_TEXT=Email Me!
# - [email protected]
# - EMAIL_ALT_TEXT=Email me!
# - SOUND_CLOUD=https://souncloud.com
# - FIGMA=https://figma.com
# - TELEGRAM=https://telegram.org/
Expand Down Expand Up @@ -87,20 +89,23 @@ docker run -d \
-e DISCORD='https://discord.gg/DJKexrJ' \
-e TIKTOK='https://www.tiktok.com/@technotim' \
-e KIT='https://kit.co/TechnoTim' \
-e EMAIL='[email protected]' \
-e EMAIL_TEXT='Email me!' \
-e FOOTER=Thanks for stopping by! \
--restart unless-stopped \
ghcr.io/techno-tim/littlelink-server:latest
```

## Kubernetes

[unoffical helm chart provided by k8s-at-home](https://github.com/k8s-at-home/charts/tree/master/charts/stable/littlelink-server)
[Unofficial helm chart provided by k8s-at-home](https://github.com/k8s-at-home/charts/tree/master/charts/stable/littlelink-server)

```
helm repo add k8s-at-home https://k8s-at-home.com/charts/
helm repo update
helm install littlelink-server \
--set env.TZ="America/New York" \
--set env.META_TITLE="Technotim"
--set env.META_TITLE="TechnoTim"
k8s-at-home/littlelink-server
```
Or use a values.yaml files
Expand Down
31 changes: 0 additions & 31 deletions app.js

This file was deleted.

3 changes: 1 addition & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,12 @@ services:
- BIO=Hey! Just a place where you can connect with me!
- GITHUB=https://github.com/timothystewart6
- TWITTER=https://twitter.com/TechnoTimLive
- MASTODON=https://mastodon.social/TechnoTimLive
- INSTAGRAM=https://www.instagram.com/techno.tim
- YOUTUBE=https://www.youtube.com/channel/UCOk-gHyjcWZNj3Br4oxwh0A/
- TWITCH=https://www.twitch.tv/technotim/
- DISCORD=https://discord.gg/DJKexrJ
- KIT=https://kit.co/TechnoTim
- FOOTER=Thanks for stopping by!
- FOOTER=Thanks for stopping by!!!

ports:
- 8080:3000
Expand Down
6 changes: 0 additions & 6 deletions entrypoint.sh

This file was deleted.

Loading

0 comments on commit 84b1a80

Please sign in to comment.