Skip to content

sgabriel190/keep-fit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Keep fit

Keep fit tries to implement a web platform which helps users keep track of their nutritional intake. It is implemented based on a MSA(microservice architecture) and ready to be deployed with Docker containers.

The website contains a large database of recipes from www.ambitiouskitchen.com and www.bbcgoodfood.com. Those are available to either create a meal plan for a user or just search through.

Getting Started

Software architecture implemented

As stated before, the project is based on MSA (microservice architecture), resulting 6 services:

  • User service - this service is responsible for user data and JWT creation and validation.
  • Plan Service - plan service stores all the data about user's meal plans. The association is made by referring the user ID from User Service and recipe ID from Nutrition Service.
  • Notification Service - it implements an SMTP client and using a public SMTP server sends emails to users based on their registration data.
  • Nutrition Service - the service contains all data about recipes: nutritional information, recipes general information and recipes images
  • Orchestrator Service - as the orchestrator pattern from SOA(service oriented architecture.)
  • Frontend Service - the first service that users interact with. It contains all the data about the web portal, basically the web pages and their associated logic.

A visual representation of those services for a better understanding.

Service diagram

Even with this separation of business logic, it is debatable if those services are indeed an implementation of MSA. Some of those services are still not granular enough. It can be split further into more granular services.

Ex: User Service implements authentication and authorization along with CRUD operations for user data. Based on the MSA the authorization and authentication can be implemented as a new services with has this only one job.

In the diagram representation above, it can be noticed some more components which are not yet mentioned. Those are:

  • Web scraper script
  • Database scripts and data filter
  • SQLite database

Data persistence

As a data persistence solution, SQLite was a good fit not only for its lightweight usages but also is a good fit for a true MSA solution. Those database files are integrated in their each proprietary service. By those means there is a better isolation between data.

It needs to be mentioned that this solution does not provide a good replication and distributed database solution.

Web scraping

The project also includes Python3 scripts which do the Web scraping and data processing part. The Web scraping script implemented using Selenium accesses a list of source urls, scrapes each recipe url then using multiprocessing extracts all the necessary data with a Python package called recipe_scrapers.

Those extracted data must follow a refinement process in which the necessary data is transformed in a way that fits platform needs.

More about architecture

This implementation was developed based on DDD(domain driven design) ideology which supports developing software based on the business models and create a ubiquitous language.

System domains

The above representation indicates the system domain bound contexts and their way of interaction.

Toolstack

As programming languages used for developing this project, the stack is:

  • Kotlin - developing backend services
  • Python - developing backend service and implementing data acquisition scripts
  • Java - developing backend service
  • Typescript - used for developing Frontend code along with React.js library

All the service stack is configured to run on Docker and Docker compose. This way it does not require any configuration on the local machine beside installing Docker and creating the Docker images from Dockerfiles.

Postman testing routes

For testing the application there is a Postman collection created and stored as JSON file in the Documentation folder

How to run the project

  • A local machine running whatever OS. (Linux/Windows/Mac OS)
  • Installing docker on the local machine.
  • Running the Dockerfiles for each service.
  • Run the Docker compose configuration for an easier management.
  • Access the app and test its features.

Use case diagram

The use case diagram contains a big picture about the application functionalities and general workflow.

Use case diagram

More details

There will be included a README file for each service for a better understanding and representation of technical details.

Authors

Gabriel Strilciuc

Linkedin

License

This project is licensed under the MIT License - see the LICENSE.md file for details

About

Monitor your activity and maintain yourself fit.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published