This project is a robust backend API built with NestJS, designed to manage and serve manga-related data. It leverages Prisma as an ORM for seamless database interactions with PostgreSQL and provides a RESTful API for various manga operations.
The Manga Web API provides a structured backend for managing manga series, chapters, and sources. It is built with a focus on scalability and maintainability, utilizing modern TypeScript and the NestJS framework. The API supports core functionalities like creating, retrieving, updating, and deleting manga-related entities.
To set up this project locally, follow these steps:
Clone the repository:
git clone https://github.com/phambaophuc/manga-web-api.git
cd manga-web-api
Install dependencies:
npm install
Database Setup:
.env file in the root directory and adding your DATABASE_URL and DIRECT_URL:PORT=3000
DATABASE_URL="postgresql://user:password@host:port/database?schema=public"
DIRECT_URL="postgresql://user:password@host:port/database?schema=public"
npx prisma migrate deploy
Run the development server:
npm run dev
This API provides endpoints for managing manga sources, series, and chapters.
Development:
npm run dev
The server will start at http://localhost:3000.
Production:
npm run build
npm run start:prod
Swagger Documentation:
Access the interactive API documentation at http://localhost:3000/docs.
Example Endpoints:
Create a Manga Source:
POST /api/v1/sources
Request Body:
{
"name": "Example Source",
"base_url": "https://example.com",
"parser_class": "ExampleParser",
"status": "ACTIVE",
"rate_limit_per_minute": 30
}
Get a Manga Series by Slug:
GET /api/v1/comics/one-piece
Get a Manga Chapter by Series Slug and Chapter Number:
GET /api/v1/chapters/one-piece/1
This project is licensed under the MIT License - see the LICENSE.md file for details.
© 2023 phambaophuc. All rights reserved.
Feel free to Fork 🍴, Star ⭐, and Watch 👁️ the repository!