Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 2 additions & 0 deletions .env.template
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
# Port of the proxy server
SERVER_PORT=8059

MONGO_URI = [URI]
64 changes: 39 additions & 25 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,12 @@ module.exports = {
es6: true,
node: true,
},
ignorePatterns: [
"*.min.*",
"build/",
],
ignorePatterns: ["*.min.*", "build/"],
extends: [
"eslint:recommended",
"plugin:react/recommended",
"plugin:@typescript-eslint/recommended",
"plugin:storybook/recommended"
"plugin:storybook/recommended",
],
globals: {
Atomics: "readonly",
Expand All @@ -28,33 +25,44 @@ module.exports = {
jsx: true,
},
},
plugins: [
"react",
"react-hooks",
"@typescript-eslint",
],
plugins: ["react", "react-hooks", "@typescript-eslint"],
rules: {
"no-unreachable": "off",
"quotes": [ "error", "double" ],
"semi": [ "error", "always" ],
"eol-last": [ "error", "always" ],
quotes: ["error", "double"],
semi: ["error", "always"],
"eol-last": ["error", "always"],
"no-async-promise-executor": "off",
"indent": ["error", 2, { "ignoredNodes": ["VariableDeclaration[declarations.length=0]"] }],
indent: [
"error",
2,
{
ignoredNodes: ["VariableDeclaration[declarations.length=0]"],
},
],
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-unused-vars": ["warn", { "ignoreRestSiblings": true, "argsIgnorePattern": "^_" }],
"@typescript-eslint/no-unused-vars": [
"warn",
{
ignoreRestSiblings: true,
argsIgnorePattern: "^_",
},
],
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/ban-types": ["error", {
types: {
"{}": false,
"@typescript-eslint/ban-types": [
"error",
{
types: {
"{}": false,
},
extendDefaults: true,
},
extendDefaults: true,
}],
],
"comma-dangle": ["error", "only-multiline"],
"no-misleading-character-class": "off",
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "error",
"react/react-in-jsx-scope": "off",
"react/prop-types": "off"
"react/prop-types": "off",
},
overrides: [
{
Expand All @@ -64,11 +72,17 @@ module.exports = {
files: ["**.js"],
rules: {
"@typescript-eslint/no-var-requires": "off",
"quotes": [ "error", "double" ],
"semi": [ "error", "always" ],
"eol-last": [ "error", "always" ],
quotes: ["error", "double"],
semi: ["error", "always"],
"eol-last": ["error", "always"],
"no-async-promise-executor": "off",
"indent": ["error", 2, { "ignoredNodes": ["VariableDeclaration[declarations.length=0]"] }],
indent: [
"error",
2,
{
ignoredNodes: ["VariableDeclaration[declarations.length=0]"],
},
],
"comma-dangle": ["error", "only-multiline"],
},
},
Expand Down
32 changes: 0 additions & 32 deletions .github/workflows/deploy-stage.yml

This file was deleted.

65 changes: 0 additions & 65 deletions .github/workflows/test-and-build.yml

This file was deleted.

68 changes: 68 additions & 0 deletions .github/workflows/test-build-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Test, build and deploy

on:
push:
branches:
- main

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}

jobs:
test:
name: Test
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [20.x]

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

- name: Install dependencies
run: npm ci

- name: Lint
run: npm run lint

# build-deploy:
# name: Build and deploy
# needs: test
# runs-on: ubuntu-latest

# steps:
# - name: Set up Docker Buildx
# uses: docker/setup-buildx-action@v3

# - name: Login to GitHub Container Registry
# uses: docker/login-action@v3
# with:
# registry: ghcr.io
# username: ${{ github.repository_owner }}
# password: ${{ secrets.GITHUB_TOKEN }}

# - name: Build and push Docker image
# uses: docker/build-push-action@v5
# with:
# push: true
# tags: |
# ghcr.io/sv443-network/japi-docs:latest
# ghcr.io/sv443-network/japi-docs:${{ github.sha }}
# cache-from: type=gha
# cache-to: type=gha,mode=max

# - name: Deploy to server
# uses: appleboy/ssh-action@master
# with:
# host: ${{ secrets.SERVER_HOST }}
# username: ${{ secrets.SERVER_USERNAME }}
# password: ${{ secrets.SERVER_PASSWORD }}
# script: |
# docker-compose -f /path/to/your/docker-compose.yml up -d
8 changes: 8 additions & 0 deletions docs/info/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"label": "Info",
"position": 1,
"link": {
"type": "generated-index",
"description": "5 minutes to learn the most important JokeAPI concepts"
}
}
23 changes: 23 additions & 0 deletions docs/info/authentication.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
sidebar_position: 5
---

