https://github.com/notwindstone/anisun
My first project on Next.js 14: an anime streaming website/PWA based on Shikimori, AniLibria, Kodik, SovetRomantica and Animetize APIs with the Mantine UI kit.
https://github.com/notwindstone/anisun
anilibria anime anime-website animetize-api clerk drizzle-orm kodik mantine next-intl nextjs pwa react shikimori sovetromantica streaming tanstack-react-query typescript vidstack
Last synced: about 2 hours ago
JSON representation
My first project on Next.js 14: an anime streaming website/PWA based on Shikimori, AniLibria, Kodik, SovetRomantica and Animetize APIs with the Mantine UI kit.
- Host: GitHub
- URL: https://github.com/notwindstone/anisun
- Owner: notwindstone
- License: gpl-3.0
- Created: 2024-03-17T17:29:52.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-07-06T12:03:44.000Z (11 months ago)
- Last Synced: 2024-07-06T13:25:29.822Z (11 months ago)
- Topics: anilibria, anime, anime-website, animetize-api, clerk, drizzle-orm, kodik, mantine, next-intl, nextjs, pwa, react, shikimori, sovetromantica, streaming, tanstack-react-query, typescript, vidstack
- Language: TypeScript
- Homepage: https://anisun.vercel.app
- Size: 26.7 MB
- Stars: 25
- Watchers: 1
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# [Anisun](https://anisun.vercel.app)
### A web app for watching anime built with Next.js and Mantine UI
I'm currently refactoring this app. You can check the progress here: [v5 branch](https://github.com/notwindstone/anisun/tree/v5)
English | Русский[](https://github.com/notwindstone/Anisun/stargazers)
[](https://discord.gg/JhmkZDScfg)## 📱 Screenshots
![]()
![]()
![]()
![]()
### More screenshots
Expand
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
## ⚙️ Tech Stack
* [Next.js](https://nextjs.org/) with [TypeScript](https://www.typescriptlang.org/)
* [Mantine UI](https://mantine.dev/) and [PostCSS](https://postcss.org/) for UI
* [Drizzle ORM](https://orm.drizzle.team/) and [Neon Serverless DB](https://neon.tech/) for database
* [Tanstack Query](https://tanstack.com/query/latest) and [axios](https://axios-http.com/docs/intro) for fetching data from APIs
* Slider for anime cards based on [Embla Carousel](https://www.embla-carousel.com) and [Mantine UI Carousel](https://mantine.dev/x/carousel/)
* [Clerk Auth](https://clerk.com/) for auth
* Video player for [Anilibria API](https://github.com/anilibria/docs) based on [Vidstack.js](https://www.vidstack.io/) and [HLS.js](https://github.com/video-dev/hls.js)
* [KodikWrapper](https://github.com/thedvxchsquad/kodikwrapper) for fetching data from Kodik using Shikimori ID
* Notifications system based on [Mantine UI Notifications](https://mantine.dev/x/notifications/)
* Date formatting with [Day.js](https://day.js.org/)
* [CSS-modules](https://nextjs.org/docs/app/building-your-application/styling/css-modules)
## ⭐ Features
* Watch anime with subs or dubs (in English or Russian)
* Download anime using a torrent or directly from the website (.m3u8)
* Account authentication
* Heavily nested comment system like on reddit
* Dark and light themes
* Anime search with filters
* Custom navigation bar using a Next.js router for faster navigation between routes
...and a lot more!
## ✅ To-Do List
- [x] Website internationalization with [next-intl](https://next-intl-docs.vercel.app/)
- [x] Add the option to the `.env` file to use a database based on value
- [x] Add the option to download anime using a torrent or directly from the website
- [x] Add subtitles from the [SovetRomanticaVideo API](https://github.com/sovetromantica/sr-api)
- [x] Complete the page with an anime search and filters
- [x] Finish comments
- [x] Complete the page with popular anime
## ⬇️ Self-Hosting
### Local
#### Preparations
Expand steps
> Cloning the repository
1. Clone this repository by running `git clone https://github.com/notwindstone/anisun`
2. Rename the `.env.example` file in the root directory to `.env.local`
> Configuring Clerk auth
1. Sign up for a Clerk account at https://clerk.com
2. Go to the Clerk dashboard and create an application
3. Go to **API Keys** in your sidebar and copy **Publishable key** (Example: `pk_test_qwertyuiop1234567890`)
4. Paste your **Publishable key** to `NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY` in the `.env.local` file
5. Go to **API Keys** in your sidebar and copy **Secret keys** (Example: `sk_test_qwertyuiop1234567890`)
6. Paste your **Publishable key** to `CLERK_SECRET_KEY` in the `.env.local` file
> Database configuration with: 1. Neon Serverless DB
You can use Neon Serverless DB as a database. If you are going to use local PostgreSQL database, then skip this configuration
1. Sign up to Neon DB at https://neon.tech/ to access serverless Postgres by creating a project
2. Go to the Neon dashboard and copy **Connection string** (Example: `postgres://postgres:[email protected]:5432/db?sslmode=require`)
3. Paste your **Connection string** to `NEON_DATABASE_URL` in the `.env.local` file
4. Make sure the `DATABASE_TYPE` line in the `.env.local` file is set to `NEON`
> Database configuration with: 2. Local PostgreSQL
You can use local PostgreSQL as a database. If you are going to use Neon Serverless database, then skip this configuration
1. Go to the `.env.local` file and paste your connection string to `POSTGRESQL_DATABASE_URL`
2. Change `DATABASE_TYPE` to `POSTGRESQL` in the `.env.local` file
> Final steps
1. (Optional) If you want to watch anime in Kodik Player too, then obtain a token from http://kodik.cc/ (you need to contact them via email) Otherwise, only players based on the Anilibria API will work
2. Run `npm install` to install the required dependencies
3. Create a comments table in the database using the command `npx drizzle-kit push:pg`
4. Done! Your web app is ready to start
> [!IMPORTANT]
> This is what the `.env.local` file should look like with Neon Serverless DB configuration```text
DATABASE_TYPE='NEON'
NEON_DATABASE_URL='postgres://postgres:[email protected]:5432/db'
POSTGRESQL_DATABASE_URL='CHANGE_IT_postgres://postgres:[email protected]:5432/db'
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_test_qwertyuiop1234567890
CLERK_SECRET_KEY=sk_test_qwertyuiop1234567890
NEXT_PUBLIC_CLERK_SIGN_IN_URL=/
NEXT_PUBLIC_CLERK_SIGN_UP_URL=/
NEXT_PUBLIC_CLERK_AFTER_SIGN_IN_URL=/
NEXT_PUBLIC_CLERK_AFTER_SIGN_UP_URL=/
KODIK_TOKEN='qwertyuiop1234567890'
```> [!IMPORTANT]
> This is what the `.env.local` file should look like with PostgreSQL DB configuration```text
DATABASE_TYPE='POSTGRESQL'
NEON_DATABASE_URL='CHANGE_IT_postgres://postgres:[email protected]:5432/db'
POSTGRESQL_DATABASE_URL='postgres://postgres:[email protected]:5432/db'
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_test_qwertyuiop1234567890
CLERK_SECRET_KEY=sk_test_qwertyuiop1234567890
NEXT_PUBLIC_CLERK_SIGN_IN_URL=/
NEXT_PUBLIC_CLERK_SIGN_UP_URL=/
NEXT_PUBLIC_CLERK_AFTER_SIGN_IN_URL=/
NEXT_PUBLIC_CLERK_AFTER_SIGN_UP_URL=/
KODIK_TOKEN='qwertyuiop1234567890'
```#### Development
If you want to run the application in development mode
```bash
npm run dev
```#### Production
> [!TIP]
> Run the application in production mode if you don't know which to chooseIf you want to run the application in production mode
```bash
npm run build
```
```bash
npm run start
```#### Website URL
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
### Vercel
Expand steps
Click the button
[](https://vercel.com/new/clone?s=https%3A%2F%2Fgithub.com%2Fnotwindstone%2Fanisun)
Navigate to **Project** -> **Settings** -> **Environment Variables** and then add values to the following keys:
1. `DATABASE_TYPE` - `NEON`
2. `NEXT_PUBLIC_CLERK_AFTER_SIGN_UP_URL` - `/`
3. `NEXT_PUBLIC_CLERK_AFTER_SIGN_IN_URL` - `/`
4. `NEXT_PUBLIC_CLERK_SIGN_UP_URL` - `/`
5. `NEXT_PUBLIC_CLERK_SIGN_IN_URL` - `/`
6. `CLERK_SECRET_KEY` - your own **Secret key** from https://clerk.com
7. `NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY` - your own **Publishable key** from https://clerk.com
8. `NEON_DATABASE_URL` - your own **Connection string** from https://neon.tech/
9. (Optional) `KODIK_TOKEN` - your own from http://kodik.cc/ (you need to contact them via email). This is needed only if you want to watch anime in Kodik Player too. Otherwise, only players based on the Anilibria API will work
### Termux
Expand steps
1. Install any PRoot Linux distro using an Andronix, for example
2. Install Node.js, NPM, and Git
3. Follow the next steps from the [local installation](#local) paragraph
## 💬 Contact
### Directly
* [Telegram - @windst1](https://t.me/windst1)
* [Discord - @notwindstone](https://discord.com/users/510709295814279168)
### Through our Discord server
* [Discord - Сага о сервере](https://discord.gg/JhmkZDScfg)
## 🤝 Contributing
Contributions are welcome!
> [!NOTE]
> To-Do: Hosted Weblate## ⭐️ Star History
[](https://star-history.com/#notwindstone/anisun&Date)
## ❤️ Credits
* [zvshka](https://github.com/zvshka) for his help with the project
* cos (discord account) for his help with the UI
* [Shikimori](https://shikimori.one/api/doc/graphql), [Anilibria](https://github.com/anilibria/docs), [Kodik](http://kodik.cc/) and [SovetRomantica](https://sovetromantica.com/) for their wonderful APIs, without which Anisun could not work
* [Sora](https://github.com/Khanhtran47/Sora) and [Sync for Reddit](https://github.com/laurencedawson/sync-for-reddit). Some of the UI designs are borrowed from them
* [Node-shikimori wrapper](https://github.com/Capster/node-shikimori). Some of the codes are borrowed from them
## 📜 License
[](https://github.com/notwindstone/Anisun/blob/main/LICENSE)
## 🌐 Cool resources
* [Refactoring Hell](https://wiki.c2.com/?RefactoringHell)
* [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/)
* [Realtime Colors](https://www.realtimecolors.com)
## ❗ Disclaimer
> [!IMPORTANT]
> Anisun does not host any files, it merely links to 3rd party services.
> Legal issues should be taken up with the file hosts and providers.
> Anisun is not responsible for any media files shown by the video providers.