The KusiNote App is a microservices-based application that allows users to create, edit, and organize their notes. It is built using React.js for the frontend, Empress.js for microservices-based servers (posts, queries, comments, and event notifications), Winston for logging and monitoring, Jest for automated testing, and Docker for efficient containerization.
Manages user posts. Frontend post requests are forwarded to the event-bus service for event notification.
Manage user comments. Frontend comment requests are forwarded to the event-bus service for event notification.
Manages post/comment request notifications. Requests from post and comment services are forwarded to the query service for database management
Manages user data, including posts and comments, connected with MongoDB database through Mongoose operations
Renders web pages for the note-taking app.
- Express.js is employed to create interconnected microservices-based servers for posts, queries, comments, and event notifications.
- Integrated Winston API for a logging system, enabling real-time performance tracking across microservices
- Jest is used for comprehensive and reliable automated testing across microservices to ensure robust testing coverage.
- Docker is leveraged to containerize each microservice, ensuring efficient resource utilization and streamlined dependency management.
Make sure you have the following installed on your machine:
- Node.js
- MongoDB
- Docker
-
Clone the repository:
git clone https://github.com/wifi1999/KusiNote.git
-
Install the dependencies:
cd posts npm installcd comments npm installcd event-bus npm installcd query npm installcd client npm install -
Create Environmental Variables:
cd posts
touch .env
EVENT_BUS_URL=http://localhost:4005/events cd comments
touch .env
EVENT_BUS_URL=http://localhost:4005/events cd event-bus
touch .env
POSTS_URL=http://localhost:4000/events
COMMENTS_URL=http://localhost:4001/events
QUERY_URL=http://localhost:4002/events cd query
touch .env
MONGO_URL=YOUR_MONGODB_URL # create your own mongoURL
NODE_ENV='DEVELOPMENT' cd client
touch .env
REACT_APP_POSTS_CONTAINER_URL=localhost
REACT_APP_COMMENTS_CONTAINER_URL=localhost
REACT_APP_QUERY_CONTAINER_URL=localhost- Starting the Application:
- (Option 1) You can run the application by running the Docker container (if you already installed one)
docker-compose up --build # --build flag ensures that the images are built if not already present.- (Option 2) You can also run the application by starting each microservices and the frontend client
cd posts
npm run devThe posts service will run on http://localhost:4000.
cd comments
npm run devThe comments will run on http://localhost:4001.
cd event-bus
npm run devThe comments will run on http://localhost:4005.
cd query
npm run devThe Server will run on http://localhost:4002.
cd client
npm startThe Server will run on http://localhost:3000.