From 33b9c31abf237915bb7dbb70dbdfb09acf3a4891 Mon Sep 17 00:00:00 2001
From: Kiera Affarantia <74483226+MinazukiAmane@users.noreply.github.com>
Date: Fri, 8 Mar 2024 15:50:08 +0700
Subject: [PATCH] add library

---
 README.md                      | 23 +++++++++++
 components/counters.module.css |  6 +++
 components/counters.tsx        | 24 ++++++++++++
 next-env.d.ts                  |  5 +++
 package-lock.json              | 34 +++++++++++++++-
 package.json                   | 11 +++++-
 pages/_meta.json               | 20 ++++++++++
 pages/faq.mdx                  | 23 +++++++++++
 pages/index.mdx                |  8 +++-
 pages/library/_meta.json       |  3 ++
 pages/library/start.mdx        |  2 +
 pages/providers.mdx            | 71 ++++++++++++++++++++++++++++++++++
 pages/rest-api/_meta.json      | 19 +++++++++
 pages/rest-api/start.mdx       |  8 ++++
 pages/start.mdx                | 10 +++++
 theme.config.tsx               |  2 +-
 tsconfig.json                  | 20 ++++++++++
 yarn.lock                      | 17 ++++++++
 18 files changed, 302 insertions(+), 4 deletions(-)
 create mode 100644 README.md
 create mode 100644 components/counters.module.css
 create mode 100644 components/counters.tsx
 create mode 100644 next-env.d.ts
 create mode 100644 pages/_meta.json
 create mode 100644 pages/faq.mdx
 create mode 100644 pages/library/_meta.json
 create mode 100644 pages/library/start.mdx
 create mode 100644 pages/providers.mdx
 create mode 100644 pages/rest-api/_meta.json
 create mode 100644 pages/rest-api/start.mdx
 create mode 100644 pages/start.mdx
 create mode 100644 tsconfig.json

