Git Product home page Git Product logo

spring-boot-virtual-store-backend's Introduction

Virtual Store

Built Using Spring Boot (v3.1.5)


Dependencies

  • spring-boot-starter-web
  • spring-boot-starter-security
  • spring-boot-starter-data-jpa
  • spring-boot-starter-data-redis
  • jedis
  • spring-boot-starter-validation
  • spring-boot-starter-actuator
  • spring-boot-starter-test
  • jacoco-maven-plugin
  • spring-boot-devtools
  • postgresql
  • lombok
  • modelmapper
  • flyway-core
  • io.jsonwebtoken
  • javafaker
  • jobrunr-spring-boot-starter

Requires

  • JDK (Java 17+ )
  • Maven
  • PostgreSQL
  • Redis

Steps to setup project on local machine

Install JDK

On MacBook run

brew install openjdk

Verify Installation

java --version
openjdk 21 2023-09-19
OpenJDK Runtime Environment Homebrew (build 21)
OpenJDK 64-Bit Server VM Homebrew (build 21, mixed mode, sharing)

For windows click here

Install Maven

On MacBook run

brew install maven

Verify Installation

mvn -v
Apache Maven 3.9.5 (57804ffe001d7215b5e7bcb531cf83df38f93546)
Maven home: /opt/homebrew/Cellar/maven/3.9.5/libexec
Java version: 21, vendor: Homebrew, runtime: /opt/homebrew/Cellar/openjdk/21/libexec/openjdk.jdk/Contents/Home
Default locale: en_IN, platform encoding: UTF-8
OS name: "mac os x", version: "14.1.2", arch: "aarch64", family: "mac"

For windows click here

Install PostgreSQL

On MacBook run

brew install postgresql@14

Verify Installation

postgres --version
postgres (PostgreSQL) 14.10 (Homebrew)

Run PostgreSQL Server

brew services run postgresql@14

Interact via Command Line Interface

psql

Create a Database with owner without password

CREATE DATABASE vstore OWNER [NAME_OF_OWNER];

Verify Database Creation

\l
                         List of databases
   Name    | Owner | Encoding | Collate | Ctype | Access privileges
-----------+-------+----------+---------+-------+-------------------
 aziz      | aziz  | UTF8     | C       | C     |
 postgres  | aziz  | UTF8     | C       | C     |
 template0 | aziz  | UTF8     | C       | C     | =c/aziz          +
           |       |          |         |       | aziz=CTc/aziz
 template1 | aziz  | UTF8     | C       | C     | =c/aziz          +
           |       |          |         |       | aziz=CTc/aziz
 vstore    | aziz  | UTF8     | C       | C     |
(5 rows)

Stop PostgreSQL Server

brew services stop postgresql@14

For windows click here

Install pgadmin4

On MacBook run

brew install --cask pgadmin4

Verify Installation

brew info pgadmin4
==> pgadmin4: 8.0
https://www.pgadmin.org/
/opt/homebrew/Caskroom/pgadmin4/8.0 (123B)
From: https://github.com/Homebrew/homebrew-cask/blob/HEAD/Casks/p/pgadmin4.rb
==> Name
pgAdmin4
==> Description
Administration and development platform for PostgreSQL
==> Artifacts
pgAdmin 4.app (App)
==> Analytics
install: 3,447 (30 days), 10,351 (90 days), 26,894 (365 days)

For windows click here

Install Redis

On MacBook run

brew install redis

Verify Installation

redis-server --version
Redis server v=7.2.3 sha=00000000:0 malloc=libc bits=64 build=96f23777753ded6c

Run Redis Server

brew services run redis

Run in Foreground

redis-server

Interact via Command Line Interface

redis-cli

Stop Redis Server

brew services stop redis

For windows click here

Verify PostgreSQL and Redis server is running

brew services list
Name          Status       User File
postgresql@14 started      /opt/homebrew/opt/postgresql@14/[email protected]
redis         started      /opt/homebrew/opt/redis/homebrew.mxcl.redis.plist

Install Postman

On MacBook run

brew install --cask postman

Verify Installation

brew info postman
==> postman: 10.20.0 (auto_updates)
https://www.postman.com/
/opt/homebrew/Caskroom/postman/10.20.0 (121B)
From: https://github.com/Homebrew/homebrew-cask/blob/HEAD/Casks/p/postman.rb
==> Name
Postman
==> Description
Collaboration platform for API development
==> Artifacts
Postman.app (App)
==> Analytics
install: 9,790 (30 days), 33,057 (90 days), 91,105 (365 days)

For windows click here

Postman Collection

Click here to download

Install Eclipse IDE

On MacBook run

brew install --cask eclipse-java

For windows click here

Verify Installation

brew info eclipse-java
==> eclipse-java: 4.30.0,2023-12
https://eclipse.org/
/opt/homebrew/Caskroom/eclipse-java/4.30.0,2023-12 (126B)
From: https://github.com/Homebrew/homebrew-cask/blob/HEAD/Casks/e/eclipse-java.rb
==> Name
Eclipse IDE for Java Developers
==> Description
Eclipse IDE for Java developers
==> Artifacts
Eclipse.app -> Eclipse Java.app (App)
==> Analytics
install: 616 (30 days), 2,171 (90 days), 6,540 (365 days)

Note: Make sure to configure installed JDK with Eclipse IDE

Install Lombok into Eclipse IDE

  1. Download lombok.jar from https://projectlombok.org/download

  2. Navigate to lombok.jar location and run java -jar lombok.jar

  3. This starts the eclipse installer which will find eclipse (and eclipse variants as listed above), and offers to install lombok into these eclipse installations. The same tool can also uninstall lombok.

https://projectlombok.org/setup/eclipse


Configure Application Properties

Datasource

spring.datasource.url=jdbc:postgresql://localhost:5432/vstore 
spring.datasource.username=[username]
spring.datasource.password=[password]

Default Port: 5432
Database Name: vstore
Note: Replace username and password with your database specific values

Redis

spring.data.redis.host=localhost
spring.data.redis.port=6379

Default Port: 6379
Host: localhost


Run Tests

mvn clean
mvn test

Note: Make sure database is empty

Run Project

mvn spring-boot:run

Package Project

mvn clean package spring-boot:repackage

Actuator Endpoints

Click here to access


JobRunr Dashboard

Click here to access


spring-boot-virtual-store-backend's People

Contributors

iamazizbohra avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.