How ankit-mishra0/senpai-central works
Project type and purpose
• Senpai Central is a full-stack web application aimed at anime/manga fans.
• It provides trending anime news, top rankings, latest trailers, full articles, and a contact form.
• The frontend is a Next.js app (in app/), deployed on Vercel.
• The backend consists of Python scraper scripts and a YouTube-trailer fetcher, deployed on Render as microservices.
• PostgreSQL (Neon) serves as the central data store.
File structure
• app/ – Next.js frontend, including React components under components/, page routes under directories (news/, trailers/, contact-us/, article/, etc.), Lottie animations, CSS, global layout.
• app/api/ – Next.js API routes (all-anime-news, anime-rank, YT-Trailers, full-article, etc.). These routes fetch data from the backend services or directly from the database.
• app/scrapper/ – Python scrapers, each in its own subfolder (all_anime_news, trending_news, anime_list, full-article); each has a scraper and a DB interface module.
• app/YT_API/ – Python scripts for fetching YouTube trailers and writing to the database.
• Root scripts: run_scraper.sh, fetch_trailers.sh schedule or orchestrate scrapers and trailer fetchers.
• logs/ – Output logs from scraper runs.
• requirements.txt – Python dependencies.
• package.json + next.config.mjs – Frontend dependencies and build config.
Key README insights
• Frontend deployed to Vercel.
• Backend (scraper API) deployed to Render.com.
• Database: PostgreSQL on Neon.
• Emphasis on modern UI and integrated scraping via Python.
Main components & interactions (to represent
A. Frontend (Next.js on Vercel)
• Pages & components render UI.
• Calls internal API routes under app/api/ via HTTP.
B. Next.js API Layer
• Endpoints (e.g., /api/all-anime-news, /api/anime-rank, /api/YT-Trailers, /api/full-article)
• Either proxy requests to backend microservices or query the database directly.
C. Backend Microservices (Python on Render)
• Scraper Service: scheduled scrape jobs populate the DB.
• YouTube API Service: scheduled fetch of latest trailers into the DB.
• Full-article scraping endpoint returns article content on demand.
D. Database (Neon PostgreSQL)
• Tables for anime list, trending news, full articles, trailer metadata, rankings.
E. External Services
• YouTube Data API (for trailers).
• Vercel (hosting frontend).
• Render.com (hosting Python microservices).
Architectural patterns & design principles
• Separation of concerns: frontend/UI vs. API vs. data ingestion.
• Microservices for scrapers & API logic, scheduled independently.
• Serverless / cloud functions (Next.js API routes) as the API façade.
• Event-driven or cron-based data ingestion pipelines.
• Centralized relational store for consistency.
Final checklist
• Components: Frontend, API façade, Scraper Service, YT API Service, Database, External APIs.
• Labels: exact names (e.g., /api/anime-rank, all_anime_news_scrapper.py).
• Hosting: denote Vercel vs. Render vs. Neon.