Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rewrite with sidebase #41

Open
wants to merge 74 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 62 commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
beae65f
cloned sidebase
Sep 5, 2022
f97de23
cloned sidebase
Sep 5, 2022
1632096
created button component
Sep 5, 2022
b4a0bdd
moved nuxt3 to scaffold
Sep 5, 2022
60d4cc1
updated classes to tailwind
Sep 5, 2022
d8981ad
update class name
Sep 5, 2022
22ddbd8
added bottom line
Sep 5, 2022
9e6282b
added margin
Sep 5, 2022
047b9f5
bottom line show up on all the pages
Sep 5, 2022
7bae5e7
replaced url space to dash
Sep 5, 2022
84416ae
removed bottom line
Sep 5, 2022
dbad8b8
added resolver for inkline and tidy up the code
Sep 6, 2022
b47d3a7
fixed import
Sep 6, 2022
a8ee7a9
changed to useHead
Sep 6, 2022
842afe8
test
Sep 6, 2022
b2c27ea
fix lint and name page
Sep 6, 2022
713e404
updated typo
Sep 6, 2022
9d14a62
updated readme
Sep 6, 2022
cf12794
addressed changes
Sep 6, 2022
cf14de1
removed redundant code
Sep 6, 2022
4284e78
removed example code
Sep 6, 2022
2887dac
removed unsused code
Sep 6, 2022
14b3d85
suggestion endpoint
Sep 6, 2022
c3b71e1
removed unused code
Sep 7, 2022
c5c1609
adjust with sidebase server update
Sep 7, 2022
822746e
updated css
Sep 7, 2022
273657a
removed unused icon
Sep 7, 2022
c758448
components test
Sep 7, 2022
d78dfc5
production mode directory updated
Sep 7, 2022
89a7f3a
small css change
Sep 7, 2022
bc27635
for git test
Sep 7, 2022
3e9be1c
moved to antdesign comp
Sep 8, 2022
242d408
moved useHead to pages
Sep 8, 2022
fea6944
added footer
Sep 8, 2022
80bb626
small css changes
Sep 8, 2022
3653657
updated meta data
Sep 8, 2022
673097d
small css changes
Sep 8, 2022
d3d5308
tags updated
Sep 8, 2022
46904c4
removed example entity
Sep 8, 2022
6a43fa2
removed unused prop
Sep 9, 2022
ff764ed
updated searchbar test
Sep 9, 2022
c2ca3e2
removed search function
Sep 12, 2022
560162b
removed unused package
Sep 12, 2022
6ff3e38
updated share grid test
Sep 12, 2022
675ae9f
removed inlknie resolver
Sep 12, 2022
3f6a586
implemented company entity
Sep 12, 2022
2390cf5
update company entity id
Sep 12, 2022
65d9f5a
useClipboard
Sep 12, 2022
b9954de
update test to failing case
Sep 12, 2022
fe72626
move mlms to db
Sep 12, 2022
bede831
fetch from db
Sep 12, 2022
82d5283
install vueuse/core
Sep 12, 2022
54273af
save suggestions to db
Sep 13, 2022
7359ee8
updated test
Sep 13, 2022
007774b
fixed lint
Sep 13, 2022
73112a2
updated test
Sep 13, 2022
db24a94
updates readme
Sep 13, 2022
c3e36f0
Update README.md
DaeunYoon Sep 13, 2022
1e15a2d
updated suggestion entity
Sep 13, 2022
1f89ff8
Merge branch 'rewrite-with-sidebase' of https://github.com/BracketJoh…
Sep 13, 2022
a78c543
changed folder name library to data
Sep 13, 2022
8d8b3fe
seachbar loading state
Sep 13, 2022
3b36ab0
addressing the change request
Sep 13, 2022
5c038a3
updated searchbar loading state
Sep 13, 2022
9a29c78
remove vue-router auto import
Sep 14, 2022
d1df978
add button hover
Sep 14, 2022
fdca077
removed auto-imports/components
Sep 14, 2022
f5319a1
adressing the changes
Sep 19, 2022
c42e2cf
updated lint
Sep 19, 2022
b1ef39d
updated load fail message
Sep 19, 2022
3959664
addressed changes
Sep 26, 2022
10ca52c
updated sanp
Sep 26, 2022
50a18ba
addressing the changes
Oct 4, 2022
6575bc8
fixed eslint
Oct 4, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
root = true

[*]
charset = utf-8
end_of_line = lf
trim_trailing_whitespace = true
insert_final_newline = true

[**.{json,js,ts,y{a,}ml}]
indent_style = space
indent_size = 2

