GithubHelp home page GithubHelp logo

smlrods / crm Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 1.61 MB

Customer Relationship Management

Home Page: https://github.com/smlrods/CRM/projects

PHP 52.48% JavaScript 25.12% Blade 22.37% CSS 0.03%

crm's Introduction

Laravel CRM Project

This is a Customer Relationship Management (CRM) application built using Laravel. It's designed to help businesses manage customer data, interactions, and more. This project serves as a practical application of Laravel's features and best practices, and was created to improve my Laravel skills.

Table of Contents

Project Overview

This Laravel project provides a foundation for building a CRM application. The project is designed to be modular and extensible, allowing you to easily add new features and functionality.

Requirements

  • PHP >= 8.1
  • Composer
  • MySQL
  • Node.js and npm

Installation

  1. Clone the project repository:
git clone https://github.com/smlrods/CRM.git
  1. Enter the project directory:
cd CRM
  1. Install the Composer dependencies:
composer install
  1. Install the npm dependencies:
npm install
  1. Create a .env file from the provided .env.example file:
cp .env.example .env
  1. Generate the application key:
php artisan key:generate
  1. Migrate the database:
php artisan migrate
  1. Seed the database with sample data (optional):
php artisan db:seed

Getting Started

  1. Start the development server:
php artisan serve
  1. Start the Vite dev server:
npm run dev
  1. The application will be available at http://localhost:8000

Project Structure

The project is organized into the following directories:

  • app: This directory contains the application logic, including models, controllers, and services.
  • config: This directory contains configuration files for the application.
  • database: This directory contains database migrations and seeds.
  • public: This directory contains the web server's public files, including the front-end assets.
  • resources: This directory contains resources used by the application, such as views and language files.
  • routes: This directory contains the routing definitions for the application.
  • storage: This directory contains application storage, such as logs and uploaded files.
  • tests: This directory contains unit and feature tests for the application.
  • vendor: This directory contains third-party dependencies managed by Composer.

Dependencies

This project relies on several dependencies for its functionality:

PHP and Composer Dependencies

  • Laravel: This is the main framework used for this project. Laravel is a web application framework with expressive, elegant syntax.

  • PHPUnit: This is the testing framework used for writing unit tests in this project.

  • laravel-permission: This package allows you to manage user permissions and roles in a database.

Please refer to the composer.json file for a full list of PHP and Composer dependencies.

JavaScript and Node.js Dependencies

  • Node.js and npm: These are used for managing JavaScript dependencies and running tasks. Node.js is a JavaScript runtime built on Chrome's V8 JavaScript engine, and npm is the package manager for Node.js.

  • Vite: This is a build tool that provides faster and leaner development experience for modern web projects. It is used in this project for managing and bundling the JavaScript resources.

  • Tailwind CSS: This is a utility-first CSS framework for rapidly building custom user interfaces.

  • Flowbite React: Flowbite is a set of utility classes for Tailwind CSS that helps you build web interfaces faster.

  • PostCSS: This is a tool for transforming CSS with JavaScript, and it is used in this project in conjunction with Tailwind CSS and Flowbite.

  • ReactJS: React is the library for web and native user interfaces. Build user interfaces out of individual pieces called components written in JavaScript.

  • InertiaJS: Inertia.js is a JavaScript tool that allows users to build modern single-page apps using classic server-side routing and controllers.

Please refer to the package.json file for a full list of JavaScript and Node.js dependencies.

Database Schema

Database Schema

MVC Pattern

The project follows the MVC (Model-View-Controller) pattern. Models represent the data of the application, controllers handle user interaction and business logic, and views render the user interface.

Testing

The project includes unit and feature tests for the application logic. You can run the tests using the following command:

cp .env.testing.example .env.testing
npm run build
php artisan test

Purpose of the Project

This project was created as a means to improve my Laravel skills. It serves as a practical application of Laravel's features and best practices. While building this CRM application, I've had the opportunity to explore various aspects of Laravel including routing, middleware, Eloquent ORM, Blade templates, and more. This hands-on experience has significantly contributed to my understanding and proficiency in Laravel.

Contributing

