TagBuilder is a microservice-based application that enables the generation of tags for sentences. In this application, we utilize Docker containers to encapsulate and deploy each microservice independently.
This application has one functionality. It takes a sentence as input. Using Natural Language Toolkit (NLTK), generates tags for the sentence. The tags are then displayed to the user.
The application consists of three microservices, each one of specific functionality. The microservices are:
- sa-frontend: a Nginx web server that serves our static ReactJS application.
- sa-webapp: A Golang server that serves as the backend for handling the requests from the frontend.
- sa-logic:A Flask Application that performs tag generation.
The application architecture is shown in the figure below:
To enable easy deployment and scalability, each microservice in this application has been containerized using Docker.
Before running the application, ensure that you have the following installed:
- Nginx
- Golang
- Python
To run the application locally, follow the steps below:
- Clone the repository:
$ git clone https://github.com/0xt3j4s/TagBuilder.git
- Change directory to the repository:
$ cd TagBuilder
- Run the following commands to start the microservices:
# a. Flask Application:
$ cd sa-logic
$ cd sa
$ pip install -r requirements.txt
$ python tag_builder.py
$ cd ..
# b. Golang Server:
$ cd sa-webapp
$ go build
$ cd ..
# c. ReactJS Application:
$ cd sa-frontend
$ npm install
$ npm run build
$ cd ..
If you don't have Docker installed, you can follow the instructions here.
$ sudo docker pull $DOCKER_USER_ID/tag-builder-logic
$ sudo docker pull $DOCKER_USER_ID/tag-builder-webapp
$ sudo docker pull $DOCKER_USER_ID/tag-builder-frontend
This will pull the latest images from Docker Hub and store them in your local machine.
$ sudo docker run -d -p 5010:5010 $DOCKER_USER_ID/tag-builder-logic
$ sudo docker run -d -p 8081:8081 -e PYTHON_API_URL='http://<container_ip or docker machine ip>:5010' $DOCKER_USER_ID/tag-builder-webapp
$ sudo docker run -d -p 80:80 $DOCKER_USER_ID/tag-builder-frontend
Contributions are welcome! If you find any issues or have suggestions for improvement, please create an issue or submit a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.