Git Product home page Git Product logo

1pro_food_to_eat's Introduction

Food to eat

My very first training project.

List of contents:

  1. About the project

  2. Used technologies and tools

  3. My new experiences during coding

  4. To do list

  5. How to run the application

  6. Appendix - a bit more information about my approach to write this application.

About the project

It is a CRUD application that serves me as a development sandbox. Its main goals are:

  • combining various aspects previously learned and used in separate tiny training applications
  • encountering problems and solving them
  • building a layered application
  • creating a REST API
  • covering the code with tests
  • gaining experiences

Its business goal is to manage food products in terms of their suitability for consumption.

Used technologies and tools

  • Database:
    • at the very beginning MySQL,
    • finally in-memory H2
  • Java 8+
  • Spring Boot
  • Hibernate
  • Lombok
  • JUnit
  • Mockito
  • Maven
  • JaCoCo
  • OpenAPI Swagger
  • Postman
  • IntelliJ
  • Git
  • GitBash
  • GitHub

My new experiences during coding

  • UUID.class
  • n+1 problem
  • LocalDate.class as an entity property
  • configuring of login levels
  • stack overflow exception caused by bidirectional table relations
  • DTOs
  • deploying MySQL database to Amazon Web Services - RDS
  • handling exceptions with AOP approach
  • Java Code Coverage tool
  • Builder pattern
  • usefulness of unit tests during refactoring
  • ... and couple others

To do list

  • Database
  • REST API
  • Improve overall consistency
  • Tests
  • Integration with Open Food Facts API
  • Logging
  • Any others that I don't know about yet ;)

How to run the application

Windows, Linux, macOS, Android.
(In case of Android I recommend Termux as a CLI.)

  1. Download and install the latest Java Runtime Enviroment (JRE)

  2. Use the chosen CLI to verify if the installation passed successfully, by typing

     java -version
    

    As a result you should see a similar response

     java version "21.0.3" 2024-04-16 LTS
     Java(TM) SE Runtime Environment (build 21.0.3+7-LTS-152)
     Java HotSpot(TM) 64-Bit Server VM (build 21.0.3+7-LTS-152, mixed mode, sharing)
    
  3. Download a jar file from the GitHub - Releases section

  4. Again use the CLI to go to a folder that contains the downloaded file and run it ( the jar file name may vary )

     java -jar foodToEat-0.0.1-SNAPSHOT.jar
    
  5. Use the following URL with a web browser http://localhost:8081/swagger-ui/index.html#/

  6. You should see a similar page. Use it to test the application.

Spring Boot

  1. To stop the application press CTRL + C in the CLI.

To get a default Spring Boot - Open API documentation click the link just below the application title - (/v3/api-docs)

Appendix

I approached this project several times. At the very beginning, I thought that I would immediately develop an application that goes beyond a typical CRUD functionality, with a database structured on several tables connected by 1:1, N:1, N:M relationships.
However, the first project, novice-level experience, too much complexity for the first application and limited time forced me to simplify it to its current form.

The version presented here is:

  • the most advanced in terms of code completeness
  • the simplest in terms of business complexity

The first step is done. There are still some work to do.
And for the future, I already feel more comfortable approaching a new personal project that I have in mind :).

^ Go to the top of the page ^

1pro_food_to_eat's People

Contributors

pawelbugiel avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.