[*.md]
indent_style = space
indent_size = 4
Binary file added .github/webpage.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 26 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Node.js CI

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Use Node.js 16.14.2
uses: actions/setup-node@v3
with:
node-version: 16.14.2
- run: npm ci
working-directory: ./app
- run: npm run build
working-directory: ./app
- run: npm run lint
working-directory: ./app
- run: npm run test
working-directory: ./app
82 changes: 65 additions & 17 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,30 +1,78 @@
# mac
# Logs and databases #
######################
*.log
*.sql
*.sqlite
/logs
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# OS generated files #
######################
.DS_Store
.vscode
.DS_Store?
._*
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db

# helmsman generated tmp folder
.helmsman-tmp

# Coverage directory used by tools like istanbul
coverage

# dependencies
node_modules
# Dependency directories
node_modules/
jspm_packages/

# eslint
# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# logs
npm-debug.log
# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# Nuxt build
# dotenv environment variables file
.env

# parcel-bundler cache (https://parceljs.org/)
.cache

# next.js build output
.next

# nuxt.js build output
.nuxt
.output

# Nuxt generate
dist

# VS Code
.editorconfig
# Histoire output
.histoire

# vuepress build output
.vuepress/dist

# Serverless directories
.serverless

# IDE / Editor
.idea

# python
__pycache__
Pipfile
.coverage
# Service worker
sw.*

# suggestions
suggestions
suggestions.log
# Vim swap files
*.swp
7 changes: 7 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"recommendations": [
"editorconfig.editorconfig",
"dbaeumer.vscode-eslint",
"vue.volar"
]
}
22 changes: 22 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
"[vue]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
},
"[js]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
},
"[ts]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
},
"[typescript]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
},
"eslint.validate": [
"javascript",
"typescript",
"vue"
]
}
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
![isthisanmlm](./.github/webpage.png)

# is-this-an-mlm
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please:

  • keep the old readme
  • in the old readme already add a line like "made with sidebase" and then link sidebase


