Skip to content

Latest commit

Β 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

CRM Management System

A comprehensive Customer Relationship Management (CRM) system built with Spring Boot 3.2, featuring advanced contact management, OAuth2 authentication, and a modern web interface.

Spring Boot Java License Status

πŸ“‹ Table of Contents


✨ Features

πŸ” User Management

  • User Registration - Self-registration with email verification
  • OAuth2 Authentication - Login via Google and GitHub
  • User Profiles - Customizable user profiles with profile pictures
  • Role-Based Access Control - USER and ADMIN roles
  • Password Encryption - Secure password storage with encryption

πŸ“‡ Contact Management (Core)

  • Add Contacts - Create and store customer information
  • View Contacts - Display all contacts with pagination
  • Edit Contacts - Update contact details anytime
  • Delete Contacts - Remove contacts from database
  • Search & Filter - Find contacts by name, email, or phone
  • Favorite Marking - Mark important contacts as favorites
  • Social Links - Store LinkedIn and website profiles
  • Contact Pictures - Upload and store contact photos

🎨 User Interface

  • Responsive Design - Works on desktop, tablet, and mobile
  • Intuitive Navigation - Easy-to-use dashboard and menus
  • Real-time Feedback - Toast notifications and success messages
  • Pagination - View contacts in organized pages

βš™οΈ Technical Features

  • RESTful APIs - Full REST API support for all operations
  • Pagination & Sorting - Efficient data retrieval
  • Search Functionality - Advanced contact search
  • Image Upload - Cloudinary integration for image hosting
  • Email Support - Email notifications and verification
  • H2 Database - In-memory database for development
  • Swagger UI - Interactive API documentation

πŸ› οΈ Tech Stack

Backend

  • Framework - Spring Boot 3.2.5
  • Language - Java 17
  • ORM - Hibernate 6.4 + Spring Data JPA
  • Security - Spring Security 3.2.5 + OAuth2
  • Build Tool - Maven 3.9.6
  • Server - Apache Tomcat (Embedded)

Database

  • Primary - MySQL (Production)
  • Development - H2 In-Memory Database
  • Connection Pool - HikariCP

Frontend

  • Template Engine - Thymeleaf 3.1
  • Styling - CSS3
  • JavaScript - Vanilla JS
  • Responsive - Mobile-first design

Additional Services

  • Image Hosting - Cloudinary API
  • Email Service - Spring Mail + SMTP
  • Authentication - Google OAuth2 + GitHub OAuth2
  • API Documentation - Springdoc-OpenAPI (Swagger)

πŸš€ Installation & Setup

Prerequisites

Step 1: Clone the Repository

git clone https://github.com/yourusername/CRM-Management-System.git
cd CRM-Management-System/CRM2Feb-master

Step 2: Configure Database

For Development (H2 - In-Memory)

The application is pre-configured with H2 database. No setup needed!

For Production (MySQL)

  1. Create database:
CREATE DATABASE crm_db CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
  1. Update src/main/resources/application-prod.properties:
spring.datasource.url=jdbc:mysql://localhost:3306/crm_db
spring.datasource.username=root
spring.datasource.password=yourpassword
spring.jpa.hibernate.ddl-auto=update
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver

Step 3: Configure OAuth2 (Optional)

Google OAuth2

  1. Go to Google Cloud Console
  2. Create OAuth2 credentials
  3. Update application-dev.properties:
spring.security.oauth2.client.registration.google.client-id=YOUR_CLIENT_ID
spring.security.oauth2.client.registration.google.client-secret=YOUR_CLIENT_SECRET

GitHub OAuth2

  1. Go to GitHub Settings β†’ Developer settings β†’ OAuth Apps
  2. Create new OAuth app
  3. Update application-dev.properties:
spring.security.oauth2.client.registration.github.client-id=YOUR_CLIENT_ID
spring.security.oauth2.client.registration.github.client-secret=YOUR_CLIENT_SECRET

