Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
cesurapp committed May 6, 2021
1 parent a359428 commit 72bf95e
Show file tree
Hide file tree
Showing 159 changed files with 6,483 additions and 17,565 deletions.
12 changes: 5 additions & 7 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,14 @@ root = true

# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = true
charset = utf-8
end_of_line = LF
insert_final_newline = true
trim_trailing_whitespace = true

[*.php]
[*.{php,html,twig,json,yml,yaml,vue}]
indent_style = space
indent_size = 4

[{package.json, composer.json}]
indent_size = 2

[*.md]
trim_trailing_whitespace = false
max_line_length = 80
18 changes: 13 additions & 5 deletions .env
Original file line number Diff line number Diff line change
@@ -1,21 +1,29 @@
# This file is a "template" of which env vars need to be defined for your application
# Copy this file to .env file for development, create environment variables when deploying to production
# https://symfony.com/doc/current/best_practices/configuration.html#infrastructure-related-configuration
# Run "composer dump-env prod" to compile .env files for production use (requires symfony/flex >=1.2).
# https://symfony.com/doc/current/best_practices.html#use-environment-variables-for-infrastructure-configuration

###> symfony/framework-bundle ###
APP_ENV=prod
APP_SECRET=52a9ee6241c958598f23df444ffdb03c
###< symfony/framework-bundle ###

###> doctrine/doctrine-bundle ###
# For an SQLite database, use: "sqlite:///%kernel.project_dir%/var/data.db"
DATABASE_URL=mysql://root:[email protected]:3306/pdadmin
# DATABASE_URL="sqlite:///%kernel.project_dir%/var/data.db"
# DATABASE_URL="mysql://db_user:[email protected]:3306/db_name?serverVersion=5.7"
DATABASE_URL="postgresql://db_user:[email protected]:5432/db_name?serverVersion=13&charset=utf8"
###< doctrine/doctrine-bundle ###

###> symfony/mailer ###
#MAILER_DSN=smtp://[email protected]:[email protected]:465?encryption=ssl&auth_mode=login
MAILER_DSN=smtp://localhost
###< symfony/mailer ###

###> symfony/messenger ###
# Choose one of the transports below
# MESSENGER_TRANSPORT_DSN=doctrine://default
# MESSENGER_TRANSPORT_DSN=amqp://guest:guest@localhost:5672/%2f/messages
MESSENGER_TRANSPORT_DSN=redis://localhost:6379/messages
###< symfony/messenger ###

###> Project Configuration ###
UPLOAD_DIR="public/uploads/"
MAILER_FROM_EMAIL=[email protected]
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,6 @@ src/*/Entity/*/*~
node_modules
.idea
/build/
.DS_Store
.DS_Store
npm-debug.log
yarn-error.log
1 change: 1 addition & 0 deletions .php-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
8
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2020 Ramazan APAYDIN
Copyright (c) 2021 Ramazan APAYDIN

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
48 changes: 25 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,21 @@

![page-admin](https://user-images.githubusercontent.com/8649070/42580601-9e100496-8533-11e8-93bf-9d74e721ccd5.png)

pdAdmin
pdAdmin
=========
Symfony Powerful Dashboard & Admin. Developed with **Symfony 5** framework.
Supported **PHP8 and Composer 2**

No changes were made to the symfony structure, the current directory structure is used. A custom namespace for Admin has been created. This field is used for all administrator operations.
Symfony Powerful Dashboard & Admin. Developed with **Symfony 5**, **Vue 3**, **Bootstrap 5** framework.

The interface is designed to be responsive using Twitter Bootstrap. The least possible dependency was tried to be used.
No changes were made to the symfony structure, the current directory structure is used. A custom namespace for Admin has been created. This field is used for all administrator operations.

The interface is designed to be responsive using Twitter Bootstrap. The least possible dependency was tried to be used.

Installation
--------------------
1. Download pdAdmin
```
composer create-project appaydin/pd-admin pdadmin
composer create-project appaydin/pd-admin pdadmin
```
2. Create and configure the `.env` file.

Expand All @@ -24,7 +26,7 @@ Installation
```
4. Run built-in web server
```
bin/console server:start
symfony server:start --no-tls
```
5. Install & Build assets
```
Expand Down Expand Up @@ -82,7 +84,7 @@ Clear the cache after changes to system settings, otherwise the new settings wil
For general settings, you can add it to __src/Admin/Forms/System/GeneralForm__

__Add New Menu to Settings__:
```php
```php
<?php
//src/Admin/Menu/SettingsMenu.php

Expand All @@ -98,42 +100,42 @@ class SettingsMenu extends Menu
// Create Root Item
$menu = $this->createRoot('settings_menu')->setChildAttr([
'class' => 'nav nav-pills',
'data-parent' => 'admin_settings_general',
'data-parent' => 'admin_config_general',
]);

// Create Menu Items
$menu->addChild('nav_config_general')
->setLabel('nav_config_general')
->setRoute('admin_settings_general')
->setRoute('admin_config_general')
->setLinkAttr(['class' => 'nav-item'])
->setRoles(['ROLE_SETTINGS_GENERAL'])
->setRoles(['ROLE_CONFIG_GENERAL'])
// Contact
->addChildParent('nav_config_contact')
->setLabel('nav_config_contact')
->setRoute('admin_settings_contact')
->setRoute('admin_config_contact')
->setLinkAttr(['class' => 'nav-item'])
->setRoles(['ROLE_SETTINGS_CONTACT'])
->setRoles(['ROLE_CONFIG_CONTACT'])
// Email
->addChildParent('nav_config_email')
->setLabel('nav_config_email')
->setRoute('admin_settings_email')
->setLinkAttr(['class' => 'nav-item'])
->setRoles(['ROLE_SETTINGS_EMAIL']);

return $menu;
}
}
}
```

### Mail Manager
Mail Manager is made as Symfony Mailer plugin. With Mailer, the log of all mail is stored.
In addition, it is a template manager. You can create custom templates (Email Template) for your posts and provide a compilation that includes submissions.
The Mail Template is multi-language supported. You can create templates for different languages.
Package installation __packages/pd_mailer.yaml__ located in the file.
Mail Manager is made as Symfony Mailer plugin. With Mailer, the log of all mail is stored.
In addition, it is a template manager. You can create custom templates (Email Template) for your posts and provide a compilation that includes submissions.
The Mail Template is multi-language supported. You can create templates for different languages.
Package installation __packages/pd_mailer.yaml__ located in the file.
For further information please contact [pd-mailer](https://github.com/appaydin/pd-mailer)

Send Email:
```php
```php
// Create Message
$email = new Email();
$email
Expand All @@ -150,8 +152,8 @@ $this->get('mailer')->send($email);
```

