JavaRush /Java Blog /Random EN /We are writing a real project for a portfolio - "Java pro...

We are writing a real project for a portfolio - "Java project from A to Z"

Published in the Random EN group
Hello everyone, future Senior Software Engineers ! Over the past few months, I've been writing simple articles that describe important parts of development. Today I’ll tell you about my idea! I want to help you get your first job. What is needed for this? To do this you need to gain experience. Understand what these very projects consist of, on which engineers work and move the world of information technology forward.

All materials in the series:

“Java project from A to Z”: writing a real project for a portfolio - 1How to do it? I need to write something. Therefore, as part of this series of materials, we will write our own telegram bot step by step (details below). And at the same time, we’ll understand the technology stack that even a novice Java developer needs.

Target

Write a project that will combine working with databases, creating the business logic we need, and setting up work to deploy the project and test it. What are we going to write? If you are going to write, then you need to write something really useful so that there is interest in the work and someone can take advantage of the result. Based on this data, a telegram bot will be written that will work with the JavaRush website. Will this be useful? Without a doubt! Due to the fact that telegram bots are not so difficult to write, you can quickly get a working project that can be useful.

Development time

Articles will be published once a week, so there will be enough time to master / repeat / write questions if anything is unclear. The first articles will be the theoretical foundation that we will use in the project. And then it’s just practice.

MVP (minimum viable product)

“Java project from A to Z”: writing a real project for a portfolio - 2What is MVP? The term, as usual, is not ours, but you can find a reasonable explanation on the wiki . We quote: MVP is a product that has minimal functions, but sufficient to satisfy the first needs. The main task is to receive feedback to form hypotheses for the further development of the product. For us, this description fits perfectly. A quick description of all functionality: As a Telegram user, I want to be able to subscribe to new articles in groups and receive notifications when new ones are published. I love reading the Success Story group , it motivates me to continue learning and learn something new. I'm lazy and don't want to go in and refresh the page every time . Therefore, I, as a programmer, want to make my life easier and write a program that would send me a message on Telegram that a new article has been published. Further more: this is not the only group that I track. I'm from Kharkov, so I'm interested in reading articles that are published there. As the developer of this product, I will be very interested in whether someone is using my work, so we will add functionality for admins so that they can view the statistics of the telegram bot. Is it possible to do this? Certainly! How? This is what I will show in a series of articles.

Code name

Every cool project should have a code name. Ours will not be an exception, so for now it will be like this: JRTB (JavaRush Telegram Bot). Hereinafter it will be called that.

What topics will we cover?

“Java project from A to Z”: writing a real project for a portfolio - 3

Database

You need to immediately understand that you cannot store state (data and information) in the application. The data needs to be stored in a database. Since there is no information on it in the training (as far as I remember :D), I will try to fill in the gaps in knowledge that we will need. I will try to make the database schema as simple as possible so that there is no confusion. This part will include:
  1. Theory of working with SQL based on MySQL.
  2. A tool for working with MySQL is MySQL Workbench.
  3. Database versioning. Flyway and liquidbase.
  4. Creating a database schema.
  5. Create a database schema drawing.

Git

There are already articles on this topic. Of course, nothing will work without a version control system. To start working on JRTB, you need to understand git. You can do it yourself, or you can read my articles on this topic: If you wish, you can also read about branching strategies, but this is not critical here and can be skipped.

Maven

Here we will talk about the assembly system, what it is for, how we will use it, what to pay attention to, and rules of good manners. We’ll also talk about versioning here, and how exactly we’ll do it.

Docker

To make our life simpler and easier, and to make the deployment process as simple as possible, we will use Docker. To do this, let's talk about what Docker is and what useful commands there are. I want to say right away that I use Docker at the user level and may not know or be able to do something)) So if someone suggests how to make working with Docker better/easier, I will only be glad of it. This part will include:
  1. Theory and practice of Docker.
  2. Backup/restore data via docker.
  3. Setting up our project so that it runs in Docker.

Bash scripts

To automate work, sometimes it is useful to write one or two scripts. Bash scripts are scripts that all developers understand to one degree or another, because they are essentially command line work in Linux, simply saved in a separate file.

Creating an application

All the drive will be here. Based on previous knowledge, we will build a Spring Boot application that will contain a telegram bot object. What are we going to do here?
  1. Creating a complete description of the functionality that should be there.
  2. A brief description of what a telegram bot is.
  3. Creating a Spring Boot application.
  4. Description of working with Lombok.
  5. Description of working with UniRest.
  6. Implementation of the Command pattern + work with creating your own annotation for administrator commands.
  7. Creating a client for working with JavaRush queries (such as a list of groups, a list of articles in a group) using UniRest.
  8. Testing. Let's write all possible tests to cover our functionality.
  9. Setting up a system for checking code quality and automatically building on GitHub.
  10. Connecting the database along with database versioning.
All these steps will be done step by step, in order to better understand what is going on.

Future results

As a result, we will get a real project that anyone who reads the articles can implement. The beauty of a telegram bot is that you can link this project to any bot, so as not to be dependent on the bot that will be in the articles. I will say more: this is just the beginning of JRTB. New functionality can be discussed/added in the future. Make this bot so that it is useful to all students of the JavaRush project. And the feeling that other people use and like your creation is worth a lot! And you, as readers of this series of articles, will be able to gain real experience working on a real project. Traditionally, I suggest subscribing to my account on Github , in which I post solutions and projects. All work on JRTB will be done through GitHub, so I advise you to register if you have not already done so. Thanks for reading everyone, see you soon :)“Java project from A to Z”: writing a real project for a portfolio - 5
Comments
TO VIEW ALL COMMENTS OR TO MAKE A COMMENT,
GO TO FULL VERSION