Skip to content

Koorbik/Glamour-Studio

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

115 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Glamour Studio - Makeup Artist Booking System πŸ’„βœ¨

A full-stack web application for booking makeup artist appointments, featuring user authentication, appointment management, Google Calendar integration, and admin dashboard functionality.

πŸ“‹ Project Overview

Glamour Studio is a modern, responsive booking system designed for makeup artists and their clients. The application provides a seamless experience for customers to browse services, book appointments, and manage their bookings, while giving administrators powerful tools to manage their business.

πŸš€ Tech Stack

Backend

  • Java 21 with Spring Boot 3.4.5
  • Spring Security with JWT authentication
  • Spring Data JPA for data persistence
  • H2 Database (in-memory) for development, PostgreSQL for production
  • OAuth2 integration (Google Authentication)
  • Google Calendar API for appointment synchronization
  • Spring Mail for email notifications
  • Maven for dependency management

Frontend

  • Angular 20 with TypeScript
  • Angular Material for UI components
  • RxJS for reactive programming
  • JWT handling for authentication
  • Responsive design with SCSS

DevOps & Tools

  • Docker & Docker Compose for containerization
  • Git version control

🎯 Features Implemented

πŸ” Authentication & User Management

  • User registration with email verification
  • Traditional login/logout functionality
  • Google OAuth integration
  • Role-based access control (USER/ADMIN)
  • JWT token management
  • Password encryption with BCrypt
  • User profile management

πŸ’³ Payment & Invoicing

  • PayU payment gateway integration
  • Secure payment order creation
  • Webhook notifications with MD5 signature verification
  • Payment status tracking (PENDING, COMPLETED, CANCELED)
  • Automatic payment confirmation
  • Automatic invoice generation and download (Zoho Books)
  • Integration with appointment system

πŸ”” Notifications

  • SMS notifications
  • Email notifications
  • Notification preferences

πŸ“… Appointment System

  • Service browsing and selection
  • Available time slot viewing
  • Appointment booking
  • Appointment status tracking (PENDING, CONFIRMED, COMPLETED, CANCELLED)
  • Appointment cancellation and rescheduling
  • Admin appointment management

πŸ—“οΈ Google Calendar Integration

  • OAuth2 flow for Google Calendar access
  • Automatic calendar event creation
  • Calendar synchronization
  • Token management and refresh

πŸ‘¨β€πŸ’Ό Admin Dashboard

  • Appointment overview and management
  • User management
  • Service management
  • Availability slot configuration
  • Admin-only access controls

🎨 User Interface

  • Professional landing page with portfolio showcase
  • Responsive design for all devices
  • Material Design components
  • Interactive forms with validation
  • Modern, accessible UI/UX
  • Error handling and user feedback

πŸ”§ Technical Features

  • RESTful API architecture
  • Database migrations and seeding
  • Environment-based configuration
  • CORS configuration for frontend-backend communication
  • Request/response validation
  • Comprehensive error handling

πŸ“ Project Structure

IWA/
β”œβ”€β”€ iwa_backend/                 # Spring Boot backend
β”‚   β”œβ”€β”€ src/main/java/com/hszadkowski/iwa_backend/
β”‚   β”‚   β”œβ”€β”€ config/             # Security, CORS, JWT configuration
β”‚   β”‚   β”œβ”€β”€ controllers/        # REST API endpoints
β”‚   β”‚   β”œβ”€β”€ dto/                # Data Transfer Objects
β”‚   β”‚   β”œβ”€β”€ exceptions/         # Custom exception handling
β”‚   β”‚   β”œβ”€β”€ models/            # JPA entities
β”‚   β”‚   β”œβ”€β”€ repos/             # Repository interfaces
β”‚   β”‚   └── services/          # Business logic services
β”‚   β”œβ”€β”€ src/main/resources/
β”‚   β”‚   β”œβ”€β”€ application*.properties  # Environment configs
β”‚   β”‚   └── data.sql           # Database seeding
β”‚   └── pom.xml                # Maven dependencies
β”œβ”€β”€ iwa-frontend/               # Angular frontend
β”‚   β”œβ”€β”€ src/app/
β”‚   β”‚   β”œβ”€β”€ components/        # Angular components
β”‚   β”‚   β”œβ”€β”€ guards/           # Route guards
β”‚   β”‚   β”œβ”€β”€ interfaces/       # TypeScript interfaces
β”‚   β”‚   β”œβ”€β”€ services/         # Angular services
β”‚   β”‚   └── utils/           # Utility functions
β”‚   └── package.json          # npm dependencies
β”œβ”€β”€ db/                        # Database Docker configuration
β”œβ”€β”€ docker-compose.yml         # Multi-container setup
└── user-stories.md           # Project requirements

πŸš€ Getting Started

Prerequisites

  • Java 21
  • Node.js 18+
  • Maven (or use the included wrapper)
  • ngrok (required for PayU webhook functionality) - Download here