### Create New Widget
Widget system was created with Symfony "EventDispatcher Component".
It has an adjustable structure for each user and it can be specially designed with "Twig Template" engine.
Widget system was created with Symfony "EventDispatcher Component".
It has an adjustable structure for each user and it can be specially designed with "Twig Template" engine.
For more information visit [pd-widget](https://github.com/appaydin/pd-widget)

Create New Admin Widget:
Expand Down Expand Up @@ -240,8 +242,8 @@ class AccountWidget
```

### Create New Menu
The menu system was created with Symfony "EventDispatcher Component".
For each menu created, Event is generated by default, can be turned off by menu configuration.
The menu system was created with Symfony "EventDispatcher Component".
For each menu created, Event is generated by default, can be turned off by menu configuration.
For more information visit the [pd-menu](https://github.com/appaydin/pd-menu)

Create Menu:
Expand Down
52 changes: 52 additions & 0 deletions assets/admin/_variables.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
/*======================================================
Override Bootstrap Variables
=======================================================*/
$font-family-sans-serif: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;
$body-color: #4a5073;
$headings-color: #262b40;
$link-decoration: none;
$link-color: #262b40;
$border-radius: .3rem;
$input-btn-focus-width: .2rem;
$form-check-input-width: 1.2em;
$form-check-input-border-radius: .2rem;
$headings-font-weight: 500;
$form-label-font-weight: 500;
$line-height-base: 1.7;
$alert-padding-y: .5rem;
$alert-padding-x: 1rem;
$font-size-base: .9rem;
$transition-base: all .15s ease-in-out;
$grid-gutter-width: 1rem;
$small-font-size: .85em;
$font-weight-bold: 500;
$btn-close-focus-shadow: none;
$primary: #5d52fd;
$green: #8fd48f;
$cyan: #07adcb;
$btn-close-width: .75em;
$dropdown-item-padding-x: 1rem;
$dropdown-item-padding-y: 1.2rem / 4;
$dropdown-divider-margin-y: 1rem / 3;
$dropdown-border-color: #dee2e6;
$dropdown-link-hover-bg: #e9ecef;
$dropdown-border-width: 0;
$dropdown-padding-x: 0;
$dropdown-padding-y: 0;
$modal-header-padding-y: .85rem;
$modal-header-padding-x: $modal-header-padding-y * 1.5;
$modal-header-border-width: 0;
$modal-footer-border-width: 0;
$modal-content-border-width: 0;
$table-cell-padding-x: .75rem;

$popover-border-width: 0;
$popover-header-bg: $primary;
$popover-header-color: #FFF;
$popover-font-size: $font-size-base;
$popover-body-padding-y: 1rem / 2;

@import "~bootstrap/scss/functions";
@import "~bootstrap/scss/variables";
@import "~bootstrap/scss/mixins";

37 changes: 37 additions & 0 deletions assets/admin/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import * as Vue from 'vue/dist/vue.esm-bundler'
import {onMounted, getCurrentInstance, ref} from 'vue'

/**
* ============
* Init Vue & Core
* ============
*/
let appConfig = {
...{delimiters: ['${', '}']},
...(window.vueApp || {}),
...{
setup(props, context) {
let forms = ref({});
const app = getCurrentInstance().ctx;

// Flash Message
onMounted(() => {
app.msg.showBag(window.flashBag);
})

return {
forms
}
},
}
}

/**
* ============
* Create APP
* ============
*/
window.Root = Vue.createApp(appConfig)
.use(require('./core/index').default)
.use(require('./src/index').default)
.mount('#app');
Loading

0 comments on commit 72bf95e

Please sign in to comment.