Skip to content

Commit

Permalink
Merge pull request #119 from ErickLimaS/change-comments-for-reviews
Browse files Browse the repository at this point in the history
Change Comments Section for Reviews From Anilist
  • Loading branch information
ErickLimaS authored Nov 17, 2024
2 parents 9eec09a + ea45363 commit 0368325
Show file tree
Hide file tree
Showing 19 changed files with 406 additions and 53 deletions.
66 changes: 42 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,17 @@

Project of animes and mangas website, utilizing the AniList, Consumet and Aniwatch API, which has info of animes and mangas released, data of the cast of that media, and many other things.

<p align="center">You can access this website on <a href='https://aniproject-dev.vercel.app/'>Vercel</a> or <a href='https://aniproject-website.onrender.com'>Render (really slow)</a>.</p>
<p align="center">You can access this website on:

<a href='https://aniproject-dev.vercel.app/'>AniProject on Vercel</a> </br>
or </br>
<a href='https://aniproject-website.onrender.com'>AniProject on Render</a></br>
If the Vercel one is blocked by payment, try this one (it takes up to 2 minutes to deploy and load due to cold boot).

</p>

> [!CAUTION]
> Please note that this project is strictly non-commercial. It is not permitted to generate revenue or include advertisements using this project. Violating this policy may result in legal actions by the respective owners of these intellectual properties.
> Please note that this project is strictly non-commercial. It is not permitted to generate revenue or include advertisements using this project. Violating this policy may result in legal actions by the respective owners of these intellectual properties.
## Navigation