We welcome contributions to this project.

License

This project is licensed under the MIT License. Please see the LICENSE file for more information.

crm's People

Contributors

smlrods avatar

Stargazers

 avatar

Watchers

 avatar

crm's Issues

Feature: Project Management Resource Route in CRM with CRUD Operations

Overview

The project needs to implement a new resource route to fully manage projects, including CRUD operations.

Details

New Resource Route

  • Resource: projects
  • Controller: ProjectController
  • Methods: index, create, store, show, edit, update, destroy

Functionality

  1. Display a paginated list of projects at /projects.
  2. Create a new project at /projects/create.
  3. Store the new project data using the store method.
  4. Show detailed information about a specific project at /projects/{project}.
  5. Edit an existing project at /projects/{project}/edit.
  6. Update the project data using the update method.
  7. Delete a project using the destroy method.

Additional Information

  • Ensure proper authentication and authorization checks.
  • Apply appropriate styling to match the CRM's design.

Context

This feature enhances our CRM by providing a complete set of CRUD operations for efficient project management.

Acceptance Criteria

  • The /projects route displays a paginated list of projects.
  • The /projects/create route allows the creation of a new project.
  • The /projects/{project} route shows detailed information about a specific project.
  • The /projects/{project}/edit route allows for editing an existing project.
  • The store, update, and destroy methods handle data storage, updating, and deletion respectively.

Dependencies

No direct dependencies.

Example

// routes/web.php

use App\Http\Controllers\ProjectController;

Route::resource('projects', ProjectController::class);

Feature: Task Management Resource Route in CRM with CRUD Operations

Overview

The task involves implementing a new resource route to fully manage tasks, including CRUD operations.

Details

New Resource Route

  • Resource: tasks
  • Controller: TaskController
  • Methods: index, create, store, show, edit, update, destroy

Functionality

  1. Display a paginated list of tasks at /tasks.
  2. Create a new task at /tasks/create.
  3. Store the new task data using the store method.
  4. Show detailed information about a specific task at /tasks/{task}.
  5. Edit an existing task at /tasks/{task}/edit.
  6. Update the task data using the update method.
  7. Delete a task using the destroy method.

Additional Information

  • Ensure proper authentication and authorization checks.
  • Apply appropriate styling to match the CRM's design.

Context

This feature enhances our CRM by providing a complete set of CRUD operations for efficient task management.

Acceptance Criteria

  • The /tasks route displays a paginated list of tasks.
  • The /tasks/create route allows the creation of a new task.
  • The /tasks/{task} route shows detailed information about a specific task.
  • The /tasks/{task}/edit route allows for editing an existing task.
  • The store, update, and destroy methods handle data storage, updating, and deletion respectively.

Dependencies

No direct dependencies.

Example

// routes/web.php

use App\Http\Controllers\TaskController;

Route::resource('tasks', TaskController::class);

Feature: Dashboard Implementation with Charts

Description:

The need to enhance the system by implementing a comprehensive dashboard that provides at-a-glance insights into user and project-related statistics through visually appealing charts. This feature will empower users to quickly grasp key metrics, fostering informed decision-making. The specific requirements for each section of the dashboard are outlined below:

1. User Stats:

  • Metrics: Number of registered users, New user registrations.
  • Chart Type: Bar Chart
  • Details: Develop a Bar Chart to effectively visualize the count of registered users and new user registrations over a specified time period. This chart should be dynamically updated as new users register.

2. Client Overview:

  • Metrics: Total number of clients, New clients added.
  • Chart Type: Bar Chart
  • Details: Implement a Bar Chart to represent the total number of clients and the influx of new clients. The chart should dynamically reflect changes in the client base over time.

3. Project Insights:

  • Metrics: Total projects, Projects by status.
  • Chart Type: Donut Chart
  • Details: Develop a Donut Chart to illustrate the distribution of projects based on their status. This chart should provide a clear overview of project statuses, allowing users to quickly identify trends and potential issues.

4. Task Management:

  • Metrics: Total tasks, Tasks by status.
  • Chart Type: Donut Chart
  • Details: Implement a Donut Chart to visually communicate the distribution of tasks based on their status. This chart should assist users in understanding the task landscape and identifying areas that may require attention.

