A comprehensive Customer Relationship Management (CRM) system built with Go (backend) and React TypeScript (frontend).
- 🔐 Authentication: JWT tokens and API Keys with role-based access control
- 👥 Lead Management: Lead tracking with conversion to customers
- 🏢 Customer Management: Complete customer lifecycle management
- 🎫 Ticket System: Support ticket management with assignments
- ✅ Task Management: Task tracking and assignment
- ⚙️ Configuration Management: System-wide settings with admin interface
- 🎨 Modern UI: React TypeScript frontend with Material-UI
- 📊 Dashboard: Analytics and activity overview
- 👤 Role-Based Access: Admin, Sales, Support, and Customer roles
- 🔌 RESTful API: Clean architecture with comprehensive endpoints
- Go 1.23+ - Main backend language
- Gin - HTTP web framework
- GORM - ORM for database operations
- MySQL 8.0+ - Primary database
- JWT - Authentication tokens
- Logrus - Structured logging
- React 18 - UI framework
- TypeScript - Type safety
- Material-UI (MUI) - Component library
- React Router - Client-side routing
- TanStack Query - Data fetching and caching
- Vite - Build tool and dev server
- Go 1.23 or higher
- MySQL 8.0 or higher
- Make (optional, for using Makefile commands)
- Node.js 18+ and npm/yarn
- Modern web browser
git clone https://github.com/florinel-chis/gophercrm.git
cd gophercrm# Using Make (recommended)
make create-db
# Or manually with MySQL
mysql -u root < scripts/create_database.sql# Create environment file
cp .env.example .env
# Edit .env file with your database credentials
# Default configuration should work for local developmentgo mod download# Using Make (recommended)
make run
# Or directly with Go
go run cmd/main.goThe backend server will start on http://localhost:8080
cd gocrm-ui# Using npm
npm install
# Or using yarn
yarn install# Using npm
npm run dev
# Or using yarn
yarn devThe frontend will start on http://localhost:5173
- Open your browser to
http://localhost:5173 - Register a new account or use existing credentials
- Login with your credentials
Admin users have access to additional features:
- User management
- System configuration
- All data access across the system
GopherCRM includes a powerful configuration management system that allows administrators to customize system behavior through a web interface.
- Login as an admin user
- Navigate to Settings > Configuration
- Browse settings by category tabs:
- General: Company information and basic settings
- UI & Theme: User interface customization
- Security: Security-related settings
- Leads: Lead management behavior
- Customers: Customer management settings
- Tickets: Support ticket configuration
- Tasks: Task management settings
- Integration: Third-party integrations
- Type-Safe Editing: Different input types based on configuration type (boolean, string, array, etc.)
- Validation: Built-in validation for configuration values
- System Protection: System configurations are protected from deletion
- Read-Only Settings: Some critical settings are read-only
- Default Values: Easy reset to default values
- Real-Time Updates: Changes take effect immediately
The configuration system includes specific settings for lead conversion:
leads.conversion.allowed_statuses: Which lead statuses allow conversion to customerleads.conversion.require_notes: Whether notes are required during conversionleads.conversion.auto_assign_owner: Auto-assign lead owner as customer owner
make build# Run all tests
make test
# Run specific tests
go test -run TestName ./path/to/package
# Run integration tests
go test ./tests# Create database
make create-db
# Reset database (drops and recreates)
make reset-db# Start development server
npm run dev
# Build for production
npm run build
# Preview production build
npm run preview
# Run tests
npm run test
# Run linting
npm run lint
# Type checking
npm run type-check- Hot Reload: Automatic browser refresh on code changes
- TypeScript: Full type checking and IntelliSense
- ESLint: Code linting and formatting
- Prettier: Code formatting
The API follows RESTful conventions with the following structure:
POST /api/auth/register- Register a new userPOST /api/auth/login- User login
GET /api/users- List all usersGET /api/users/:id- Get specific userPUT /api/users/:id- Update userDELETE /api/users/:id- Delete userGET /api/users/me- Get current user profilePUT /api/users/me- Update current user profile
GET /api/leads- List leadsPOST /api/leads- Create new leadGET /api/leads/:id- Get specific leadPUT /api/leads/:id- Update leadDELETE /api/leads/:id- Delete leadPOST /api/leads/:id/convert- Convert lead to customer
GET /api/customers- List customersPOST /api/customers- Create new customerGET /api/customers/:id- Get specific customerPUT /api/customers/:id- Update customerDELETE /api/customers/:id- Delete customer
GET /api/tickets- List ticketsPOST /api/tickets- Create new ticketGET /api/tickets/:id- Get specific ticketPUT /api/tickets/:id- Update ticketDELETE /api/tickets/:id- Delete ticketGET /api/tickets/my- Get current user's tickets
GET /api/tasks- List tasksPOST /api/tasks- Create new taskGET /api/tasks/:id- Get specific taskPUT /api/tasks/:id- Update taskDELETE /api/tasks/:id- Delete taskGET /api/tasks/my- Get current user's tasks
GET /api/api-keys- List user's API keysPOST /api/api-keys- Create new API keyDELETE /api/api-keys/:id- Revoke API key
GET /api/configurations- List all configurationsGET /api/configurations/ui- Get UI-safe configurationsGET /api/configurations/category/:category- Get configurations by categoryGET /api/configurations/:key- Get specific configurationPUT /api/configurations/:key- Update configuration valuePOST /api/configurations/:key/reset- Reset configuration to default
GET /api/dashboard/stats- Get dashboard statistics (total leads, customers, open tickets, pending tasks, conversion rate)
gophercrm/
├── cmd/
│ └── main.go # Application entry point
├── internal/
│ ├── config/ # Configuration management
│ ├── models/ # Domain models and database schemas
│ ├── repository/ # Data access layer interfaces and implementations
│ ├── service/ # Business logic layer
│ ├── handler/ # HTTP handlers and routing
│ ├── middleware/ # Authentication, logging, CORS, etc.
│ └── utils/ # Utility functions and helpers
├── tests/ # Integration tests
├── scripts/ # Database and utility scripts
├── migrations/ # Database migrations (future)
├── doc/ # Documentation and images
├── gophercrm-ui/ # React TypeScript frontend
│ ├── src/
│ │ ├── components/ # Reusable UI components
│ │ ├── pages/ # Application pages
│ │ ├── api/ # API client and endpoints
│ │ ├── hooks/ # Custom React hooks
│ │ ├── contexts/ # React contexts (auth, config)
│ │ ├── types/ # TypeScript type definitions
│ │ ├── utils/ # Frontend utilities
│ │ └── theme/ # Material-UI theme configuration
│ ├── public/ # Static assets
│ └── dist/ # Production build output
├── Makefile # Build and development commands
├── go.mod # Go module definition
├── go.sum # Go module checksums
└── README.md # This file
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
For support and questions:
- Create an issue in the GitHub repository
- Check the documentation in the
doc/directory - Review the configuration settings for system behavior customization