Step 4: Configure Cloudinary (Image Upload)

  1. Create account at Cloudinary.com
  2. Get API credentials
  3. Update application-dev.properties:
cloudinary.cloud.name=YOUR_CLOUD_NAME
cloudinary.api.key=YOUR_API_KEY
cloudinary.api.secret=YOUR_API_SECRET

Step 5: Build and Run

# Build the project
mvn clean install

# Run the application (Development)
mvn spring-boot:run

# Run with production profile
mvn spring-boot:run -Dspring-boot.run.arguments="--spring.profiles.active=prod"

The application will start at http://localhost:8081

πŸ’» Usage Guide

1. Register a New User

  1. Navigate to /register
  2. Fill in the form with:
    • Full Name
    • Email
    • Password
    • Phone Number (optional)
  3. Click "Register"
  4. Verify email (if enabled)

2. Login

  1. Go to /login
  2. Enter email and password
  3. Or use "Login with Google/GitHub"

3. Add a Contact

  1. Go to Dashboard β†’ "Add Contact"
  2. Fill in contact details:
    • Name *
    • Email *
    • Phone Number
    • Address
    • Description
    • LinkedIn/Website links
    • Upload photo
    • Mark as favorite
  3. Click "Save Contact"

4. View Contacts

  1. Go to Dashboard β†’ "My Contacts"
  2. View all your contacts with pagination
  3. Sort by name, email, or phone
  4. Click contact to view details

5. Search Contacts

  1. Use search bar on contacts page
  2. Search by name, email, or phone
  3. Results update in real-time

6. Edit Contact

  1. Navigate to contact details
  2. Click "Edit"
  3. Modify information
  4. Save changes

7. Delete Contact

  1. Go to contacts list
  2. Find contact
  3. Click "Delete"
  4. Confirm deletion

πŸ—οΈ Architecture

Layered Architecture Pattern

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚      Web Layer (Thymeleaf)          β”‚  Templates, HTML, CSS, JS
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚    Controller Layer (REST)          β”‚  HTTP requests/responses
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚    Service Layer (Business Logic)   β”‚  Validation, processing
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚    Repository Layer (Data Access)   β”‚  Database queries
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚    Database Layer (H2/MySQL)        β”‚  Data persistence
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Request Flow

1. User Request (Browser)
   ↓
2. Controller receives request
   ↓
3. Service processes business logic
   ↓
4. Repository queries database
   ↓
5. Entity mapped to response
   ↓
6. Thymeleaf renders view
   ↓
7. Response sent to browser

πŸ”‘ Key Components

Entities (Database Models)

  • User - System users with authentication
  • Contact - Customer/Lead information
  • SocialLink - Social media links for contacts
  • Providers - OAuth provider enum

Services

  • UserService - User CRUD operations
  • ContactService - Contact management
  • EmailService - Email notifications
  • ImageService - Image upload/management

Repositories (Data Access)

  • UserRepository - Custom user queries
  • ContactRepository - Custom contact queries

Security

  • SecurityConfig - Spring Security setup
  • OAuthAuthenticationSuccessHandler - OAuth2 handler
  • AuthFailureHandler - Auth failure logic

πŸ” Security Features

βœ… Password Encryption - Bcrypt hashing βœ… OAuth2 Support - Google & GitHub login βœ… CSRF Protection - Cross-site request forgery prevention βœ… Session Management - Secure session handling βœ… User Authentication - Spring Security integration βœ… Authorization - Role-based access control βœ… Email Verification - Secure email confirmation βœ… Data Validation - Input validation & sanitization


🀝 Contributing

Contributions are welcome! Please follow these steps:

  1. Fork the repository
  2. Create a 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

Code Standards

  • Follow Google Java Style Guide
  • Write meaningful commit messages
  • Add comments for complex logic
  • Write unit tests for new features
  • Update documentation

About

No description, website, or topics provided.

Resources

Contributing

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages