This is a simple project I am making to learn more about how the APIs works and how to deal with them.
The API I am using is the mangadex api, which can be found on MangaDex.
The fronend of this app is created using the React framework. The whole project is like a testing thing for me to hone my JavaScript skills and learn React and NodeJS.
- clone this repo
- cd into that folder
- run this command
> npm install
- and that's it.
To be honest, I am very noob to backend. I have done some previous projects with Node and Express, but this project is way-way bigger than any of the previous ones combines together. Like
-
I had to work with databases which I am not familiarized with.
-
Working with APIs is kinda new for me, specially an API which requires you to update your credential almost every time you make a request.
-
I had never used docker before this project and I had to learn that for somethings (which I am not sure about).
-
Making an app of this size is a bit tiring for me, because I procastinate a lot and at the end of the day I have to code the whole day's worth of code in couple of hours.
docker pull monog:5.0
> docker run -p 0.0.0.0:3999:27017 --name mangapedia-mongo -d mongo:latest
- To cache the latest result.
- To store the chapter list for different mangas.
Why not just download all the chapters and store them in the cache you asked ? Well my friend, because it is illegal. You can't
After that you could simply use a mongoDB visualiser like mongo-Atlas to connect to the port and localhost to visualise and crete a database with GUI if you prefer
I don't think there will be any problems with this, and if there are any, just ask our friend Google.
1. Express
2. Mongoose
3. Helmet
4. Morgan
5. Parcel (for the frontend)
6. Babel (to compile into js)
6.1 @babel/core
6.2 @babel/preset-env
6.3 babel-watch
7. graphql (with apollo)
8. CORS
- 3000 - main backend server
- 3047 - our CORN job for the mongoDB
- 3001 - parcel frontend
This is because I am using babel-watch to compile this code (ECMAScript) into js code and I am babel needs helps with converting. To solve this problem i am using the .babel.config.js file with
module.exports = {
"presets": ["@babel/env"]
}
This repo is the answer to that problem. I was reluctant to upload this to my repo becaues of my bad code, but I thought "WHO CARES??!!". So I am making it public instead of private, cause fuck the haters and love yourself.
I am using the MangadexAPI to gather the data, which isn't the problem as I have said before, which is fantastic, but to make my life more miserable, I am making my frontend and backend two seperate apps, and to deal with the complications I am using GraphQL, which I am a novice in, but I want to learn it.