{"id":18763030,"url":"https://github.com/hire-hoffee/anime-website","last_synced_at":"2025-04-13T04:32:23.083Z","repository":{"id":133800020,"uuid":"448613260","full_name":"Hire-Hoffee/Anime-WebSite","owner":"Hire-Hoffee","description":"Anime WebSite to watch anime. (My first project)","archived":false,"fork":false,"pushed_at":"2025-02-15T15:58:14.000Z","size":16065,"stargazers_count":1,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-26T21:38:25.833Z","etag":null,"topics":["anime","backend","bootstrap","express","expressjs","handlebars","javascript","mysql","node","nodejs","website"],"latest_commit_sha":null,"homepage":"http://petanimearea.ydns.eu","language":"Handlebars","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Hire-Hoffee.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-01-16T16:44:08.000Z","updated_at":"2025-02-15T15:58:18.000Z","dependencies_parsed_at":null,"dependency_job_id":"297c5cde-e618-4eb0-aa73-bb570e107395","html_url":"https://github.com/Hire-Hoffee/Anime-WebSite","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hire-Hoffee%2FAnime-WebSite","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hire-Hoffee%2FAnime-WebSite/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hire-Hoffee%2FAnime-WebSite/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hire-Hoffee%2FAnime-WebSite/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Hire-Hoffee","download_url":"https://codeload.github.com/Hire-Hoffee/Anime-WebSite/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248664010,"owners_count":21141874,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["anime","backend","bootstrap","express","expressjs","handlebars","javascript","mysql","node","nodejs","website"],"created_at":"2024-11-07T18:24:26.018Z","updated_at":"2025-04-13T04:32:22.130Z","avatar_url":"https://github.com/Hire-Hoffee.png","language":"Handlebars","readme":"# Anime Website\n\nA web application for viewing, commenting and rating anime. The application is built based on the **MVC (Model-View-Controller)** pattern using the following technologies:\n\n**Backend:**\nNode.js, Express.js, MySQL2.\n\n**Frontend:**\nHTML, CSS, JavaScript, Bootstrap, Handlebars.\n\n#### Russian-language [README](https://github.com/Hire-Hoffee/Anime-WebSite/blob/main/README_RU.md).\n\n#### Link to website [AnimeArea](http://petanimearea.freemyip.com).\n\n\u003cbr\u003e\n\u003cdiv style=\"text-align:center\"\u003e\n  \u003cimg src=\"https://i.imgur.com/zfn9rht.png\" width=\"1000\"/\u003e\n  \u003cimg src=\"https://i.imgur.com/PhsboHD.png\" width=\"1000\"/\u003e\n\u003c/div\u003e\n\u003cbr\u003e\n\n**Authentication:**\n\n- **JWT (JSON Web Token):** A standard for creating and verifying access tokens. Used for user authentication and administrator authorization.\n\n**Main parts of the application:**\n\n- **Models (`/models`):** Responsible for interacting with the database, executing SQL queries and processing the received data.\n- **Controllers (`/controllers`):** Process HTTP requests by calling the appropriate methods of models and passing data to views.\n- **Views (`/views`):** Handlebars templates that are used to display HTML pages based on data received from controllers.\n\n**Functionality:**\n\n- **Anime Browsing:** Users can browse the anime catalog, search for anime by title, filter by genre, release year, voice studio and other parameters.\n- **Anime description:** Each anime has a page with a detailed description, poster, screenshots, trailer, list of voice studios, director, genres, main characters and user comments.\n- **Comments:** Authorized users can leave comments on anime.\n- **Rating:** Authorized users can rate anime on a 10-point scale.\n- **Watched:** Authorized users can mark anime as watched.\n- **User Account:** Authorized users have access to their personal account where they can view their comments, favorite anime, change avatar and other settings.\n- **Admin Panel:** Users with the “admin” role have access to the admin panel where they can manage anime (CRUD operations) and users.\n\n\u003cdiv style=\"text-align:center\"\u003e\n  \u003cimg src=\"https://i.imgur.com/WPB5LOi.png\" width=\"550\"/\u003e\n  \u003cimg src=\"https://i.imgur.com/brafpi7.png\" width=\"550\"/\u003e\n  \u003cimg src=\"https://i.imgur.com/2EUPe8k.png\" width=\"550\"/\u003e\n  \u003cimg src=\"https://i.imgur.com/ILxRjNl.png\" width=\"550\"/\u003e\n  \u003cimg src=\"https://i.imgur.com/6ESzTo6.png\" width=\"550\"/\u003e\n  \u003cimg src=\"https://i.imgur.com/meSzSQD.png\" width=\"550\"/\u003e\n  \u003cimg src=\"https://i.imgur.com/hNfeyM5.png\" width=\"550\"/\u003e\n  \u003cimg src=\"https://i.imgur.com/K3uiGKi.png\" width=\"550\"/\u003e\n\u003c/div\u003e\n\u003cbr\u003e\n\u003cbr\u003e\n\n**Logic of operation:**\n\n1. The user sends an HTTP request (e.g., a GET request to `/main/catalog`).\n2. Express.js routes the request to the appropriate controller (e.g., `mainController.getAllAnime`).\n3. The controller calls the appropriate model method (e.g., `mainModel.getAllAnime`).\n4. The model executes a SQL query against the database and retrieves data about all anime.\n5. The model returns the data to the controller.\n6. The controller renders a view (e.g., `animeViews/allAnime.hbs`), passing the retrieved data to it.\n7. Handlebars generates an HTML page based on the template and data.\n8. Express.js sends the generated HTML page to the user.\n\n**Authentication and Authorization:**\n\n- When a user registers, their password is hashed using bcrypt before being stored in the database.\n- When a user logs in, an **accessToken** (valid for 15 minutes) and **refreshToken** (valid for 72 hours) are created. The AccessToken is stored in a cookie and the refreshToken is stored in the database.\n- When requesting protected resources, the application checks if the accessToken is present in the cookie.\n- If the accessToken is invalid or expired, the application checks the refreshToken and, if it is valid, generates a new accessToken.\n- To access the administration panel, the application additionally checks if the user has the “admin” role.\n\n**Starting the application:**\n\n1. Clone the repository.\n2. Create a database and import the schema from the `/DB_backup/Backup/AnimeSiteDB_Backup.sql` file.\n3. Set up environment variables (`.env`) to connect to the database and JWT.\n4. Run `npm install` to install the dependencies.\n5. Start the server using `npm start` or `npm devstart`.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhire-hoffee%2Fanime-website","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhire-hoffee%2Fanime-website","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhire-hoffee%2Fanime-website/lists"}