Coder Social home page Coder Social logo

Split frontend and backend about mailu HOT 10 CLOSED

mailu avatar mailu commented on April 27, 2024 2
Split frontend and backend

from mailu.

Comments (10)

kaiyou avatar kaiyou commented on April 27, 2024 1

Log parsing and aggregation would be nice to have, did not have time to implement it yet. At least some statistics and access to the latest log lines from the admin panel would be nice. I will create some issues.

Regarding rainloop, I just implemented it, see #58

from mailu.

muratcorlu avatar muratcorlu commented on April 27, 2024 1

If you can handle the API part, someone else can help about FrontEnd as a second phase. I also can help about FrontEnd.

from mailu.

kaiyou avatar kaiyou commented on April 27, 2024

Thank you for the analysis, and you are making some very good points.

Regarding the Webmail and individual components, I implemented some variable-based configuration to make it easy for us to ship any other Webmail than Roundcube. It should be just as easy to use your own if you modify the docker-compose.yml file or host the Webmail separately. I plan on providing Rainloop and Squirrel pretty soon as drop-in replacements for Roundcube.

Regarding the API, I do agree that having a simple REST API and a Javascript application on top of it would be amazing. It is a lot of work however and was not an option in the past months. Now that the project has a couple users and contributors, we should seriously consider it.

It involves a lot of work however and will probably not be available in a near future unless someone motivated enough contributes it.

from mailu.

curry684 avatar curry684 commented on April 27, 2024

Am I correct in assuming all configuration currently managed by the admin is in the Sqlite database, and it's not modifying or reading anything else right now?

from mailu.

kaiyou avatar kaiyou commented on April 27, 2024

That would be ideal. If you have a look at models.py, you will notice that it does also read and write DKIM key files for now as I wasn't able to configure rmilter to read from sqlite.

from mailu.

curry684 avatar curry684 commented on April 27, 2024

That's not bad per se. Everything in DB would be ideal indeed, but not every options is ever going to be compatible with that. I think you're fine if you expose 2 folders to the outside world, being config and data, with the DB in the first, as it makes backups and scalability easiest. Having a subfolder 'DKIM' in config isn't harmful imho, as I can still restore the server from a tarball of that directory.

Also, poste.io aggregates some log data and I think that is a very important element to support.

from mailu.

kaiyou avatar kaiyou commented on April 27, 2024

I have been working on this for a couple days now. The current design is based on Hug for the backend and React+Redux for the frontend. It should be available in a couple weeks and will push as soon as I have all the (unfinished) pieces together.

from mailu.

muratcorlu avatar muratcorlu commented on April 27, 2024

Do you have any progress about that? I'm also looking for an email server solution with a rest api support. This project seems very promising but with lack of API support. When I have a quick look to your code, I thought that, it could be not so hard to create a rest api with the current admin ui views. For example, this is current implementation:

# /core/admin/mailu/ui/views/users.py

@ui.route('/user/list/<domain_name>', methods=['GET'])
@access.domain_admin(models.Domain, 'domain_name')
def user_list(domain_name):
    domain = models.Domain.query.get(domain_name) or flask.abort(404)
    return flask.render_template('user/list.html', domain=domain)

Just adding another route for an REST endpoint and defining template response depending on requested content type, without changing logical part, it can be easy to add REST endpoints to the admin.

# /core/admin/mailu/ui/views/users.py

@ui.route('/user/list/<domain_name>', methods=['GET'])
@ui.route('/users/<domain_name>', methods=['GET'])
@access.domain_admin(models.Domain, 'domain_name')
def user_list(domain_name):
    domain = models.Domain.query.get(domain_name) or flask.abort(404)
    template_name = 'user/list.html'
    if request_wants_json():
        template_name = 'user/list.json'
    return flask.render_template(template_name, domain=domain)

If this can be a way to have a REST API in this project, I can try to help with a pull request.

Note: request_wants_json should be a function to that will check request accept header. And of course we will need to define json templates for endpoint responses.

from mailu.

kaiyou avatar kaiyou commented on April 27, 2024

My initial goal was to only expose a REST API and then write the admin interface as a static web app. Current problem is I do not have enough time to focus on learning about static web app libraries and stacks.

from mailu.

kaiyou avatar kaiyou commented on April 27, 2024

I'll close this issue as many more precise issues cover the topic already.

from mailu.

Related Issues (20)

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.