https://github.com/probro27/citation-gen-api
Node API to generate citations automatically
https://github.com/probro27/citation-gen-api
node-api typescript
Last synced: 10 months ago
JSON representation
Node API to generate citations automatically
- Host: GitHub
- URL: https://github.com/probro27/citation-gen-api
- Owner: probro27
- License: mit
- Created: 2022-11-12T00:03:01.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2022-11-16T00:20:45.000Z (about 3 years ago)
- Last Synced: 2025-01-05T12:41:14.558Z (12 months ago)
- Topics: node-api, typescript
- Language: TypeScript
- Homepage:
- Size: 205 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Citation Generation API
## Summary
This is a Node API to generate citations automatically. Right now it only supports APA 7 citations.
Support for MLA and BibTex citations can be added by creating more classes and making them child classes of
`Citation` class.
We have utilized an Object-Oriented Architecture to separate everything and minimize coupling and maximize cohesion for a great design.
Here is the Unified Modelling Language (UML) diagram for the models:
```mermaid
classDiagram
Citation <|-- Apa
Citation o-- Source
Source <|-- Article
Citation o-- IDetails
Citation : getCitation()
Citation : retreiveData()
Citation : source
Citation : details
Apa : getCitation()
Apa : version
Source o-- IDetails
Source : extractData()
Source : details
Source : url
Article *-- Metascraper
Article : _metascraper
Article : metadata
Article : fetchPage()
Article : getContent()
Article : assignMetadata()
Article : extractData()
IDetails : author
IDetails : title
IDetails : publisher
IDetails : yearOfPublication
IDetails : pageNumbers
```
This API uses `metascraper` to extract the data about websites. Credits: [Metascraper](https://metascraper.js.org/)
### Input
Right now a **POST** request can be sent to the endpoint `/api/citation/article`.
The body is as follows:
```json
{
"url": "https://doi.org/10.1007/s10639-021-10650-9"
}
```
### Output
The output will be provided as follows:
```json
{
"citation": "Alaattin Parlakkiliç (2021-07-12T00:00:00.000Z), Evaluating the effects of responsive design on the usability of academic websites in the pandemic - Education and Information Technologies, SpringerLink, https://doi.org/10.1007/s10639-021-10650-9"
}
```
It's not perfect right now, and might return null values for some stuff so it needs to be fixed.
Please contribute to this repository to improve the code.