A comprehensive Customer Relationship Management (CRM) system built with Spring Boot 3.2, featuring advanced contact management, OAuth2 authentication, and a modern web interface.
- Features
- Tech Stack
- Project Structure
- Installation & Setup
- API Endpoints
- Usage Guide
- Architecture
- Key Components
- Security
- Future Enhancements
- Contributing
- License
- 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
- 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
- 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
- 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
- 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)
- Primary - MySQL (Production)
- Development - H2 In-Memory Database
- Connection Pool - HikariCP
- Template Engine - Thymeleaf 3.1
- Styling - CSS3
- JavaScript - Vanilla JS
- Responsive - Mobile-first design
- Image Hosting - Cloudinary API
- Email Service - Spring Mail + SMTP
- Authentication - Google OAuth2 + GitHub OAuth2
- API Documentation - Springdoc-OpenAPI (Swagger)
- Java 17+ - Download here
- Maven 3.6+ - Download here
- MySQL 5.7+ (for production) - Download here
- Git - Download here
git clone https://github.com/yourusername/CRM-Management-System.git
cd CRM-Management-System/CRM2Feb-masterThe application is pre-configured with H2 database. No setup needed!
- Create database:
CREATE DATABASE crm_db CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;- 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- Go to Google Cloud Console
- Create OAuth2 credentials
- 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- Go to GitHub Settings β Developer settings β OAuth Apps
- Create new OAuth app
- 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- Create account at Cloudinary.com
- Get API credentials
- Update
application-dev.properties:
cloudinary.cloud.name=YOUR_CLOUD_NAME
cloudinary.api.key=YOUR_API_KEY
cloudinary.api.secret=YOUR_API_SECRET# 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
- Navigate to
/register - Fill in the form with:
- Full Name
- Password
- Phone Number (optional)
- Click "Register"
- Verify email (if enabled)
- Go to
/login - Enter email and password
- Or use "Login with Google/GitHub"
- Go to Dashboard β "Add Contact"
- Fill in contact details:
- Name *
- Email *
- Phone Number
- Address
- Description
- LinkedIn/Website links
- Upload photo
- Mark as favorite
- Click "Save Contact"
- Go to Dashboard β "My Contacts"
- View all your contacts with pagination
- Sort by name, email, or phone
- Click contact to view details
- Use search bar on contacts page
- Search by name, email, or phone
- Results update in real-time
- Navigate to contact details
- Click "Edit"
- Modify information
- Save changes
- Go to contacts list
- Find contact
- Click "Delete"
- Confirm deletion
βββββββββββββββββββββββββββββββββββββββ
β 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
βββββββββββββββββββββββββββββββββββββββ
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
- User - System users with authentication
- Contact - Customer/Lead information
- SocialLink - Social media links for contacts
- Providers - OAuth provider enum
- UserService - User CRUD operations
- ContactService - Contact management
- EmailService - Email notifications
- ImageService - Image upload/management
- UserRepository - Custom user queries
- ContactRepository - Custom contact queries
- SecurityConfig - Spring Security setup
- OAuthAuthenticationSuccessHandler - OAuth2 handler
- AuthFailureHandler - Auth failure logic
β 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
Contributions are welcome! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
- Follow Google Java Style Guide
- Write meaningful commit messages
- Add comments for complex logic
- Write unit tests for new features
- Update documentation