Skip to content
/ TheBasic Public template

A Spring boot user authentication boilerplate with S3 Image upload

License

Notifications You must be signed in to change notification settings

313hemant313/TheBasic

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TheBasic- A Spring boot user authentication boilerplate with S3 Image upload.

alt text

TheBasic uses a number of projects to work properly:

  • Spring Boot - Open source Java-based framework
  • Maven Maven is a powerful project management tool that is based on POM (project object model)
  • MySQL - Open-source relational database management system.
  • AWS S3 - Amazon Simple Storage Service (Amazon S3) is an object storage service [Used for storing images].
  • JJWT - JSON Web Token Support For The JVM
  • Hibernate - More than an ORM
  • HikariCP - HikariCP is a "zero-overhead" production ready JDBC connection pool
  • Postman Simplify each step of building an API and streamline collaboration so you can create better APIs

Prerequisites

The following items should be installed in your system:

Exposed Rest Endpoints

Feature Route
User registration with ROLE_USER [ /api/account/register ]
User login [ /api/account/login ]
User token refresh [ /api/account/token/refresh ]
User logout [ /api/account/logout ]
User profile picture or some image upload [ /api/images/upload ]
Get user details [ /api/user/get ]
Update user password [ /api/user/update/password ]
Update user details [ /api/user/update/details ]

Database configuration

The application needs mysql database. Before running make sure you have added database config in src/main/resources/application.yaml

spring:             
  datasource:
    url: jdbc:mysql://sql12.freemysqlhosting.net:3306/sql12347916?useSSL=false&serverTimezone=UTC&useLegacyDatetimeCode=false&useSSL=false&createDatabaseIfNotExist=true
    username: thebasicuser
    password: wrongpassword

For testing you can create some free online mysql db instance from websites like https://www.freemysqlhosting.net/

AWS S3 configuration

In src/main/resources/application.yaml, Please add properties under 'amazonProperties'

amazonProperties:
  endpointUrl: https://s3.us-east-2.amazonaws.com
  accessKey: HEMANT-THEBASIC
  secretKey: YES-ITS-DUMMY
  bucketName: www.hemantdemo.com

JWT configuration

Source src/main/resources/application.yaml

webapp:
  auth:
    tokenSecret: 926D96C90030DTHEBASICYA581BDBBC
    tokenExpirationMsec: 86400000

Database connection pooling configuration [HikariCP]

Source src/main/resources/application.yaml

    hikari:
      minimumIdle: 5
      maximumPoolSize: 15
      connectionTimeout: 30000
      idleTimeout: 600000
      maxLifetime: 1800000

To Run

./mvnw spring-boot:run

To Build

./mvnw clean install

Also you can checkout examples in the postman-examples directory.

About

A Spring boot user authentication boilerplate with S3 Image upload

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages