A full-stack application for exploring Anime & Manga, including features for user authentication, profiles, ratings, and reviews. This repository consists of two components: the backend (Node.js/Express + PostgreSQL) and the frontend (React + Vite).
backend/— Express server for APIs with PostgreSQL, JWT, and authentication middleware.frontend/— React application (Vite) for the user interface.
- Backend:
- Node.js (>= 18), Express 5
- PostgreSQL (
pg) - JSON Web Token (
jsonwebtoken) - Password hashing (
bcrypt) - CORS,
dotenv,nodemon - Package manager:
pnpm(pnpm@10.24.0)
- Frontend:
- React 19 + Vite 7
- React Router 7
- React Toastify, React Easy Crop, React Loading Skeleton
- Supabase JS (used on the frontend)
- ESLint (flat configuration)
.
├── backend
│ ├── package.json
│ └── src
│ ├── app.js
│ ├── server.js
│ ├── config/
│ ├── controllers/
│ ├── errors/
│ ├── middleware/
│ ├── models/
│ └── routes/
└── frontend
├── package.json
├── index.html
└── src
├── App.jsx
├── api/
├── assets/
├── components/
├── context/
├── hooks/
├── lib/
├── pages/
├── services/
├── index.css
└── main.jsx
- Node.js >= 18
pnpminstalled- A running PostgreSQL instance (local or remote)
-
Navigate to the backend folder and install dependencies:
cd backend pnpm install -
Set up environment variables. Create a
.envfile in thebackend/folder (example variables):PORT=3000 DATABASE_URL=postgres://user:password@host:port/dbname JWT_SECRET=your_jwt_secretNotes:
- The server reads the
PORTfrom the environment (default 3000). - Adjust the database configuration and JWT secret as per your environment.
- The server reads the
-
Run in development mode:
pnpm dev
or for production:
pnpm start
The server will run at http://localhost:3000. The default CORS origin in the backend is set to http://localhost:5173 (see backend/src/app.js).
-
Navigate to the frontend folder and install dependencies:
cd frontend pnpm install -
If the frontend application requires environment configuration (e.g., API base URL), add it in
.env(example):VITE_API_BASE_URL=http://localhost:3000Adjust according to your backend address.
-
Run in development mode:
pnpm dev
- Vite will run at
http://localhost:5173.
- Vite will run at
-
Build and preview (optional):
pnpm build pnpm preview
The core endpoints are organized in the backend/src/routes/ folder. Here is a summary:
-
Health:
GET /api/health— Check server status (returns{ status: "ok" })
-
Authentication:
POST /api/auth/login— LoginPOST /api/auth/register— Register
-
Profile (authentication required):
GET /api/profile— Retrieve profile dataPUT /api/profile— Update profile data
-
Anime:
GET /api/anime— List of animesPOST /api/anime— Add animeGET /api/anime/carousel— List of anime carouselPOST /api/anime/carousel— Add anime carouselGET /api/anime/search— Anime search queueGET /api/anime/detail/:id— Anime card detailGET /api/anime/carousel/:id— Anime carousel by IDGET /api/anime/:id— Anime by ID- Rating (authentication required):
GET /api/anime/:animeId/rating
- Reviews (authentication required):
POST /api/anime/:animeId/reviews/upsertPOST /api/anime/:animeId/reviewsGET /api/anime/:animeId/reviewsDELETE /api/anime/:animeId/reviews- File:
backend/src/routes/anime.routes.js
-
Manga (similar structure to Anime):
GET /api/manga— List of mangasPOST /api/manga— Add mangaGET /api/manga/carousel— List of manga carouselPOST /api/manga/carousel— Add manga carouselGET /api/manga/search— Manga search queueGET /api/manga/detail/:id— Manga card detailGET /api/manga/carousel/:id— Manga carousel by IDGET /api/manga/:id— Manga by ID- Rating (authentication required):
GET /api/manga/:mangaId/rating
- Reviews (authentication required):
POST /api/manga/:mangaId/reviews/upsertPOST /api/manga/:mangaId/reviewsGET /api/manga/:mangaId/reviewsDELETE /api/manga/:mangaId/reviews- File:
backend/src/routes/manga.routes.js
- Backend:
pnpm dev— Run the server withnodemon(src/server.js)pnpm start— Run the Node server (src/server.js)
- Frontend:
pnpm dev— Run the Vite development serverpnpm build— Build for productionpnpm preview— Preview the buildpnpm lint— Run ESLint for linting
- The backend CORS origin is currently hardcoded to
http://localhost:5173inbackend/src/app.js. Update it to match your frontend domain. - Ensure environment variables for the database and JWT are correctly configured.
- The backend uses ES Modules (
"type": "module"), adjust imports/exports accordingly. - Still in development phase.