diff --git a/README.md b/README.md
new file mode 100644
index 0000000..a84eb21
--- /dev/null
+++ b/README.md
@@ -0,0 +1,23 @@
+# Nextra Docs Template 
+
+This is a template for creating documentation with [Nextra](https://nextra.site).
+
+[**Live Demo →**](https://nextra-docs-template.vercel.app)
+
+[![](.github/screenshot.png)](https://nextra-docs-template.vercel.app)
+
+## Quick Start
+
+Click the button to clone this repository and deploy it on Vercel:
+
+[![](https://vercel.com/button)](https://vercel.com/new/clone?s=https%3A%2F%2Fgithub.com%2Fshuding%2Fnextra-docs-template&showOptionalTeamCreation=false)
+
+## Local Development
+
+First, run `pnpm i` to install the dependencies.
+
+Then, run `pnpm dev` to start the development server and visit localhost:3000.
+
+## License
+
+This project is licensed under the MIT License.
\ No newline at end of file
diff --git a/components/counters.module.css b/components/counters.module.css
new file mode 100644
index 0000000..7911993
--- /dev/null
+++ b/components/counters.module.css
@@ -0,0 +1,6 @@
+.counter {
+    border: 1px solid #ccc;
+    border-radius: 5px;
+    padding: 2px 6px;
+    margin: 12px 0 0;
+  }
\ No newline at end of file
diff --git a/components/counters.tsx b/components/counters.tsx
new file mode 100644
index 0000000..d7bea8b
--- /dev/null
+++ b/components/counters.tsx
@@ -0,0 +1,24 @@
+// Example from https://beta.reactjs.org/learn
+
+import { useState } from 'react'
+import styles from './counters.module.css'
+
+function MyButton() {
+  const [count, setCount] = useState(0)
+
+  function handleClick() {
+    setCount(count + 1)
+  }
+
+  return (
+    <div>
+      <button onClick={handleClick} className={styles.counter}>
+        Clicked {count} times
+      </button>
+    </div>
+  )
+}
+
+export default function MyApp() {
+  return <MyButton />
+}
\ No newline at end of file
diff --git a/next-env.d.ts b/next-env.d.ts
new file mode 100644
index 0000000..4f11a03
--- /dev/null
+++ b/next-env.d.ts
@@ -0,0 +1,5 @@
+/// <reference types="next" />
+/// <reference types="next/image-types/global" />
+
+// NOTE: This file should not be edited
+// see https://nextjs.org/docs/basic-features/typescript for more information.
diff --git a/package-lock.json b/package-lock.json
index e1eda78..450a0f2 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -7,13 +7,17 @@
     "": {
       "name": "nganime-docs",
       "version": "1.0.0",
-      "license": "ISC",
+      "license": "MIT",
       "dependencies": {
         "next": "^14.1.3",
         "nextra": "^2.13.4",
         "nextra-theme-docs": "^2.13.4",
         "react": "^18.2.0",
         "react-dom": "^18.2.0"
+      },
+      "devDependencies": {
+        "@types/node": "20.11.25",
+        "typescript": "5.4.2"
       }
     },
     "node_modules/@babel/runtime": {
@@ -493,6 +497,15 @@
       "integrity": "sha512-nG96G3Wp6acyAgJqGasjODb+acrI7KltPiRxzHPXnP3NgI28bpQDRv53olbqGXbfcgF5aiiHmO3xpwEpS5Ld9g==",
       "license": "MIT"
     },
+    "node_modules/@types/node": {
+      "version": "20.11.25",
+      "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.25.tgz",
+      "integrity": "sha512-TBHyJxk2b7HceLVGFcpAUjsa5zIdsPWlR6XHfyGzd0SFu+/NFgQgMAl96MSDZgQDvJAvV6BKsFOrt6zIL09JDw==",
+      "dev": true,
+      "dependencies": {
+        "undici-types": "~5.26.4"
+      }
+    },
     "node_modules/@types/prop-types": {
       "version": "15.7.11",
       "resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.11.tgz",
@@ -4579,6 +4592,25 @@
         "url": "https://github.com/sponsors/sindresorhus"
       }
     },
+    "node_modules/typescript": {
+      "version": "5.4.2",
+      "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.2.tgz",
+      "integrity": "sha512-+2/g0Fds1ERlP6JsakQQDXjZdZMM+rqpamFZJEKh4kwTIn3iDkgKtby0CeNd5ATNZ4Ry1ax15TMx0W2V+miizQ==",
+      "dev": true,
+      "bin": {
+        "tsc": "bin/tsc",
+        "tsserver": "bin/tsserver"
+      },
+      "engines": {
+        "node": ">=14.17"
+      }
+    },
+    "node_modules/undici-types": {
+      "version": "5.26.5",
+      "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz",
+      "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==",
+      "dev": true
+    },
     "node_modules/unified": {
       "version": "10.1.2",
       "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.2.tgz",
diff --git a/package.json b/package.json
index f6fde15..6adec12 100644
--- a/package.json
+++ b/package.json
@@ -8,13 +8,22 @@
     "build": "next build",
     "start": "next start"
   },
+  "repository": {
+    "type": "git",
+    "url": "https://git.serenetia.com/AmaneSerenetia/Nganime.git"
+  },
+  "homepage": "https://git.serenetia.com/AmaneSerenetia/Nganime-Docs/#readme",
   "author": "Nganime",
-  "license": "ISC",
+  "license": "MIT",
   "dependencies": {
     "next": "^14.1.3",
     "nextra": "^2.13.4",
     "nextra-theme-docs": "^2.13.4",
     "react": "^18.2.0",
     "react-dom": "^18.2.0"
+  },
+  "devDependencies": {
+    "@types/node": "20.11.25",
+    "typescript": "5.4.2"
   }
 }
diff --git a/pages/_meta.json b/pages/_meta.json
new file mode 100644
index 0000000..841ff74
--- /dev/null
+++ b/pages/_meta.json
@@ -0,0 +1,20 @@
+{
+    "index": "Introduction",
+    "start": "Get Started",
+    "providers": "Providers",
+    "rest-api": "API",
+    "library": "Node Library",
+    "license": {
+        "title": "License 📜",
+        "type": "page",
+        "href": "https://raw.githubusercontent.com/consumet/consumet.ts/master/LICENSE",
+        "newWindow": true
+    },
+    "contact": {
+        "title": "Contact ✉️",
+        "type": "page",
+        "href": "mailto:copyright@nganime.my.id",
+        "newWindow": true
+    },
+    "faq": "FAQ"
+}
\ No newline at end of file
diff --git a/pages/faq.mdx b/pages/faq.mdx
new file mode 100644
index 0000000..5a40f4e
--- /dev/null
+++ b/pages/faq.mdx
@@ -0,0 +1,23 @@
+## FREQUENTLY ASKED QUESTIONS
+
+<br />
+
+### How do I fix a source error (503)?
+
+<details>
+  <summary>Add the relevant ```User-Agent``` header.</summary>
+  Add the following header to your video player request:
+  ```
+  {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36'}
+  ```
+</details>
+
+### CORS causing trouble?
+
+<details>
+  <summary>Use the Nganime CORS proxy.</summary>
+  Append the source link for the media to `https://cors.nganime.my.id/`, like so:
+  ```
+  https://cors.nganime.my.id/<SOURCE_LINK>
+  ```
+</details>
\ No newline at end of file
diff --git a/pages/index.mdx b/pages/index.mdx
index ed1554a..2959711 100644
--- a/pages/index.mdx
+++ b/pages/index.mdx
@@ -1,3 +1,9 @@
 # Introduction
+Welcome to the documentation for Nganime API - a collection of high-level, search engine APIs that provide accurate information about numerous entertainment mediums (such as anime, manga, light novels, movies etc.), along with links to stream these contents from publicly-available online sources.
 
-Welcome to the documentation for Consumet - a collection of high-level, search engine APIs that provide accurate information about numerous entertainment mediums (such as anime, manga, light novels, movies etc.), along with links to stream these contents from publicly-available online sources. This website intends to inform you about how to use both the API ([https://api.consumet.org](https://api.consumet.org)) and the TypeScript library ([@consumet/extensions](https://github.com/consumet/consumet.ts)).
\ No newline at end of file
+## About
+### What is Nganime?
+Nganime is a platform where you can watch and stream anime or read manga for free, without any ads or VPNs, You will find a vast collection of anime and manga titles from different genres, including action, adventure, comedy, romance, and more.
+
+### What this documentation for?
+The purpose of this documentation is to let other know how to use the Nganime API.
\ No newline at end of file
diff --git a/pages/library/_meta.json b/pages/library/_meta.json
new file mode 100644
index 0000000..f1d0272
--- /dev/null
+++ b/pages/library/_meta.json
@@ -0,0 +1,3 @@
+{
+    "start": "Get Started"
+}
\ No newline at end of file
diff --git a/pages/library/start.mdx b/pages/library/start.mdx
new file mode 100644
index 0000000..95e4195
--- /dev/null
+++ b/pages/library/start.mdx
@@ -0,0 +1,2 @@
+# Getting Started
+Coming soon! (maybe)
\ No newline at end of file
diff --git a/pages/providers.mdx b/pages/providers.mdx
new file mode 100644
index 0000000..0c2892f
--- /dev/null
+++ b/pages/providers.mdx
@@ -0,0 +1,71 @@
+# Providers
+
+Nganime supports a lot of API providers, which can be categorized into the following groups:
+
+## Anime
+
+[9Anime:](https://aniwave.to) This provider tends to be more unreliable than most, so please use with care.
+
+[AnimeFox:](https://animefox.tv) Looks & functions similarly to Zoro.
+
+[Animepahe:](https://animepahe.ru) Often provides high quality anime streaming links.
+
+[BiliBili:](https://www.bilibili.tv) 🇨🇳 Chinese video streaming platform that provides anime for free.
+
+[Crunchyroll:](https://www.crunchyroll.com) Where anime meets the west.
+
+[Enime:](https://api.enime.moe) An API that caches anime episodes & their publicly-available, third-party sources.
+
+[GogoAnime:](https://gogoanime3.co) The default provider for anime - one of the more well-known/established providers.
+
+[Zoro:](https://hianime.to) A well-known site named after Roronoa Zoro from ONE PIECE.
+
+## Books
+
+[Libgen:](https://libgen.is) Currently the only provider for books - a vast library of e-books available for download.
+
+## Comics
+
+[GetComics:](https://getcomics.info) Currently the only provider for comics - read & download comics for free online!
+
+## Light Novels
+
+[Read Light Novels:](https://animedaily.net) Currently the only provider for light novels - read your favourite light novel series online here.
+
+## Manga
+
+[Mangadex:](https://mangadex.org) Hosts 10,000s of chapters of scanlated manga.
+
+[Mangahere:](https://mangahere.cc) English-translated manga for free online.
+
+[Mangakakalot:](https://mangakakalot.com) Read manga online in English.
+
+[Mangapark (v2):](https://v2.mangapark.net) The second version of Mangapark - a large collation of manga available for free, in English.
+
+[Mangapill:](https://mangapill.com) Your daily dose of manga!
+
+[Mangareader:](https://mangareader.to) Zoro refers to this site on its information pages. A great provider for manga images.
+
+[Mangasee123:](https://mangasee123.com) The default provider for manga - a large library of over 6,000 manga available in English.
+
+## Meta
+
+[Anilist for Anime:](https://anilist.co) A metadata provider used to aggregate anime data from Anilist, and to accurately map these anime to publicly-available streaming links.
+
+[Anilist for Manga:](https://anilist.co) A metadata provider used to aggregate manga data from Anilist, and to accurately map these manga to publicly-available streaming links.
+
+[MyAnimeList:](https://myanimelist.net) A metadata provider used to aggregate media (primarily anime & manga) data from MyAnimeList, and to accurately map these mediae to publicly-available streaming links.
+
+[The Movie Database (TMDB):](https://www.themoviedb.org) A metadata provider that returns data about current, past & upcoming TV shows/movies, and accurately map these media to publicly-available streaming links.
+
+## Movies
+
+[Dramacool:](https://dramacool.com.pa) Provides mainly K-Dramas & other similar content.
+
+[FlixHQ:](https://flixhq.to) Provides 1,000s of high-quality movies & series in high-definition online for free.
+
+[ViewAsian:](https://viewasian.co) Provides mainly K-Dramas & other media intended primarily for the Asian market.
+
+## News
+
+[AnimeNewsNetwork:](https://animenewsnetwork.com) Serves 10s of stories regarding the latest Japanese media news per day: "The internet's most trusted anime news source."
\ No newline at end of file
diff --git a/pages/rest-api/_meta.json b/pages/rest-api/_meta.json
new file mode 100644
index 0000000..2b91570
--- /dev/null
+++ b/pages/rest-api/_meta.json
@@ -0,0 +1,19 @@
+{
+    "start": "Get Started",
+  
+    "Anime": { "title": "Anime", "theme": { "collapsed": true } },
+  
+    "Books": { "title": "Books", "theme": { "collapsed": true } },
+  
+    "Comics": { "title": "Comics", "theme": { "collapsed": true } },
+  
+    "Meta": { "title": "Meta", "theme": { "collapsed": true } },
+  
+    "Light-Novels": { "title": "Light Novels", "theme": { "collapsed": true } },
+  
+    "Manga": { "title": "Manga", "theme": { "collapsed": true } },
+  
+    "Movies": { "title": "Movies", "theme": { "collapsed": true } },
+  
+    "News": { "title": "News", "theme": { "collapsed": true } }
+  }
\ No newline at end of file
diff --git a/pages/rest-api/start.mdx b/pages/rest-api/start.mdx
new file mode 100644
index 0000000..eb4c328
--- /dev/null
+++ b/pages/rest-api/start.mdx
@@ -0,0 +1,8 @@
+# Get Started
+
+The base URL for the Consumet REST API is: [`https://api.nganime.my.id`](https://api.nganime.my.id)
+
+## Notes
+
+- Some `GET` request examples displayed throughout these docs are written for use with Node.js - the [`axios`](https://axios-http.com) library may be required.
+- Some `GET` request examples displayed throughout these docs are written for use with Python - the [`requests`](https://requests.readthedocs.io) library may be required.
\ No newline at end of file
diff --git a/pages/start.mdx b/pages/start.mdx
new file mode 100644
index 0000000..265977a
--- /dev/null
+++ b/pages/start.mdx
@@ -0,0 +1,10 @@
+import { Tab, Tabs } from "nextra-theme-docs";
+
+# Getting Started
+Nganime API utilizes a REST API which is wildly supported across multiple platforms. Use your code base of choice and send requests to the public API [https://api.nganime.my.id](https://api.nganime.my.id).
+Exampe with NodeJS:
+```js
+const axios = require("axios");
+await axios.get("https://api.anify.tv", { headers: {"Content-Type": "application/json" }});
+```
+Most of this documentation will feature examples in NodeJS and Python, but a lot of them can be easily replicated in other languages.
\ No newline at end of file
diff --git a/theme.config.tsx b/theme.config.tsx
index 37ca976..b7b33f5 100644
--- a/theme.config.tsx
+++ b/theme.config.tsx
@@ -14,7 +14,7 @@ const config: DocsThemeConfig = {
     project: {
         link: "https://nganime.my.id",
     },
-    docsRepositoryBase: "https://github.com/Eltik/Anify-Docs",
+    docsRepositoryBase: "https://git.serenetia.com/AmaneSerenetia/Nganime-Docs",
     navbar: {
         extraContent: () => {
             const theme = useTheme();
diff --git a/tsconfig.json b/tsconfig.json
new file mode 100644
index 0000000..2b8a948
--- /dev/null
+++ b/tsconfig.json
@@ -0,0 +1,20 @@
+{
+    "compilerOptions": {
+      "target": "es5",
+      "lib": ["dom", "dom.iterable", "esnext"],
+      "allowJs": true,
+      "skipLibCheck": true,
+      "strict": false,
+      "forceConsistentCasingInFileNames": true,
+      "noEmit": true,
+      "incremental": true,
+      "esModuleInterop": true,
+      "module": "esnext",
+      "moduleResolution": "node",
+      "resolveJsonModule": true,
+      "isolatedModules": true,
+      "jsx": "preserve"
+    },
+    "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
+    "exclude": ["node_modules"]
+  }
\ No newline at end of file
diff --git a/yarn.lock b/yarn.lock
index b7a59c5..6061c4e 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -216,6 +216,13 @@
   resolved "https://registry.npmjs.org/@types/ms/-/ms-0.7.34.tgz"
   integrity sha512-nG96G3Wp6acyAgJqGasjODb+acrI7KltPiRxzHPXnP3NgI28bpQDRv53olbqGXbfcgF5aiiHmO3xpwEpS5Ld9g==
 
+"@types/node@20.11.25":
+  version "20.11.25"
+  resolved "https://registry.npmjs.org/@types/node/-/node-20.11.25.tgz"
+  integrity sha512-TBHyJxk2b7HceLVGFcpAUjsa5zIdsPWlR6XHfyGzd0SFu+/NFgQgMAl96MSDZgQDvJAvV6BKsFOrt6zIL09JDw==
+  dependencies:
+    undici-types "~5.26.4"
+
 "@types/prop-types@*":
   version "15.7.11"
   resolved "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.11.tgz"
@@ -2463,6 +2470,16 @@ type-fest@^1.0.2:
   resolved "https://registry.npmjs.org/type-fest/-/type-fest-1.4.0.tgz"
   integrity sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA==
 
+typescript@5.4.2:
+  version "5.4.2"
+  resolved "https://registry.npmjs.org/typescript/-/typescript-5.4.2.tgz"
+  integrity sha512-+2/g0Fds1ERlP6JsakQQDXjZdZMM+rqpamFZJEKh4kwTIn3iDkgKtby0CeNd5ATNZ4Ry1ax15TMx0W2V+miizQ==
+
+undici-types@~5.26.4:
+  version "5.26.5"
+  resolved "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz"
+  integrity sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==
+
 unified@^10.0.0:
   version "10.1.2"
   resolved "https://registry.npmjs.org/unified/-/unified-10.1.2.tgz"