Giter VIP home page Giter VIP logo

monofony's Introduction

Monofony is an Open Source micro-framework on top of Symfony & Sylius.

It allows you to use great Sylius packages in a non-commerce Symfony project, with Resource & Grid bundles.

You'll be able to use a full-stack Behaviour-Driven-Development with phpspec and Behat. Cause most of the code is coming with Symfony flex recipes, the files are yours, and you'd be able to customize everything easily.

⚙️ Installation

Install Monofony with Composer (see requirements details).

📖 Documentation

Documentation is available at docs.monofony.com.

🐈 Demo

The demo project on Github. See our Monofony live demo.

📦 Packs

Admin

This pack is already available with the installation.

Some screenshots from our demo project:

Admin dashboard image

Admin advanced list image

Api

This pack is optional. Read the doc to install it.

You'll have some basic endpoints to manage your customers.

Api image

Front

This pack is optional. Read the doc to install it.

You'll have these default features:

  • customer login
  • customer registration
  • forgotten password
  • user profile

Some screenshots from our demo project:

Customer login image

Customer account image

🤝 Community

Get Monofony support on Sylius Slack via #monofony channel.

Stay updated by following our Twitter.

Would like to help us and build the best symfony micro-framework using Sylius? Feel free to open a pull-request!

📃 License

Monofony is completely free and released under the MIT License.

✍️ Authors

Monofony was originally created by Loïc Frémont. See the list of contributors from our community.

monofony's People

Contributors

dependabot-preview[bot] avatar dependabot[bot] avatar harikt avatar kevinmz avatar kweyhaupt avatar lchrusciel avatar loic425 avatar loicmobizel avatar lucaball avatar maximehuran avatar pocky avatar smildev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

monofony's Issues

Reference commit is gone

Monofony version affected: 0.2.3 & 0.3.2

Description
I'm using the monofony bundle on a project that (I created july 2020) and since this friday (23/10), i have an error when using composer install.
It fails to install monofony/core (v0.2.3). It tries to dowload monofony/core from dist but the link leads to a 404 error. Then it tries to clone the commit, but the reference is gone (70778ec872c416cdbb7ef7debcd6e57bc920a2d5). Then I have a RuntimeException :

fatal: reference is not a tree: 70778ec872c416cdbb7ef7debcd6e57bc920a2d5

It does the same when I try to install a new project using the command composer create-project monofony/skeleton acme but this time, the commit reference is not the same (link to the dist):

fatal: reference is not a tree: f407dea88750df7c7711348511d240b77bb161ca

Steps to reproduce
Install a new monofony project using the command composer create-project monofony/skeleton acme

Add button on collection form type does not work.

Monofony version affected: 0.4.0

Description

When clicking on add button on form type with a collection. The add button show a strange string.

Steps to reproduce

Add a CollectionType on a form.

Possible Solution

Copy/paste the change on Sylius ui bundle theme.html.twig on the monofony/admin-pack recipe.

Is it compatible with Symfony 5.x?

Hello Monofony Team,

First of thanks for the great starter package for Symfony. This has great potential to be a de-facto tool for starting any Symfony application.

Some of the key concerns:

  • Is it compatible with Symfony 5.x?
  • Instead of re-inventing the wheel for API, why not to include API-Platform?

public/assets is not in gitignore

Description
The folder public/assets is not in gitignore

Steps to reproduce
create a new project
run yarn build instead of yarn dev
git commit -m "first commit"

observe public/assets is being committed, although it shouldn't.

Possible Solution
add public/assets to gitignore

Add installation guideline in docs

Steps to reproduce:

what happens:

  • you are a bit confused and left with a bad feeling about this

what should happen:

  • you should see in the first page from docs the installation guideline

if approved, I can provide PR to fix this.

Error when upgrading doctrine-behaviours

Monofony version affected: all

Description
"Doctrine\Common\EventSubscriber" has already been autoconfigured and merge
!! () does not support merging autoconfiguration for the same class/interface.

Steps to reproduce

Possible Solution
We have to check if it is already tagged or not.

Auto login after user confirmation and password reset

Describe the proposed solution
You create yourself an account. You fill in a big form. Now you get redirected to your email to confirm it. You close the app, go to your email, find the mail, open it, click the link, and you are redirected to a login form with a flash message that you can now safely login.

But you have to input again the username, the password. Cognitive load++.

Same for reset password: you go to the website, it asks you to login. You input your email and a password you remember, it's wrong. Try a couple of variants, end up with the same error - wrong password.

You decide to reset it. Then you go to reset password. Enter your email, sends you back to login with a flash message to check your email. Again: You close the app, go to your email, find the mail, open it, click the link, and you are redirected to a form where you can set the new password. You write it, twice and hit submit.

Back to login, with a flash message. Now you have to insert the username, again, and then the new password. Again. Cognitive load++. Rage++.

