Skip to content

BraianS/fullstack-spring-boot-and-angular-blog

Repository files navigation

Spring Blog

Full Stack Blog to create your own blog

Getting Started

To test this project you can either use Docker to install everything or install Angular, Java and MySql on your machine to run this project.

Prerequisites

  • Docker
  • Mysql
  • Java 11
  • Angular CLI: 17.1.1.

Installing

  • Clone this project repository
  • Install Mysql
  • Install Java 11 (This project I used AdoptOpenJdk)
  • Install Angular CLI: 17.1.1
    • Run npm install -g @angular/cli to install Globally or npm install @angular/cli to install locally. To install Install Specific Version (Example: 17.1.1) npm install -g @angular/[email protected].

Run Spring Blog Server

  • cd spring-blog-backend && mvnw spring-boot:run

Run Spring Blog Client with proxy to api Spring Blog Backend

  • cd spring-blog-client && npm start
Open the url http://localhost:4200
user:brian123
password:brian123

Running the tests

Open a url above to see the Swagger documentation

  • http://localhost:8080/swagger-ui/index.html
  • Run endpoint to generate token auth-controller -> /api/auth/signin
  • Copy the token from accessToken without quotation marks
  • In Authorize put name Bearer with space and your token copied.
  • Now you can save, delete and update everything

Authorize

Deployment

Instructions how to install Docker on Ubuntu, Windows, Mac.

How to run it?

Run this command in a terminal:

  • In spring-boot-backend change the mysql password to what you use spring.datasource.username=root spring.datasource.password=CHANGE just to run spring boot with the code below and create the jar
  • cd spring-blog-backend && mvnw spring-boot:install to generate jar file in destination folder
  • docker-compose up --build - Build and start the containers.
  • docker-machine ip default - Get docker host ip address.
  • To access use http://localhost:4200/ or http://<docker host ip address>:4200/

Built With

spring-blog-frontend

spring-blog-backend

  • Java 11
  • Mysql
  • Spring Data Rest
  • jjwt:0.9.1
  • lombok
  • spring-boot-starter-parent: 2.5.2
  • spring-boot-starter-security
  • spring-boot-starter-web
  • spring-boot-starter-validation
  • spring-boot-devtools
  • jackson-datatype-jsr310
  • spring-boot-starter-data-jpa
  • h2-database

Features

  • Authentication using JWT in Spring Boot.

  • Admin can save,update or delete Tags and Categories

  • User can create Posts, select Tags and Categories

  • Edit your name, email and password

  • Delete your account

  • To do delombok use this command in folder kanban-spring-backend mvnw lombok:delombok -Pdlombok

    • The output will be \target\generated-sources\delombok\

Contributing

  1. Clone this repository
  2. Make a new branch
  3. Commit and push your changes
  4. Create a Pull Request

Authors

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Copyright (c) 2021 Braian Silva

Acknowledgments