After scouring the internet for some API's to consume data from a periodic table and not finding it, I decided to create my own API.
Despite being a simple model where it is only possible via GET, it was still very challenging.
I hope it will be useful in some project and that it may have contributed in some way to the dissemination of such rich content.
The backend of this project was built on NodeJS and hosted on Heroku.
access: https://apiperiodictable.herokuapp.com/
All API content is in the root path " .../ ", just access the link above and use the data through the GET method.
The frontend is being built in NextJS using a payment API that in this case was linked to receive donations for the project.
This API is Stripe in version 20200827.
Hosting is provided by Vercel
access: https://apiperiodictable.vercel.app/
Just use tradicional methods of query a JSON document, you can set with axios or fetchAPI for javascript for exemple.
The url for query api is: https://apiperiodictable.herokuapp.com/ she is a JSON format.
The dependencies used in the project were:
- Express
- Cors
- Body-Parser
- Morgan
- Nodemon
- NextJS
- Typescript
- React-Dom
- React-Icons
- Stripe
- Sass
It was still necessary to install the Heroku CLI
Only after these steps was it possible to see the API working :)
Below is a table with the technologies and their versions.
Backend | NodeJS | Express | Cors | Body-Parser | Morgan | Nodemon |
---|---|---|---|---|---|---|
VERSIONS: | 16.13.1 | 4.17.2 | 2.8.5 | 1.19.1 | 1.10.0 | 2.0.15 |
Frontend | NextJS | Typescript | React-Dom | React-Icons | Stripe | Sass |
---|---|---|---|---|---|---|
VERSIONS: | 12.0.8 | 4.5.5 | 17.0.2 | 4.3.1 | 8.199.0 | 1.49.0 |
Don't be disappointed when I say that all API information is being printed by a const db.
Located inside the database/database directory.
The structure chosen was the JSON format as shown below.
So that this application reaches a more professional level:
- MongoDB Database.
- Buy your own domain.
- Update application to TypeScript. (backend)
- Insert more information for each element.
- Invite people to participate in the project.