Solution

<?php

namespace App\EventSubscriber;


use Sylius\Bundle\UserBundle\Security\UserLoginInterface;
use Sylius\Bundle\UserBundle\UserEvents;
use Sylius\Component\User\Repository\UserRepositoryInterface;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\EventDispatcher\GenericEvent;
use Webmozart\Assert\Assert;

class AutologinSubscriber implements EventSubscriberInterface
{
    /**
     * @var \App\Repository\UserRepository
     */
    private $userRepository;
    /**
     * @var \Sylius\Bundle\UserBundle\Security\UserLoginInterface
     */
    private $userLogin;
    /**
     * @var string
     */
    private $firewallContextName;

    public function __construct(
        UserRepositoryInterface $userRepository,
        UserLoginInterface $userLogin,
        string $firewallContextName
    ) {
        $this->userRepository = $userRepository;
        $this->userLogin = $userLogin;
        $this->firewallContextName = $firewallContextName;
    }

    /**
     * @return array|string[]
     */
    public static function getSubscribedEvents(): array
    {
        return [
            UserEvents::POST_PASSWORD_RESET => 'autoLogin',
        ];
    }

    public function autoLogin(GenericEvent $event)
    {
        $user = $event->getSubject();
        Assert::notNull($user);

        $user->setEnabled(true);
        $this->userRepository->add($user);

        $this->userLogin->login($user, $this->firewallContextName);
    }
}
    Sylius\Component\User\Repository\UserRepositoryInterface: '@sylius.repository.app_user'

    App\EventSubscriber\AutologinSubscriber:
        class: App\EventSubscriber\AutologinSubscriber
        arguments:
            $firewallContextName: '%firewall.app.context%'
--- a/config/packages/security.yaml
+++ b/config/packages/security.yaml
@@ -5,6 +5,9 @@ imports:
 
 parameters:
     secret: '%env(resolve:APP_SECRET)%'
+    firewall.app.context: 'app'
+    firewall.admin.context: 'admin'
+    firewall.api.context: 'api'
 
 security:
 
@@ -22,7 +25,7 @@ security:
 
     firewalls:
         admin:
-            context: admin
+            context: '%firewall.admin.context%'
             pattern: /admin(?:/.*)?$
             provider: sylius_admin_user_provider
             form_login:
@@ -54,10 +57,11 @@ security:
             fos_oauth: true
             stateless: true
             anonymous: true
+            context: '%firewall.api.context%'
 
         app:
             switch_user: true
-            context: app
+            context: '%firewall.app.context%'
             pattern: /.*
             provider: sylius_app_user_provider
             form_login:
diff --git a/config/routes/frontend/security.yaml b/config/routes/frontend/security.yaml
index 3465090..7f89171 100644
--- a/config/routes/frontend/security.yaml
+++ b/config/routes/frontend/security.yaml
@@ -49,7 +49,7 @@ app_frontend_password_reset:
         _controller: sylius.controller.app_user:resetPasswordAction
         _sylius:
             template: frontend/account/resetPassword.html.twig
-            redirect: app_frontend_login
+            redirect: app_frontend_homepage

The solution above is a PoC I implemented for my needs. It works for me. If you are interested, I can submit it in a PR to be included in Monofony by default and, maybe, why not, in Sylius as well.

[RuntimeException] symfony recipes fails

Monofony version affected: 0.7.0

  [RuntimeException]                                                                                                                      
  Symfony pack "monofony/admin-pack" must duplicate all entries from "require-dev" into "require" but entry "behat/behat" was not found.  

Steps to reproduce:

export SYMFONY_ENDPOINT=https://flex.symfony.com/r/github.com/symfony/recipes-contrib/1022
composer create-project monofony/skeleton acme

Move Behat suite configuration on config/behat/suites.yaml

Describe the proposed solution

Now, Behat suite configuration is on config/suites.yaml

To be clearer and more coherent, add a specific behat directory.

config/behat/suites.yaml
and move config/suites directory into config/behat/suites.

Use of mutation testing in Monofony - Help needed

Hello there!

My name is Ana. I noted that you use the mutation testing tool infection in the project.
I am a postdoctoral researcher at the University of Seville (Spain), and my colleagues and I are studying how mutation testing tools are used in practice. With this aim in mind, we have analysed over 3,500 public GitHub repositories using mutation testing tools, including yours! This work has recently been published in a journal paper available at https://link.springer.com/content/pdf/10.1007/s10664-022-10177-8.pdf.

To complete this study, we are asking for your help to understand better how mutation testing is used in practice, please! We would be extremely grateful if you could contribute to this study by answering a brief survey of 21 simple questions (no more than 6 minutes). This is the link to the questionnaire https://forms.gle/FvXNrimWAsJYC1zB9.

Drop me an e-mail if you have any questions or comments ([email protected]). Thank you very much in advance!!

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.