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

Image

Image

Image Image

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 and Spring Boot Video Tutorials for Beginners

At in28Minutes, we are creating a number of tutorials with videos, articles & courses on Spring Boot for Beginners and Experienced Developers. Here's a list of video tutorials and courses for you

Software Design - Separation Of Concerns - with examples

Software architects and programmers love having Seperation of Concerns. What is it? Why is it important? Let's get started.

Object Oriented Software Design - Solid Principles - with examples

Software design is typically complex. Object oriented design takes it to the next level. There are a number of design patterns and other stuff to be aware of. Can we make things simple? What are the goals to aim for when you are doing object oriented design? SOLID Principles is a great starting point for Object Oriented Design.

Software Design - Open Closed Principle - with examples

Open Closed Principle is one of the SOLID Principles. You want your code to be easily extended. How do you achieve it with minimum fuss? Let's get started.

Software Design - What is Dependency Inversion Principle?

Dependency Inversion Principle is one of the important SOLID Principles. Dependency Inversion Principle is implemented by one of the most popular Java frameworks - Spring. What is it all about? How does it help you design good applications?

Introduction to Four Principles Of Simple Design

With agile and extreme programming, the focus is on keeping your design simple. How do you keep your design simple? How do you decide whether your code is good enough?

Software Design - Single Responsibility Principle - with examples

For me, Single Responsibility Principle is the most important design principle. What is Single Responsibility Principle? How do you use it? How does it help with making your software better? Let's get started.

REST API Best Practices - With Design Examples from Java and Spring Web Services

Designing Great REST API is important to have great microservices. How do you design your REST API? What are the best practices?

Designing REST API - What is Code First Approach?

Designing Great REST API is important to have great microservices. Code First approach focuses on generating the contract from code. Is it the best possible approach?