Microservices in Nodejs (typescript) with API gateway, JWT authentication for document processing (pdf->txt) (microservice1), and sentiment analysis (microservice 2)
This project is a simple implementation of a microservice architecture. It includes an API Gateway that derives the task to two different microservices, depending on the endpoint path. The API gateway uses JWT for authentication to run and authenticate the users without having to store sessions.
The document processing only has the "documentReader/document" endpoint, which accepts CRUD methods. The information is forwarded from the "front" gateway that verifies the user's authentication before the redirection. The document reader works as a standard rest API without authentication (because the gateway has done it before). The document is uploaded via post as form-data and processed asynchronously. Once it is processed, it returns the documentId that has been inserted into the MongoDB.
This second microservices exposed via the endpoint documentAnalyzer/analyzeSentiment, forwarded through the API gateway. It does a basic sentiment analysis from the document converted by the documentReader microservice. To achieve this, the user has to provide the documentId generated by the documentReader once a document has been inserted and stored into the DB.
The result is the positive, negative, and neutral words found in the document you provided.
#Screenshots: General service view
Postman query to the processed documents (pdf->txt)
Postman query with the result of the sentiment analysis
Postman login result with the JWT token required to query the internal microservices