An open API service indexing awesome lists of open source software.

https://github.com/berkanserbes/smart-appointment-system

Smart, secure appointment management API built with Spring Boot, JWT, Redis, and PostgreSQL. Includes automated email reminders, role-based access, and admin reporting.
https://github.com/berkanserbes/smart-appointment-system

java java-security spring-boot

Last synced: about 9 hours ago
JSON representation

Smart, secure appointment management API built with Spring Boot, JWT, Redis, and PostgreSQL. Includes automated email reminders, role-based access, and admin reporting.

Awesome Lists containing this project

README

          

# ๐Ÿ“… Smart Appointment System

### A modern, secure, and scalable appointment management platform

[![Java](https://img.shields.io/badge/Java-25-ED8B00?style=for-the-badge&logo=openjdk&logoColor=white)](https://openjdk.org/)
[![Spring Boot](https://img.shields.io/badge/Spring%20Boot-3.5.10-6DB33F?style=for-the-badge&logo=spring&logoColor=white)](https://spring.io/projects/spring-boot)
[![PostgreSQL](https://img.shields.io/badge/PostgreSQL-316192?style=for-the-badge&logo=postgresql&logoColor=white)](https://www.postgresql.org/)
[![Redis](https://img.shields.io/badge/Redis-DC382D?style=for-the-badge&logo=redis&logoColor=white)](https://redis.io/)
[![Docker](https://img.shields.io/badge/Docker-2496ED?style=for-the-badge&logo=docker&logoColor=white)](https://www.docker.com/)
[![License](https://img.shields.io/badge/License-MIT-green.svg?style=for-the-badge)](LICENSE)

[Features](#-features) โ€ข [Quick Start](#-quick-start) โ€ข [Documentation](#-documentation) โ€ข [Tech Stack](#tech-stack) โ€ข [Contributing](#-contributing)

---

## ๐ŸŒŸ Features

### ๐Ÿ” Authentication & Security
- JWT-based authentication
- Role-based access control (USER/ADMIN)
- BCrypt password encryption
- Secure session management

### ๐Ÿ“Š Appointment Management
- Complete lifecycle management
- Conflict detection
- Status tracking (Scheduled, Confirmed, Completed, etc.)
- Time slot validation

### ๐Ÿš€ Performance & Scalability
- Redis caching layer with graceful fallback
- Scheduled background task processing
- Email notification delivery via SMTP
- Docker containerization

### ๐Ÿ“ Audit & Compliance
- Comprehensive audit logging
- User action tracking
- IP address recording
- Compliance-ready reports

### โœจ Additional Features

- ๐Ÿ‘ฅ **Service Provider Management** - Manage professionals and their services
- ๐Ÿ“ **Location Management** - Multiple location support
- ๐Ÿท๏ธ **Category System** - Organize appointments by type
- โญ **Feedback System** - Collect and manage user reviews
- ๐Ÿ“ง **Email Notifications** - Automated reminder system
- ๐Ÿ“ˆ **Reporting Dashboard** - Admin analytics and insights
- ๐Ÿ“– **API Documentation** - Interactive Swagger UI

---

## ๐Ÿš€ Quick Start

### Prerequisites

- Docker & Docker Compose
- Java 25 (for local development)
- Maven 3.9+ (for local development)

### ๐Ÿณ Run with Docker (Recommended)

```bash
# 1. Clone the repository
git clone https://github.com/yourusername/smart-appointment-system.git
cd smart-appointment-system

# 2. Setup environment
cp .env.example .env.development
# Edit .env.development with your configuration

# 3. Start all services
docker-compose --env-file .env.development up --build

# 4. Access the application
API: http://localhost:8080
Swagger UI: http://localhost:8080/swagger-ui.html
```

### ๐Ÿ’ป Local Development

```bash
# 1. Start PostgreSQL and Redis
docker-compose up postgres redis -d

# 2. Run the application
mvn spring-boot:run

# 3. Access Swagger UI
open http://localhost:8080/swagger-ui.html
```

---

## ๐Ÿ“š Documentation

| Document | Description |
|----------|-------------|
| ๐Ÿ“– [Architecture](docs/ARCHITECTURE.md) | System design and architecture patterns |
| ๐Ÿ—„๏ธ [Database Schema](docs/DATABASE_SCHEMA.md) | Complete database structure and relationships |
| ๐Ÿณ [Docker Guide](docs/DOCKER_GUIDE.md) | Docker setup and commands |
| โš™๏ธ [Environment Setup](docs/ENVIRONMENT_SETUP.md) | Configuration and environment variables |
| ๐Ÿค [Contributing](CONTRIBUTING.md) | How to contribute to the project |
---

## Tech Stack

### Backend Framework


Java
Spring Boot
Spring Security
Spring Data JPA

### Database & Cache


PostgreSQL
Redis
Hibernate

### Security & API


JWT
Swagger
OpenAPI

### DevOps & Tools


Docker
Maven
Git
Lombok

---

## ๐Ÿ—๏ธ Architecture

```
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ Client Applications โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
โ”‚ REST API
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ Controller Layer โ”‚
โ”‚ โ€ข Request validation โ”‚
โ”‚ โ€ข Response formatting โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
โ”‚ DTOs
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ Service Layer โ”‚
โ”‚ โ€ข Business logic โ”‚
โ”‚ โ€ข Transaction management โ”‚
โ”‚ โ€ข Authorization โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
โ”‚ Entities
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ Repository Layer โ”‚
โ”‚ โ€ข Data access โ”‚
โ”‚ โ€ข Query optimization โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
โ”‚
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ–ผ โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚PostgreSQLโ”‚ โ”‚ Redis โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
```

**Key Design Patterns:**
- ๐ŸŽฏ Repository Pattern
- ๐Ÿ”„ DTO Pattern
- ๐Ÿญ Service Layer Pattern
- ๐Ÿ—บ๏ธ Mapper Pattern
- ๐Ÿ”จ Builder Pattern

---

## ๐Ÿ“Š Project Structure

```
smart-appointment-system/
โ”œโ”€โ”€ ๐Ÿ“ src/main/java/com/smartappointment/
โ”‚ โ”œโ”€โ”€ ๐Ÿ”ง config/ # Configuration classes
โ”‚ โ”œโ”€โ”€ ๐ŸŽฎ controller/ # REST endpoints
โ”‚ โ”œโ”€โ”€ ๐Ÿ“ฆ dto/ # Data Transfer Objects
โ”‚ โ”œโ”€โ”€ โš ๏ธ exception/ # Custom exceptions
โ”‚ โ”œโ”€โ”€ ๐Ÿ—บ๏ธ mapper/ # Entity-DTO mappers
โ”‚ โ”œโ”€โ”€ ๐Ÿ“Š model/ # JPA entities & enums
โ”‚ โ”œโ”€โ”€ ๐Ÿ’พ repository/ # Data access layer
โ”‚ โ”œโ”€โ”€ ๐Ÿ” security/ # Security components
โ”‚ โ”œโ”€โ”€ ๐Ÿ’ผ service/ # Business logic
โ”‚ โ””โ”€โ”€ ๐Ÿ› ๏ธ util/ # Utility classes
โ”‚
โ”œโ”€โ”€ ๐Ÿ“ docs/ # Documentation
โ”‚ โ”œโ”€โ”€ ARCHITECTURE.md
โ”‚ โ”œโ”€โ”€ DATABASE_SCHEMA.md
โ”‚ โ”œโ”€โ”€ DOCKER_GUIDE.md
โ”‚ โ””โ”€โ”€ ENVIRONMENT_SETUP.md
โ”‚
โ”œโ”€โ”€ ๐Ÿณ docker-compose.yml # Docker orchestration
โ”œโ”€โ”€ ๐Ÿ“‹ Dockerfile # Application container
โ”œโ”€โ”€ ๐Ÿ“ pom.xml # Maven dependencies
โ””โ”€โ”€ ๐Ÿ“– README.md # You are here!
```

---

## ๐Ÿ”’ Security Features

- ๐Ÿ” **JWT Authentication** - Stateless token-based auth
- ๐Ÿ‘ค **Role-Based Access Control** - USER and ADMIN roles
- ๐Ÿ”‘ **Password Encryption** - BCrypt hashing
- ๐Ÿ›ก๏ธ **CORS Protection** - Configurable CORS policies
- ๐Ÿ“ **Audit Logging** - Complete action tracking
- ๐Ÿšซ **Input Validation** - Request validation with Bean Validation

---

## ๐ŸŽฏ API Endpoints

### ๐Ÿ”“ Public Endpoints
- `POST /api/auth/register` - User registration
- `POST /api/auth/login` - User login

### ๐Ÿ” Protected Endpoints
- `GET /api/appointments` - List appointments
- `POST /api/appointments` - Create appointment
- `GET /api/categories` - List categories
- `GET /api/providers` - List service providers
- `POST /api/feedback` - Submit feedback

### ๐Ÿ‘‘ Admin Only
- `GET /api/reports/dashboard` - Admin dashboard
- `POST /api/categories` - Create category
- `DELETE /api/appointments/{id}` - Delete appointment

**๐Ÿ“– Full API documentation available at:** `http://localhost:8080/swagger-ui.html`

---

## ๐Ÿงช Testing

```bash
# Run all tests
mvn test

# Run with coverage
mvn test jacoco:report

# Run specific test
mvn test -Dtest=AppointmentServiceTest
```

---

## ๐Ÿค Contributing

We welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details.

### Quick Contribution Steps

1. ๐Ÿด Fork the repository
2. ๐ŸŒฟ Create your feature branch (`git checkout -b feature/amazing-feature`)
3. โœ… Commit your changes (`git commit -m 'feat: add amazing feature'`)
4. ๐Ÿ“ค Push to the branch (`git push origin feature/amazing-feature`)
5. ๐ŸŽ‰ Open a Pull Request

---

## ๐Ÿ“ License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

---

### โญ Star this repository if you find it helpful!