TODO


This guide will help you create a full stack application integrating Angular/React/Vue JS as frontend and using Spring Boot to create the backend REST API.

Todo

  • How to import and run projects from git repository?
  • Create videos based on full stack articles.

We will and create a TODO***.

You will learn

  • What?
  • Why?
  • How?
  • Where?
  • When?

10 Step Reference Courses

Resources/URLs/Entities Overview

In this guide, we will create TODO services.

The REST API can be enhanced to interact with other microservices infrastructure components and act as microservices.

Complete Maven Project With Code Examples

Our Github repository has all the code examples - https://github.com/in28minutes/spring-boot-examples/tree/master/TODO_URL

Project Structure

Following screenshot shows the structure of the project we will create. Image

A few details:

  • StudentController.java - Rest controller exposing all the three service methods discussed above.
  • Course.java, Student.java, StudentService.java - Business Logic for the application. StudentService exposes a couple of methods we would consume from our Rest Controller.
  • StudentControllerIT.java - Integration Tests for the Rest Services.
  • StudentControllerTest.java - Unit Tests for the Rest Services.
  • StudentServicesApplication.java - Launcher for the Spring Boot Application. To run the application, just launch this file as Java Application.
  • pom.xml - Contains all the dependencies needed to build this project. We will use Spring Boot Starter Web.

Tools you will need

  • Maven 3.0+ for building Spring Boot API Project
  • npm, webpack for building frontend
  • Your favorite IDE. We use Eclipse for Java and Visual Studio Code for Frontend - JavaScript, TypeScript, Angular and React.
  • JDK 1.8+
  • Node v8+
  • Embedded Tomcat, built into Spring Boot Starter Web

Installing Node Js (npm) & Visual Studio Code

  • Playlist - https://www.youtube.com/playlist?list=PLBBog2r6uMCQN4X3Aa_jM9qVjgMCHMWx6
  • Steps
    • Step 01 - Installing NodeJs and NPM - Node Package Manager
    • Step 02 - Quick Introduction to NPM
    • Step 03 - Installing Visual Studio Code - Front End Java Script Editor

Installing Java, Eclipse & Embedded Maven

  • Playlist - https://www.youtube.com/playlist?list=PLBBog2r6uMCSmMVTW_QmDLyASBvovyAO3
  • Steps
    • 0 - Overview - Installation Java, Eclipse and Maven
    • 1 - Installing Java JDK
    • 2 - Installing Eclipse IDE
    • 3 - Using Embedded Maven in Eclipse
    • 4 - Troubleshooting Java, Eclipse and Maven

Article Begins

Some theory

Bootstrapping Spring Boot REST API with Spring Initializr

Creating a REST service with Spring Initializr is a cake walk. We will use Spring Web MVC as our web framework.

Spring Initializr http://start.spring.io/ is great tool to bootstrap your Spring Boot projects.

Image

Image

As shown in the image above, following steps have to be done

  • Launch Spring Initializr and choose the following
    • Choose TODO as Group
    • Choose TODO as Artifact
    • Choose following dependencies
      • Web
      • DevTools
      • TODO
  • Click Generate Project.
  • Import the project into Eclipse. File -> Import -> Existing Maven Project.
  • If you want to understand all the files that are part of this project, you can go here TODO.

Bootstrapping Angular Frontend with Create React App

Change title to ‘My Full Stack Application with Spring Boot and React’ in index.html

import React, { Component } from 'react';

class InstructorApp extends Component {
    render() {
        return (

            <div className="InstructorApp">
                <h1>Instructor Application</h1>
            </div>
        )
    }
}

export default InstructorApp

npm add axios npm add react-router-dom npm add formik

Recommended Watch - Watch this video to understand Full Stack Application Architecture - Angular + Spring Boot

Recommended Watch - Watch this video to understand about Installing Angular CLI - Awesome Tool to create Angular Projects Recommended Watch - Watch this video to understand about using Angular CLI to Create and Launch Angular Application Recommended Watch - Watch this video to understand about Importing Angular App into Visual Studio Code Recommended Watch - Watch this video to understand about Angular Project Structure Recommended Watch - Watch this video to understand about Generating a Angular Component with ng generate

Recommended Watch - Watch this video to understand Full Stack Application Architecture - Spring Boot and React Recommended Watch - Watch this video to understand about Create React App - Create and Launch a React Application Recommended Watch - Watch this video to understand about Importing React App into Visual Studio Code Recommended Watch - Watch this video to understand about React Project Structure Recommended Watch - Watch this video to understand about React Components

STEP 1 : TODO

Step N : Executing the TODO Service

Below picture shows how we can execute this Get Service from Postman - my favorite tool to run rest services. Image

Executing a POST Rest Service

Example Request is shown below.

Below picture shows how we can execute this Post Service from Postman - my favorite tool to run rest services. Make sure you go to the Body tab and select raw. Select JSON from the dropdown. Copy above request into body.

Image

Congratulations! You are reading an article from a series of 50+ articles on Spring Boot and Microservices. We also have 20+ projects on our Github repository. For the complete series of 50+ articles and code examples, click here.

Next Steps

Image

Image

Image

Complete Code Example

  • TODO

Related Posts

Spring Boot Tutorials for Beginners

At in28Minutes, we are creating a number of tutorials with videos, articles & courses on Spring Boot for Beginners and Experienced Developers. This resources will help you learn and gain expertise at Spring Boot.

Microservices Architectures - What is Fault Tolerance?

In this article, we discuss an important property of microservices, called fault tolerance

Microservices Architectures - Introduction to Auto Scaling

In this article, we focus our attention on the Dynamic Scaling or Auto Scaling. Why do we need applications that can auto scale?

Microservices Architectures - Importance of Centralized Logging

In this article, we explore the concept of centralized logging, in the context of microservices.

Microservices Architectures - Introduction to API Gateway

In this article, we look at what an API Gateway is, in the context of microservices.

Microservices Architectures - Centralized Configuration and Config Server

In this article, we explore the concept of centralized configuration, in the context of microservices.

Microservices Architectures - What is Service Discovery?

In this article, we talk about Service Discovery. Why is Service Discovery important in microservices architecture, and how to set it up for your application.

Microservices Architectures - Advantages Of Microservices

Microservices architectures are very popular today. In this article, we discuss the three main advantages of having a microservices architecture.

Microservice Architectures - Challenges with building Microservices

Microservices architectures are very popular today. In this article, we discuss the important challenges in developing a microservices architecture.

Microservices Architectures - Microservices vs SOA

Microservices architectures are very popular today. In this article, we take a look at how microservices architectures are different from Service Oriented Architectures (SOA).