# Authentication

You have just learned the **basics of Docusaurus** and made some changes to the **initial template**.

Docusaurus has **much more to offer**!

Have **5 more minutes**? Take a look at **[versioning](../tutorial-extras/manage-docs-versions.md)** and **[i18n](../tutorial-extras/translate-your-site.md)**.

Anything **unclear** or **buggy** in this tutorial? [Please report it!](https://github.com/facebook/docusaurus/discussions/4610)

## What's next?

- Read the [official documentation](https://docusaurus.io/)
- Modify your site configuration with [`docusaurus.config.js`](https://docusaurus.io/docs/api/docusaurus-config)
- Add navbar and footer items with [`themeConfig`](https://docusaurus.io/docs/api/themes/configuration)
- Add a custom [Design and Layout](https://docusaurus.io/docs/styling-layout)
- Add a [search bar](https://docusaurus.io/docs/search)
- Find inspirations in the [Docusaurus showcase](https://docusaurus.io/showcase)
- Get involved in the [Docusaurus Community](https://docusaurus.io/community/support)
23 changes: 23 additions & 0 deletions docs/info/code-examples.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
sidebar_position: 8
---

# Code Examples

You have just learned the **basics of Docusaurus** and made some changes to the **initial template**.

Docusaurus has **much more to offer**!

Have **5 more minutes**? Take a look at **[versioning](../tutorial-extras/manage-docs-versions.md)** and **[i18n](../tutorial-extras/translate-your-site.md)**.

Anything **unclear** or **buggy** in this tutorial? [Please report it!](https://github.com/facebook/docusaurus/discussions/4610)

## What's next?

- Read the [official documentation](https://docusaurus.io/)
- Modify your site configuration with [`docusaurus.config.js`](https://docusaurus.io/docs/api/docusaurus-config)
- Add navbar and footer items with [`themeConfig`](https://docusaurus.io/docs/api/themes/configuration)
- Add a custom [Design and Layout](https://docusaurus.io/docs/styling-layout)
- Add a [search bar](https://docusaurus.io/docs/search)
- Find inspirations in the [Docusaurus showcase](https://docusaurus.io/showcase)
- Get involved in the [Docusaurus Community](https://docusaurus.io/community/support)
28 changes: 28 additions & 0 deletions docs/info/introduction.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
sidebar_position: 1
---

# Introduction

JokeAPI is a REST API that serves uniformly and well formatted jokes.
It can be used without any API token, membership, registration or payment.
It supports a variety of filters that can be applied to get just the right jokes you need.
The usage is very simple and similar to other RESTful APIs and requires only basic knowledge of HTTP requests and JSON, XML, YAML or plain text.

If you come across a term you don't understand, you can try opening the menu and clicking on the section "Terminology".
JokeAPI currently serves 1368 jokes from 6 different languages. To submit a new joke, please click here.

To report a bug or a grammar mistake or to suggest a feature, please use the GitHub issue tracker.
If you want to contribute to JokeAPI, please read the Contributing Guide.

If you are new to JokeAPI, please start by reading the Getting Started Guide

## What's next?

- Read the [official documentation](https://docusaurus.io/)
- Modify your site configuration with [`docusaurus.config.js`](https://docusaurus.io/docs/api/docusaurus-config)
- Add navbar and footer items with [`themeConfig`](https://docusaurus.io/docs/api/themes/configuration)
- Add a custom [Design and Layout](https://docusaurus.io/docs/styling-layout)
- Add a [search bar](https://docusaurus.io/docs/search)
- Find inspirations in the [Docusaurus showcase](https://docusaurus.io/showcase)
- Get involved in the [Docusaurus Community](https://docusaurus.io/community/support)
Loading