This project is slowly migrating to: https://github.com/BayuDC/waifuseum-next. Why? so many bad code.
Waifuseum (Museum Waifu) is a simple REST API for storing and managing anime picture collection. This project use combinaton of ExpressJS, Discord.js, and MongoDB. This uses Discord server as a place to store picture file and MongoDB to save the picture url. When we upload a file to discord server, we can right click the message and get the file url then we can save the file url in a database, and yeah free cloud storage to store picture file. So, I made this project to automate it. Btw, this project is inspired by Waifu.pics and Nekos.life.
- User upload the picture file to the http endpoint
- The program send the file to Discord server via discord bot
- The program save the url(obtained from discord bot) to database
Very simple right?
The logic is album as channel then picture as message.
Join my discord server if you want to see it. Here is the link: https://discord.gg/8sSfCNCXHW.
The main drawback of this API is the file size limitation. Due to
Discord rules, This API can't save files with size more than 8 mb.
Server Boost is needed to increase the maximum file size limit.
The limit increased to 25mb now! It's more than enough to store 4K image files.
Base URL: https://api.waifuseum.art
Path | Method | Body or Query |
---|---|---|
/ |
GET | - |
/pictures |
GET | ?full ?filter ?page ?count |
/pictures/mine |
GET | ?full ?filter ?page ?count |
/pictures/all |
GET | ?full ?filter ?page ?count |
/pictures/<id> |
GET | - |
/pictures |
POST | { file/fileUrl, album, source? } |
/pictures/<id> |
PUT | { file/fileUrl?, album?, source? } |
/pictures/<id> |
DELETE | - |
/albums |
GET | ?full ?filter ?page ?count |
/albums/mine |
GET | ?full ?filter ?page ?count |
/albums/all |
GET | ?full ?filter ?page ?count |
/albums/<id> |
GET | - |
/albums/<id>/pictures |
GET | ?full ?page ?count |
/albums |
POST | { name, slug?, private?, community? } |
/albums/<id> |
PUT | { name?, slug?, private?, community? } |
/albums/<id> |
DELETE | - |
/auth |
GET | - |
/auth/me |
GET | - |
/auth/login |
POST | { email, password } |
/auth/logout |
POST | - |
/profile |
GET | - |
/profile/password |
PATCH | { oldPassword, newPassword } |
/users |
GET | ?full |
/users/<id> |
GET | - |
/users |
POST | { name, email, password, abilities } |
/users/<id> |
PUT | { name?, email?, abilities? } |
/users/<id> |
DELETE | - |
Sorry i am too lazy to make Swagger UI.
Requirements: A Discord bot that has Worker role in Waifuseum Discord server
$ git clone https://github.com/BayuDC/waifuseum.git
$ copy .env.example .env
$ pnpm install
$ pnpm dev