Website to determine whether a company is an mlm. It currently runs [here](https://isthisanmlm.com) and is referenced by multiple websites, videos and people as a help to determine whether a company is a multilevel marketing (MLM) company.
This website determines whether a company is an mlm. It currently runs [here](https://isthisanmlm.com) and is referenced by multiple websites, videos and people as a help to determine whether a company is a multilevel marketing (MLM) company.

Multilevel marketing companies often prey on their members. I decided to create this site as a help for the community in order to tackle these harmful schemes. It is developed out in the open to keep it open and transparent.
`Multilevel marketing companies` often prey on their members. I decided to create this site as a help for the community in order to tackle these harmful schemes. It is developed out in the open to keep it open and transparent.

The main source of MLMs is the `antiMLM` reddit community and the visitors of the page themselves (as they can submit companies by themselves).

Expand All @@ -15,4 +17,6 @@ Install `docker` and `docker-compose`. Then run:

## Development

For development instructions, please have a look at the `README.md`s in each individual service directory.
This website is build with [SideBase](https://github.com/sidestream-tech/sidebase) and following the basic stacks of SideBase.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
This website is build with [SideBase](https://github.com/sidestream-tech/sidebase) and following the basic stacks of SideBase.
This website is build with [sidebase](https://github.com/sidestream-tech/sidebase) and following the basic stacks of sidebase.

Please user all lower case sidebase everywhere


For development instructions, please have a look at the [`README.md`](/app/README.md).
7 changes: 7 additions & 0 deletions app/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
node_modules
npm-debug*
.nuxt
dist
tests
.histoire
.output
6 changes: 6 additions & 0 deletions app/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
dist
public

# ignore generate imports
auto-imports.d.ts
components.d.ts
26 changes: 26 additions & 0 deletions app/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"extends": "@antfu/vue",
"overrides": [
{
"files": [
"./server/**/*.ts"
],
"rules": {
"no-console": "off",
"no-undef": "error"
}
}
],
"rules": {
"curly": [
"error",
"all"
],
"brace-style": "off",
"@typescript-eslint/brace-style": [
"error",
"1tbs"
],
"no-unused-vars": "error"
}
}
8 changes: 8 additions & 0 deletions app/.husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

# Check types
npm run lint:types

# Lint and fix staged files (e.g.: fix the import order of a file and still commit it afterwards)
npx lint-staged
4 changes: 4 additions & 0 deletions app/.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Required to install nuxt3 at the moment, see https://v3.nuxtjs.org/getting-started/installation#new-project (select `pnpm`)
shamefully-hoist=true
# Required to enforce the engine versions we provide in the `package.json`
engine-strict=true
1 change: 1 addition & 0 deletions app/.nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
16.14.2
37 changes: 37 additions & 0 deletions app/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# see https://docs.docker.com/engine/reference/builder/#understand-how-arg-and-from-interact
ARG NODE_VERSION=node:16.14.2

FROM $NODE_VERSION AS dependency-base

# create destination directory
RUN mkdir -p /app
WORKDIR /app

# copy the app, note .dockerignore
COPY package.json .
COPY package-lock.json .
RUN npm ci

FROM dependency-base AS production-base

# build will also take care of building
# if necessary
COPY . .
RUN npm run build

FROM $NODE_VERSION-slim AS production

COPY --from=production-base /app/.output /app/.output

# Service hostname
ENV NUXT_HOST=0.0.0.0

# Service version
ARG NUXT_APP_VERSION
ENV NUXT_APP_VERSION=${NUXT_APP_VERSION}

# Run in production mode
ENV NODE_ENV=production

# start the app
CMD [ "node", "/app/.output/server/index.mjs" ]
107 changes: 107 additions & 0 deletions app/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
# App

This is a project starter for your Nuxt 3 + Typescript application. This starter is meant to help you to start new projects, Nuxt 3 is a frontend + backend ("fullstack") framework that natively enforces typed JavaScript ("TypeScript"). Nuxt 3 is based on Vue 3.

This starter has the following features:
- slim docker ready
```sh
> docker build -t nuxt3-app .
> docker run -p 3000:3000 --init --rm nuxt3-app
```
- Note: Docker is not required for development or deployment - for development `sqlite3` is used and will launch automatically via `npm run dev` 🚀
- Component stories via `Histoire`:
```sh
> npm i
> npm run story
```
- Linting & Formatting (`npm run lint`)
- `npm run lint:style`: eslint for formatting & linting
- `npm run lint:style -- --fix`: Autofix styles and lints where possible
- `npm run lint:types`: typescript typechecking
- Testing & Code Coverage & Component Snapshots
- `npm run test`: Run tests once, report results and coverage
- `npm run test:watch`: Run tests and watch file changes, run tests for changed files
- `npm run test -- -u`: Update component snapshots after components changed
- `npm run test -- -t "some test-text"`: Run all tests with `some test-text` in their `test(...)` description
- `@testing-library/vue` for easy and best-practice component tests, [see example here](https://testing-library.com/docs/vue-testing-library/examples)
- breakpoint debugging in VS Code
- CSS usable without imports
- Utility & Styling: TailwindCSS 3
- Components: Ant Design Vue with component-auto-import
- Miscallaneous
- Pre-commit checking (husky) & fixing (lint-staged)
- github CI pipeline to linting, testing, typing checks
- nuxt-component support in tests and histoire
- debug sql database queries by setting `logging: true` in the `database/index.ts`: This will show you a live log of all ongoing database queries which is super helpful to debug database problems

## Local Setup

If this is not the first time you use `npm` / `node` v16 on your setup:
```sh
> npm i

# development mode with hot reloading
> npm run dev

# component based development via histoire
> npm run story

# testing via vitest
> npm run test
> npm run test:watch # watch tests

# run a specific test by text
> npm run test -- -t "text of test"

# update html screenshots of components
> npm run test -- -u

# linting & type checks
> npm run lint
> npm run lint -- --fix # autofix lints

# breakpoint debugging (zero-config in VS Code)
# 1. Open the command palette (CMD / CTRL + SHIFT + P)
# 2. Select "Debug: JavaScript Debug Terminal"
# 3. Run any `npm` command inside `app/`, e.g.: `npm run test`
# 4. Your code editor colors should change a bit (e.g.: to orange) while executing the command, the left side should show deep execution insights
# 5. Set breakpoints (click left of line count in editor - red dot should appear) - the debugger will automatically work and stop at them and allow you to inspect variables
> npm run test # also works for more specific tests via `-t` option (see above)
```

### First time setup

If this is the first time you run a `npm` / `node` app on your setup:

1. Install the `node` version manager `nvm` by running:
```sh
> curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
```
2. Install the required `node` and `npm` version:
```sh
# uses `.nvmrc` to install required version
> nvm install
```
3. Use the required `node` and `npm` version:
```sh
# uses `.nvmrc` to use required version
> nvm use

# ALTERNATIVE: make node 16.14.2 your default node version (version copied from `.nvmrc`, check there for most up to date node version)
> nvm alias default 16.14.2
```
4. Install a code editor (recommended: VS Code), [get it here](https://code.visualstudio.com/)
5. Uninstall or disable the old Vue VS Code extension `Vetur`, else conflicts may arise between `volar` and `Vetur`
6. Install the `volar` extension to support `vue`, `nuxt` and `typescript` development help
- for vs code: https://marketplace.visualstudio.com/items?itemName=johnsoncodehk.volar
- sublime LSP: https://github.com/sublimelsp/LSP-volar
- vim: https://github.com/yaegassy/coc-volar
7. Enable "take over mode" for volar for this project.
- documented here: https://github.com/johnsoncodehk/volar/discussions/471
- for VS Code:
1. Run (CMD/CTRL + SHIFT + P): Extensions: Show Built-in Extensions
2. Find "TypeScript and JavaScript Language Features"
3. Right click and select "disable for workspace"
4. Reload the editor
5. A message "Take over mode enabled" (or similar) should appear
8. Go to the [top of this section](#local-setup) and execute commands
Loading