Coder Social home page Coder Social logo

crm-administrator's Introduction

CRM ADMINISTRATOR

  • The following project is built with: Php, javascript and typescript.

  • The frameworks used are: Laravel, inertia.js and vue.js.

  • The purpose of this project is to build a multi-purpose crm with reusable components such as:

  • Navigation

  • Tables

  • Pagination

  • Forms

  • Manage different locations

Navigation:

  • You can customise your sidebar menu easily, inside the hook useNavItems.ts, you can create your menuItems and even their corresponding child menuItems.

  • Make sure that the path that each item points to exists within the web.php file.

  • The development uses a builder pattern, to facilitate the creation and configuration of each item.

alt text

Tables:

  • Inside resources\js\Pages\Modules\Index.vue exists an example of how to use CustomTableComponent.

alt text

  • Steps to configure a table:

  • configure a ModuleRepositoryCreator class copy, and inside their factoryMethod; return an instance of ModuleRepository

alt text

  • configure an implementation of ListRepositoryInterface for example App\Classes\ModuleRepository, just there you can configure tableHeaders inside setTableHeaders()

alt text

  • params:

  • title: name of column on table.

  • columnProp: property mapped in collection.

  • order_activated: active order arrow.

  • query_name: query_param used to order.

  • up_arrow: up_arrow is selected.

  • down_arrow: down_arrow is selected.

  • deactivate: deactivate order.

  • inside getList() method you can configure the paginated query

  • inside RepositoryServiceProvider you can configure which RepositoryCreator class is to be injected into your controller

alt text

  • Inside your controller, for example: ModulesController, you can set a configuration like this:

alt text

  • 'path_module', 'delete_action', 'udpate_action' and 'index_action'. These parameters correspond to the routes configured in the web.php routes file where your routes should be pointing to the different controller methods.

alt text

Pagination:

  • Inside resources\js\Pages\Modules\Index.vue exists an example of how to use CustomTablePagination.

  • You can configure pagination by adding this variables inside .env:

  • DEFAULT_NUMBER_PER_PAGE_PAGINATION=5. (how many items are showed by page)

  • DEFAULT_SHOW_NUMBER_PAGE_PAGINATION=10. (number of pages showed in pagination)

alt text

Manage different locations:

  • inside lang/es.json and lang/en.json you can put translations and then use useTranslations() hook for translating a text.

For testing:

  • unit/integration tests: phpUnit, vitest.
  • e2e testing: laravel dusk

command to run tests:

  • phpUnit (unit/feature): php artisan test.
  • vitest (unit/feature): npm run test.
  • laravel dusk (e2e): php artisan dusk.
  • note: to run e2e testing you must run the project first, so follow instructions on section "Configure project in local environment" and after run the project (npm run dev & php artisan serve) and only when the project is running you can run: laravel dusk (this command going to reset migrations, so when tests have finished, rerun seeders: php artisan migrate:refresh --seed)

Requirements:

  • Node 20.12.0.
  • PHP 8.2.17.
  • Laravel 11.

Configure project in local environment:

  • Clone this repo.
  • run: npm install.
  • run: composer install.
  • change .env.copy file to .env.
  • configure database in .env file (configure pagination variables as well).
  • run: php artisan migrate.
  • run: php artisan db:seed.
  • run: php artisan ziggy:generate.
  • run: php artisan ziggy:generate --types.
  • to run test, first run: npm run build, then run: php artisan test, npm run test.
  • run project: npm run dev & php artisan serve.
  • go to /login path and enter with [email protected], password: password.

crm-administrator's People

Contributors

link4042022 avatar

Stargazers

Joel Suarez avatar

Watchers

Joel Suarez avatar

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.