Skip to content

MurilloMarquesSantos/Clinic-System-Api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

55 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Clinic System Api

This application was built to streamline appointment scheduling for clinics, making it simple for users to book consultations, check available doctors and their specialties, and view open time slots, and email sending for confirmation. Users can easily make, view, and cancel bookings, while system administrators have access to monitoring tools for system health and performance metrics

Features:

  • User Authentication: Secure registration and login using Spring Security.
  • Password Management: Change passwords via secure email links.
  • Oauth2 with JWT: Provides robust security and stateless authentication.
  • Role-based authorization: Access control based on roles (ADMIN, USER, DOCTOR).
  • Error handling: Detailed exception handling for clear API responses.
  • API documentation: Interactive Swagger UI for endpoint testing.
  • Monitoring Tools:
  • Prometheus: Collect metrics for performance analysis.
  • Grafana Dashboards: Visualize system metrics with preconfigured templates.

Technologies

  • Spring Boot 3.3
  • Spring Security 6.3
  • Spring Data
  • Oauth2
  • JavaMail
  • Maven
  • Swagger
  • Prometheus
  • Grafana

Requirements

  • Java 17
  • Docker (recommended) or MySQL

Getting Started

To run the application firstly, you need to manually add roles into the database:

  • Run in the terminal: docker-compose up
  • Once you have access to the database, add the roles:
    1. Id: 1, ROLE : ADMIN
    2. Id: 2, ROLE : USER
    3. Id: 3, ROLE : DOCTOR

    There is a class InitialConfig in "config" made for tests only. This class on running the Api will add some info to the database

    Running Tests

    • To run unit tests: mvn test

    JavaMail

    If you have any kind of problem with the email config, this YouTube video can help you fix it JavaMail Video

    Usage

    Swagger API Documentation

    To view the API documentation, run the application and navigate to:
    http://localhost:8080/swagger-ui.html
    All endpoints include detailed summaries and descriptions and the body in JSON format as well.

    Prometheus Monitoring

    Prometheus can be accessed at:
    http://localhost:9090/

    Grafana Dashboards

    To view metrics in Grafana:

    1. Run the application.
    2. Navigate to http://localhost:3000 (default Grafana URL).
    3. Create a new data source using Prometheus with this URL: http://prometheus:9090.
    4. A recommended dashboard is JVM (Micrometer), which provides detailed JVM and application metrics.

    Actuator Endpoints

    • /actuator/info – Basic application information
    • /actuator/metrics – Application metrics
    • /actuator/health – Health status
    • /actuator/prometheus – Prometheus metrics endpoint

    About

    This application was built to streamline appointment scheduling for clinics, making it simple for users to book consultations, check available doctors and their specialties, and view open time slots, and email sending for confirmation. Users can easily make, view, and cancel bookings.

    Resources

    Stars

    Watchers

    Forks

    Releases

    No releases published

    Packages

     
     
     

    Contributors

    Languages