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.

Spring Boot Basics - What Is A Profile?

When we develop applications, we would want to be able to provide different application configuration in different environments? How do you achieve it with Profiles?

Spring Basics - What Is A Dependency?

Most important feature of Spring Framework is Dependency Injection. To understand Dependency Injection, you need to understand the concept of a Dependency.

Architecture of Spring Framework - Modularity and Spring Modules

One of the most important features of the Spring framework is its modularity. It is not one big monolith framework. What are Spring Modules? How are they organized? What is the architecture of Spring Framework?

What Are Spring Projects?

There are several important Spring Projects solving the needs of enterprises today. What are Spring Projects and how are they different from Spring Modules?

Spring Basics - Introduction To Spring Batch

Spring Batch is a lightweight, comprehensive batch framework that is designed for use in developing robust batch applications.

Spring Framework Basics - What Is Inversion Of Control?

Developers starting with the Spring framework often get confused with terminology - Dependency, Dependency Injection and Inversion Of Control. In this article, we introduce you to the concept of Inversion of Control.

Spring Boot Basics - Introduction To Spring Data and Spring Data JPA

In this article, we take a look at Spring Data and Spring Data JPA.

Spring Basics - Introduction To Spring Framework

In this article, we look to get an introduction to what the Spring framework is, and why it is so widely used.

Spring Boot Basics - Introduction To Spring Data Rest

Spring Data project provides common abstractions to integrate with different kinds of data stores. Spring Data Rest is part of the umbrella of Spring Data projects. It makes it easy to build hypermedia-driven REST web services, on top of Spring Data repositories.