Thanks to visit codestin.com
Credit goes to github.com

Skip to content
/ IDDSI Public

Designed specifically for speech therapists from Chris Hani Baragwanath Hospital and their patients who are living with dysphagia. The app follows the internationally recognized IDDSI (International Dysphagia Diet Standardisation Initiative) framework.

License

JoTsav/IDDSI

Repository files navigation

IDDSI Authentication Microservice

A robust authentication microservice built with Spring Boot that provides secure user registration, email verification, and login functionality.

Architecture

This microservice follows a layered architecture pattern:

  • Presentation Layer: Thymeleaf templates for web interface
  • Service Layer: Business logic implementation
  • Repository Layer: Data access and persistence
  • Security Layer: Spring Security for authentication and authorization

Features

  • User registration with email verification
  • Secure login with Spring Security
  • Email notifications using MailDev for development
  • PostgreSQL database integration
  • Responsive web interface using Bootstrap
  • Protected dashboard for authenticated users

Technology Stack

  • Backend Framework: Spring Boot 6.2.6
  • Security: Spring Security 6.4.5
  • Database: PostgreSQL
  • Template Engine: Thymeleaf 3.1.3
  • Email Testing: MailDev
  • Frontend: Bootstrap 5.3.0
  • Build Tool: Maven

Prerequisites

  • Java 17 or higher
  • PostgreSQL 12 or higher
  • Maven 3.6 or higher
  • Node.js (for MailDev)

Installation

  1. Clone the repository:
git clone https://github.com/JoTsav/IDDSI.git
cd IDDSI
  1. Configure PostgreSQL:

    • Create a new database named IDDSI-registration
    • Update application.yml with your database credentials
  2. Install MailDev:

npm install -g maildev
  1. Build the application:
mvn clean install

Configuration

Database and Application Configuration

Update src/main/resources/application.yml with your settings:

server:
  port: 8081
  error:
    include-message: always
    include-binding-errors: always

spring:
  datasource:
    password: your_password
    url: jdbc:postgresql://localhost:5432/IDDSI-registration
    username: your_username
    driver-class-name: org.postgresql.Driver
  jpa:
    hibernate:
      ddl-auto: create-drop # don't persist data
    properties:
      hibernate:
        dialect: org.hibernate.dialect.PostgreSQLDialect
        format_sql: true
    show-sql: true

  mail:
    host: localhost
    port: 1025
    username: hey
    password: hey
    properties:
      mail:
        smtp:
          ssl:
            trust: "*"
          auth: true
          starttls:
            enable: true
          connection timeout: 5000
          timeout: 3000
          write timeout: 5000

Running the Application

  1. Start MailDev:
maildev
  1. Run the Spring Boot application:
mvn spring-boot:run

The application will be available at:

Running with Docker

If you don't have Java or PostgreSQL installed locally, you can run the application using Docker:

  1. Make sure you have Docker and Docker Compose installed on your system

  2. Build the application:

mvn clean package -DskipTests
  1. Start the containers:
docker-compose up --build

The application will be available at:

To stop the application:

docker-compose down

To stop the application and remove the database volume:

docker-compose down -v

Application Flow

  1. Home Page (Port 8081)

    • Landing page with sign-in option Home Page
  2. Registration

    • User registration form
    • Successful registration confirmation Registration Success
  3. Email Verification

    • Verification email sent via MailDev Email Verification
    • Email confirmation page Confirmation Page
  4. Login

    • Secure login form Login Form
  5. Dashboard

    • Protected dashboard for authenticated users Dashboard

Security Features

  • Password encryption using BCrypt
  • CSRF protection
  • Session management
  • Email verification for new registrations
  • Protected routes and resources

API Endpoints

  • POST /api/v1/registration - Register new user
  • GET /api/v1/registration/confirm - Confirm email token
  • POST /login - User authentication
  • POST /logout - User logout
  • GET /dashboard - Protected dashboard (requires authentication)

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Acknowledgments

  • MailDev for email testing capabilities
  • Spring Boot team for the excellent framework
  • Bootstrap team for the responsive UI components

Author

License

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

About

Designed specifically for speech therapists from Chris Hani Baragwanath Hospital and their patients who are living with dysphagia. The app follows the internationally recognized IDDSI (International Dysphagia Diet Standardisation Initiative) framework.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published