Additional Considerations:

  • Ensure the dashboard is responsive and provides a seamless user experience across various devices.
  • Implement tooltips on the charts for detailed information on specific data points.
  • Provide appropriate color coding for different categories to enhance chart readability.

Acceptance Criteria:

  • The dashboard should be accessible from the main navigation menu.
  • Users should be able to interact with the charts for a more detailed view.
  • The implementation should adhere to design and accessibility standards.

Dependencies:

  • Integration with the backend to fetch and update user, client, project, and task-related data.

Release: Enhanced Database Schema and Revamped Front-End with React and InertiaJS

The upcoming release introduces a fresh database schema and adopts React with InertiaJS.

Tasks

  • Create migrations to new database.

New features

Organizations

  • Users can create organizations.
  • Users can invite other users to their organizations.

Roles management

  • Users can create roles and assign predefined permissions for their organizations.
  • Users can assign roles to the members of their organizations.

Contact management

  • Members of an organization can create, read, update, and delete contacts.

Companies management

  • Members of an organization can create, read, update, and delete companies.

Leads Management

  • Members of an organization can create, read, update, and delete leads.

Activities Management

  • Members of an organization can create, read, update, and delete activities.

Deals Management

  • Members of an organization can create, read, update, and delete deals.

New Database Schema

Tables:

  1. Users:

    • user_id: (INT, PRIMARY KEY) Unique identifier for the user.
    • username: (VARCHAR(255), UNIQUE) Username for login.
    • password: (VARCHAR(255)) Hashed password.
    • email: (VARCHAR(255)) User's email address.
    • first_name: (VARCHAR(255)) User's first name.
    • last_name: (VARCHAR(255)) User's last name.
    • role: (ENUM('admin', 'agent', 'customer')) User's role in the system.
  2. Contacts:

    • contact_id: (INT, PRIMARY KEY) Unique identifier for the contact.
    • user_id: (INT, FOREIGN KEY REFERENCES Users(user_id)) User who created the contact.
    • first_name: (VARCHAR(255)) Contact's first name.
    • last_name: (VARCHAR(255)) Contact's last name.
    • email: (VARCHAR(255)) Contact's email address.
    • phone_number: (VARCHAR(255)) Contact's phone number.
    • organization_name: (VARCHAR(255)) Contact's organization name (optional).
    • job_title: (VARCHAR(255)) Contact's job title (optional).
    • description: (TEXT) Additional information about the contact (optional).
    • organization_id: (INT, FOREIGN KEY REFERENCES Organizations(organization_id)) Associated organization for the contact.
  3. Addresses

    • address_id: (INT, PRIMARY)
    • street_address: (VARCHAR(255))
    • city: (VARCHAR(255))
    • state: (VARCHAR(50))
    • zip_code: (VARCHAR(10))
  4. Companies:

    • company_id: (INT, PRIMARY KEY) Unique identifier for the company.
    • name: (VARCHAR(255)) Company name.
    • website: (VARCHAR(255)) Company website URL (optional).
    • industry: (VARCHAR(255)) Company industry (optional).
    • address: (TEXT) Company address.
    • description: (TEXT) Additional information about the company.
    • organization_id: (INT, FOREIGN KEY REFERENCES Organizations(organization_id)) Associated organization for the company.
  5. Leads:

    • lead_id: (INT, PRIMARY KEY) Unique identifier for the lead.
    • contact_id: (INT, FOREIGN KEY REFERENCES Contacts(contact_id)) Associated contact for the lead.
    • company_id: (INT, FOREIGN KEY REFERENCES Companies(company_id)) Associated company for the lead (optional).
    • source: (ENUM('website', 'referral', 'social_media', 'other')) Source of the lead.
    • created_at: (DATETIME) Date and time the lead was created.
    • status: (ENUM('open', 'closed', 'converted')) Current status of the lead.
    • description: (TEXT) Additional information about the lead.
    • organization_id: (INT, FOREIGN KEY REFERENCES Organizations(organization_id)) Associated organization for the lead.
  6. Activities:

    • activity_id: (INT, PRIMARY KEY) Unique identifier for the activity.
    • user_id: (INT, FOREIGN KEY REFERENCES Users(user_id)) User who created the activity.
    • contact_id: (INT, FOREIGN KEY REFERENCES Contacts(contact_id)) Associated contact for the activity.
    • lead_id: (INT, FOREIGN KEY REFERENCES Leads(lead_id)) Associated lead for the activity (optional).
    • activity_type: (ENUM('call', 'email', 'meeting', 'other')) Type of activity performed.
    • date: (DATE) Date of the activity.
    • time: (TIME) Time of the activity.
    • description: (TEXT) Summary of the activity.
    • organization_id: (INT, FOREIGN KEY REFERENCES Organizations(organization_id)) Associated organization for the activity.
  7. Deals:

    • deal_id: (INT, PRIMARY KEY) Unique identifier for the deal.
    • lead_id: (INT, FOREIGN KEY REFERENCES Leads(lead_id)) Lead associated with the deal.
    • contact_id: (INT, FOREIGN KEY REFERENCES Contacts(contact_id)) Contact associated with the deal.
    • company_id: (INT, FOREIGN KEY REFERENCES Companies(company_id)) Company associated with the deal.
    • user_id: (INT, FOREIGN KEY REFERENCES Users(user_id)) User responsible for the deal.
    • name: (VARCHAR(255)) Deal name.
    • value: (DECIMAL) Monetary value of the deal.
    • currency: (VARCHAR(3)) Currency code for the deal amount.
    • close_date: (DATE) Expected or actual date of deal closure.
    • status: (ENUM('pending', 'won', 'lost')) Current status of the deal.
    • description: (TEXT) Additional information about the deal.
    • organization_id: (INT, FOREIGN KEY REFERENCES Organizations(organization_id)) Associated organization for the deal.
  8. Organizations:

    • organization_id: (INT, PRIMARY KEY) Unique identifier for the organization.
    • name: (VARCHAR(255)) Organization name.
    • user_id: (INT, FOREIGN KEY REFERENCES Users(user_id)) User who created the organization.
    • created_at: (DATETIME) Date and time when the organization was created.
  9. OrganizationMembers:

    • membership_id: (INT, PRIMARY KEY) Unique identifier for the membership.
    • organization_id: (INT, FOREIGN KEY REFERENCES Organizations(organization_id)) Associated organization.
    • user_id: (INT, FOREIGN KEY REFERENCES Users(user_id)) User who is a member of the organization
  10. Roles:

    • role_id: (INT, PRIMARY KEY)
    • organization_id: (INT, FOREIGN KEY REFERENCES Organizations(organization_id))
    • name: (VARCHAR(191))
    • guard_name: (VARCHAR(191))
    • created_at: (DATETIME)
    • updated_at: (DATETIME)
  11. Permissions:

    • permission_id: (INT(10), PRIMARY KEY)
    • name: (VARCHAR(191))
    • guard_name: (VARCHAR(191))
    • created_at: (DATETIME)
    • updated_at: (DATETIME)
  12. Model_has_roles:

    • role_id: (INT(10), FOREIGN KEY REFERENCES Roles(role_id))
    • organization_id: (INT, FOREIGN KEY REFERENCES Organizations(organization_id))
    • model_id: (INT(10), FOREIGN KEY REFERENCES Users(user_id))
    • model_type: (VARCHAR(191))
  13. Role_has_permissions:

    • permission_id: (INT(10), FOREIGN KEY REFERENCES Permissions(permission_Id))
    • organization_id: (INT, FOREIGN KEY REFERENCES Organizations(organization_id))
    • role_id: (INT(10), FOREIGN KEY REFERENCES Roles(role_id))
  14. Model_has_permissions:

    • permission_id: (INT(10), FOREIGN KEY REFERENCES Permissions(permission_id))
    • model_id: (INT(10), FOREIGN KEY REFERENCES Users(user_id))
    • model_type: (VARCHAR(191))

Front end

Powered by React with InertiaJS.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.