Expand All @@ -20,7 +27,7 @@ Project of animes and mangas website, utilizing the AniList, Consumet and Aniwat
- [Authentication](#authentication)
- [Collections and Documents](#collections-and-documents)
- [Users](#users)
- [Comments](#comments)
- [Comments](#[DEPRECATED]comments)
- [Notifications](#notifications)
- [Previews/Screenshots](#camera-previewscreenshots)

Expand All @@ -29,27 +36,26 @@ Project of animes and mangas website, utilizing the AniList, Consumet and Aniwat
- [x] `Search`: Get a list of all animes and mangas you want using filters.
- [x] `Watch`: Watch any available episode Dubbed or Subbed.
- [x] `Read`: Read any manga chapter available.
- [x] `Comment`: Write what you thougth of that episode or just tell something that every should know about.
- [x] `Log In`: You can log in with Google, Anilist or Anonymously (with some restrictions).
- [x] `Anilist Integration`: Use your Anilist account, carry over your settings, animes and mangas.
- [x] `Keep Watching`: Continue the episode from where you stop last time.
- [x] `Be Notified`: When a New Episode is Released, you get a notification on the website.
- [x] `Mark your favourite animes e mangas`: Save them as Completed, Dropped, Planning, and more.
- [x] `Mark the episodes you watched`: And keep watching from there later
- [x] `News Feed`: Keep up with the latest news of animes, mangas and the industry.
- <s> [DEPRECATED] `Comment`: Write what you thought of that episode or just tell something that every should know about.</s>

## :rocket: Quick Deploy

> [!IMPORTANT]
> You NEED to make some configurations to use the project properly. Give a look on the [How Can i Run It Section](#computer-how-can-i-run-it) then use the info you got there on Vercel or any other platform `Enviroment Variables Section`.
> You NEED to make some configurations to use the project properly. Give a look on the [How Can i Run It Section](#computer-how-can-i-run-it) then use the info you got there on Vercel or any other platform `Enviroment Variables Section`.
On Vercel: [![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2FErickLimaS%2Fanime-website&env=NEXT_PUBLIC_ANIWATCH_API_URL,NEXT_PUBLIC_CONSUMET_API_URL&envDescription=First%2C%20click%20on%20%22Learn%20More%22%20to%20ensure%20all%20variables%20is%20correct%20and%20setted.%20To%20watch%2C%20you'll%20need%20to%20deploy%20the%20Consumet%20and%20Aniwatch%20API.%20To%20the%20login%20system%2C%20you'll%20need%20to%20setup%20a%20Firebase%20Project%2C%20and%20or%20set%20the%20Dev%20Mode%20on%20Anilist%20to%20use%20their%20login.%20&envLink=https%3A%2F%2Fgithub.com%2FErickLimaS%2Fanime-website%3Ftab%3Dreadme-ov-file%23computer-how-can-i-run-it)

## :pushpin: Under Development (unordered)

- [ ] `Bug Fixes`
- [ ] `Hide Next Episode Images Until You Watch It (avoid spoilers)`
- [ ] `AniList Reviews/Comments`
- [ ] `AniList Threads`
- [ ] `New Media Sources`
- [ ] `New Video Player Features`
Expand Down Expand Up @@ -95,64 +101,68 @@ npm install

3. Now you will need to create a `.env.local` file or fill the `.env.example` on the `project root folder`, and follow the instructions bellow.

- **External APIs** (go to these repos, host your own instance and save the URL to use on ``.env.local``):
- **External APIs** (go to these repos, host your own instance and save the URL to use on `.env.local`):
- <a href='https://github.com/consumet/api.consumet.org' target="_blank" rel="noreferrer">Consumet API</a>
- <a href='https://github.com/ghoshRitesh12/aniwatch-api' target="_blank" rel="noreferrer">Aniwatch API</a>

- **Anilist Login** (OAuth):
- You need to first login on your account on Anilist.
- Then go to <a href='https://anilist.co/settings/developer'>Developer Page</a> on the Settings and click "Create New Client".
- Now you need to add the name of your forked project/website and the URL to redirect when user accept the login, then hit "Save".
- Store the Client ID and Secret on your ".env.local".
- TIP: Create 2 of these, one for the dev env and other to production.

- **Firebase** (to use Google, Email and Anonymous Login and the Firestore Database):

- Create a project for this fork/clone you did on <a href='https://console.firebase.google.com/' target="_blank" rel="noreferrer">Firebase</a>.
- All the Firebase info needed on `.env.local` **can be found when you create a new project**.
- **IMPORTANT**: Make Sure to ALLOW your Hosted Website Domain on Firebase Authentication!
- **IMPORTANT**: You'll need to **change the Rules** on **Firestore Database**. There is 2 options depending of what login methods you will use:

- With **ALL** Login Methods available:

```javascript
rules_version = '2';

service cloud.firestore {
match /databases/{database}/documents {

match /{document=**} {
// will allow any write and read operation. No conditions due to Anilist OAuth Login.
allow read, write: if true;
}

}
}
```

- With **ONLY** Firebase Login Methods (no Anilist Login):

```javascript
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
match /users/{document=**} {
// allows only requests if a userUID is available.
allow read, write: request.auth.uid != null;
}
match /comments/{document=**} {
// allows only write request if a userUID is available.
// allows only write request if a userUID is available.
allow read: if true;
allow write: request.auth.uid != null;
}
match /notifications/{document=**} {
// allows only write request if a userUID is available.
// allows only write request if a userUID is available.
allow read: if true;
allow write: request.auth.uid != null;
}
}
}
```

- OPTIONAL: This project uses a JSON file (47 mb) filled with Animes and Mangas data as a offline Database. This repository already has this file, but it might be outdated, so you decide if you want to ignore this step.
- Go to <a href='https://github.com/manami-project/anime-offline-database' target="_blank" rel="noreferrer">anime-offline-database</a> and download the JSON file that will be used on only `Search Page` (or you can make some changes and use some API to fetch the data).
- With the file downloaded, put it in the `/app/api/animes-database` directory, replacing the previous one.
Expand All @@ -162,15 +172,20 @@ With all that done, you can follow the pre-made `.env.example` on the root folde
```javascript
// Consumet API
NEXT_PUBLIC_CONSUMET_API_URL=https://your-hosted-consumet-api-url.com
// Aniwatch API
NEXT_PUBLIC_ANIWATCH_API_URL=https://your-hosted-aniwatch-api-url.com
// Anilist OAuth Settings
NEXT_PUBLIC_ANILIST_CLIENT_ID=your-anilist-client-id
ANILIST_CLIENT_SECRET=your-anilist-secret
// Next.js Route Handler - Make sure to add the pathname "/api/animes-database" bellow
NEXT_PUBLIC_NEXT_ROUTE_HANDLER_API=https://url-to-where-your-website-is-hosted.com/api/animes-database
// Bellow is the url to use ONLY on Dev Enviroment. You WILL NEED TO CHANGE IT when on hosted mode to the respective url. Look for something like Enviroment Variables to do it.
NEXT_PUBLIC_WEBSITE_ORIGIN_URL=http://localhost:3000
// Firebase Settings
NEXT_PUBLIC_FIREBASE_API_KEY=firebase-setting-related-to-this-field
NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN=firebase-setting-related-to-this-field
Expand All @@ -180,6 +195,9 @@ NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER=firebase-setting-related-to-this-field
NEXT_PUBLIC_FIREBASE_APP_ID=firebase-setting-related-to-this-field
NEXT_PUBLIC_FIREBASE_MEASUREMENT_ID=firebase-setting-related-to-this-field
NEXT_PUBLIC_FIREBASE_DATABASE_URL=firebase-setting-related-to-this-field
// GOOGLE ANALYTICS: optional
NEXT_PUBLIC_MEASUREMENT_ID=your-measurement-id
```

4. Now run `npm run dev` to initialize the website
Expand Down Expand Up @@ -207,7 +225,7 @@ It is used to store on User Document things like:
- User Profile Photo
- Username
- Preferences (media source, adult content, subtitles and more)
- Comments
- [DEPRECATED]Comments
- Notifications
- Bookmarked Medias
- Currently Watching Medias
Expand All @@ -222,7 +240,7 @@ With Firebase Database, we have 3 Collections:
Stores only Users Documents after a successfull signup.
#### Comments
#### [DEPRECATED]Comments
Stores comments made on episodes or on its main page.
Expand Down Expand Up @@ -287,7 +305,7 @@ In this document, has info of all episodes already notified to any user and the
![News Article Page 1](https://github.com/ErickLimaS/anime-website/assets/69987890/de58a15a-eed4-4cdc-9249-900a90c21c50)
## Inspiration
## Inspiration
- <a href='https://preview.themeforest.net/item/vodi-video-wordpress-theme-for-movies-tv-shows/full_screen_preview/23738703' target="_blank" rel="noreferrer">Template</a>
- <a href='https://dribbble.com/shots/20333170-The-Trailers-Concept-Site-Part-2' target="_blank" rel="noreferrer">Media Page</a>
- <a href='https://preview.themeforest.net/item/vodi-video-wordpress-theme-for-movies-tv-shows/full_screen_preview/23738703' target="_blank" rel="noreferrer">Template</a>
- <a href='https://dribbble.com/shots/20333170-The-Trailers-Concept-Site-Part-2' target="_blank" rel="noreferrer">Media Page</a>
5 changes: 5 additions & 0 deletions app/api/anilist/anilistQueryConstants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import {
queryCharacters,
queryCoverImage,
queryMediaListEntry,
queryMediaReviews,
queryMediaTags,
queryNextAiringEpisode,
queryRecommendationsByCurrMedia,
Expand Down Expand Up @@ -43,6 +44,7 @@ export function requestMedias(
isFavourite
${queryMediaListEntry}
status
${queryMediaReviews}
${queryRelatedMediasBasicInfo}
episodes
chapters
Expand Down Expand Up @@ -105,6 +107,7 @@ export function requestMediaById(isUserAuthenticated: boolean) {
isAdult
status
isFavourite
${queryMediaReviews}
${queryMediaListEntry}
${queryRelatedMediasBasicInfo}
episodes
Expand Down Expand Up @@ -183,6 +186,7 @@ export function requestMediasByDateAndTimeRelease() {
idMal
isAdult
description
${queryMediaReviews}
${queryTitles}
id
${queryCoverImage}
Expand Down Expand Up @@ -254,6 +258,7 @@ export function mediaTrendingApiQueryRequest() {
isAdult
${queryTitles}
id
${queryMediaReviews}
${queryCoverImage}
trailer{
id
Expand Down
23 changes: 23 additions & 0 deletions app/api/anilist/queryModulesByCategory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -314,3 +314,26 @@ export const queryRecommendationsByCurrMediaUserAuthenticated = `recommendations
}
}
}`;

export const queryMediaReviews = `reviews {
nodes {
id
summary
body(asHtml: true)
rating
userRating
ratingAmount
score
user {
id
name
about
avatar {
large
medium
}
bannerImage
}
}
}
`;
File renamed without changes.
Loading

0 comments on commit 0368325

Please sign in to comment.