πŸš€ Quick Start (Recommended: Docker)

The recommended way to run the application is using Docker Compose, which sets up PostgreSQL database and all services automatically.

  1. Clone the repository

    git clone <repository-url>
    cd IWA
  2. Configure environment variables

    Copy the example environment file:

    cp .env.docker.example .env.docker

    Edit .env.docker file with your configuration. See the Configuration section below for detailed setup instructions.

  3. Start the application with Docker

    docker-compose up --build

    πŸ’‘ This will start PostgreSQL database, backend, and frontend in containers.

  4. Expose backend with ngrok (REQUIRED for PayU webhooks) (in a new terminal)

    ngrok http 8080

    ⚠️ Important: Copy the HTTPS forwarding URL (e.g., https://abc123.ngrok-free.app) and update your PAYU_NOTIFY_URL in the .env.docker file:

    PAYU_NOTIFY_URL=https://your-ngrok-url.ngrok-free.app/api/payments/notify
    

    Then restart the containers:

    docker-compose down
    docker-compose up

    πŸ’‘ Why ngrok? PayU sends payment notifications (webhooks) to your backend. Since PayU servers need to reach your local machine, ngrok creates a secure tunnel to expose your localhost:8080 to the internet.

  5. Access the application

  6. Stop the application

    docker-compose down

πŸ”§ Alternative: Local Development (Without Docker)

If you prefer to run the backend locally without Docker (uses H2 in-memory database):

  1. Set the application profile to local

    Edit iwa_backend/src/main/resources/application.properties and ensure the active profile is set to local:

    spring.profiles.active=local
  2. Configure environment variables

    Create iwa_backend/.env file with your configuration. See the Configuration section below for detailed setup instructions.

  3. Start the backend

    cd iwa_backend
    ./mvnw spring-boot:run

    πŸ’‘ The backend uses H2 in-memory database with local profile - no external database setup needed!

  4. Expose backend with ngrok (REQUIRED for PayU webhooks) (in a new terminal)

    ngrok http 8080

    Update your PAYU_NOTIFY_URL in the .env file and restart the backend.

  5. Start the frontend (in a new terminal)

    cd iwa-frontend
    npm install  # First time only
    ng serve
  6. Access the application

πŸ‘€ Default Users

The application comes with pre-seeded users for testing:

Email Password Role
alice@acme.com admin123 ADMIN
bob@acme.com user123 USER

πŸ”§ Configuration

Backend Configuration

The backend supports two profiles:

  • local - Uses H2 in-memory database (for local development without Docker)
  • dev - Uses PostgreSQL database (for Docker deployment)

Docker Deployment (PostgreSQL) - RECOMMENDED

Docker uses profile dev with PostgreSQL database.

Copy the example environment file and edit it:

cp .env.docker.example .env.docker

Then configure .env.docker with your values:

# Database Configuration
POSTGRES_USER=user
POSTGRES_PASSWORD=your_secure_password
POSTGRES_DB=service_db

# JWT (REQUIRED)
JWT_SECRET_KEY=your_secret_key_here
JWT_EXPIRATION=86400000

# Email (REQUIRED)
SUPPORT_EMAIL=your_email@gmail.com
APP_PASSWORD=your_gmail_app_password

OR

# Mail Gun Email (REQUIRED IF YOU WANT TO USE MAILGUN)
MAILGUN_HOSTNAME=smtp.mailgun.org
MAILGUN_PORT=587
MAILGUN_LOGIN=
MAILGUN_PASSWORD=

# Google Calendar OAuth (optional)
GOOGLE_CALENDAR_CLIENT_ID=your_client_id
GOOGLE_CALENDAR_SECRET=your_client_secret
GOOGLE_AUTH_CLIENT_ID=your_auth_client_id
GOOGLE_AUTH_FRONTEND_CLIENT_ID=your_frontend_client_id

# PayU Configuration (REQUIRED for payments)
PAYU_BASE_URL=https://secure.snd.payu.com
PAYU_OAUTH_CLIENT_ID=your_payu_client_id
PAYU_OAUTH_CLIENT_SECRET=your_payu_client_secret
PAYU_POS_ID=your_payu_pos_id
PAYU_SECOND_KEY_MD5=your_payu_second_key

# Zoho Invoicing Service
ZOHO_CLIENT_ID=
ZOHO_CLIENT_SECRET=
ZOHO_REFRESH_TOKEN=
ZOHO_ORGANIZATION_ID=
ZOHO_API_BASE_URL=https://www.zohoapis.eu/invoice/v3
ZOHO_AUTH_URL=https://accounts.zoho.eu/oauth/v2/token
ZOHO_GENERIC_CUSTOMER_ID=

# Twilio SMS Service (REQUIRED FOR SMS NOTIFICATIONS)
TWILIO_ACCOUNT_SID=
TWILIO_AUTH_TOKEN=
TWILIO_PHONE_NUMBER=

# ⚠️ IMPORTANT: Use ngrok HTTPS URL here, NOT localhost!
# Run: ngrok http 8080
# Then copy the HTTPS URL (e.g., https://abc123.ngrok-free.app)
PAYU_NOTIFY_URL=https://your-ngrok-url.ngrok-free.app/api/payments/notify

⚠️ Critical for PayU Webhooks: The PAYU_NOTIFY_URL MUST be a publicly accessible HTTPS URL. Run ngrok http 8080 to create a tunnel and use the provided HTTPS URL.

Local Development (H2 Database) - ALTERNATIVE

The backend uses profile local when running locally without Docker.

Create iwa_backend/.env file with:

# JWT (REQUIRED)
JWT_SECRET_KEY=your_secret_key_here
JWT_EXPIRATION=86400000

# Email (REQUIRED)
SUPPORT_EMAIL=your_email@gmail.com
APP_PASSWORD=your_gmail_app_password

OR

# Mail Gun Email (REQUIRED IF YOU WANT TO USE MAILGUN)
MAILGUN_HOSTNAME=smtp.mailgun.org
MAILGUN_PORT=587
MAILGUN_LOGIN=
MAILGUN_PASSWORD=

# Google Calendar OAuth (optional)
GOOGLE_CALENDAR_CLIENT_ID=your_client_id
GOOGLE_CALENDAR_SECRET=your_client_secret
GOOGLE_AUTH_CLIENT_ID=your_auth_client_id
GOOGLE_AUTH_FRONTEND_CLIENT_ID=your_frontend_client_id

# PayU Configuration (REQUIRED for payments)
PAYU_BASE_URL=https://secure.snd.payu.com
PAYU_OAUTH_CLIENT_ID=your_payu_client_id
PAYU_OAUTH_CLIENT_SECRET=your_payu_client_secret
PAYU_POS_ID=your_payu_pos_id
PAYU_SECOND_KEY_MD5=your_payu_second_key

# Zoho Invoicing Service
ZOHO_CLIENT_ID=
ZOHO_CLIENT_SECRET=
ZOHO_REFRESH_TOKEN=
ZOHO_ORGANIZATION_ID=
ZOHO_API_BASE_URL=https://www.zohoapis.eu/invoice/v3
ZOHO_AUTH_URL=https://accounts.zoho.eu/oauth/v2/token
ZOHO_GENERIC_CUSTOMER_ID=

# Twilio SMS Service (REQUIRED FOR SMS NOTIFICATIONS)
TWILIO_ACCOUNT_SID=
TWILIO_AUTH_TOKEN=
TWILIO_PHONE_NUMBER=

# ⚠️ IMPORTANT: Use ngrok HTTPS URL here, NOT localhost!
# Run: ngrok http 8080
# Then copy the HTTPS URL (e.g., https://abc123.ngrok-free.app)
PAYU_NOTIFY_URL=https://your-ngrok-url.ngrok-free.app/api/payments/notify

⚠️ Critical for PayU Webhooks: The PAYU_NOTIFY_URL MUST be a publicly accessible HTTPS URL. Run ngrok http 8080 to create a tunnel and use the provided HTTPS URL.

πŸ’‘ Note: H2 is an in-memory database, so all data is lost when the application stops. For persistent data, use Docker with PostgreSQL.

Frontend Configuration

Environment settings in iwa-frontend/src/environments/:

  • API endpoints
  • Google OAuth client ID
  • Production/development flags

🎯 Future Enhancements

πŸ“Š Analytics & Reporting

  • Business analytics dashboard
  • Revenue tracking
  • Customer insights
  • Appointment statistics
  • Performance metrics

🎨 Enhanced Features

  • Photo portfolio management system
  • Before/after photo uploads
  • Customer review system
  • Multi-language support
  • Dark/light theme toggle

πŸ” Advanced Security

  • Two-factor authentication (2FA)
  • Rate limiting
  • Advanced user permissions
  • Audit logging

πŸ€– AI/ML Features

  • Smart appointment scheduling
  • Personalized service recommendations
  • Automated customer support chatbot
  • Demand forecasting

🀝 Contributing

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

πŸ› Issues & Bug Reports

Found a bug or have a feature request? We'd love to hear from you!

πŸ” Before Reporting an Issue

  • Check if the issue already exists in our Issues section
  • Make sure you're using the latest version of the application
  • Try to reproduce the issue with minimal steps

πŸ“ How to Report an Issue

  1. Go to the Issues page
  2. Click "New Issue"

πŸ’¬ Need Help?

  • Search existing issues for similar problems
  • For urgent issues, mention @Koorbik in your issue

πŸ“ License

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

πŸ‘¨β€πŸ’» Development Team

  • Hubert Szadkowski (Koorbik) - Full Stack Developer

About

Modern, responsive booking system designed for makeup artists and their clients. The application provides a seamless experience for customers to browse services, book appointments, and manage their bookings, while giving administrators powerful tools to manage their business.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors