Lexicon: a customizable native mobile app for your Discourse site

Hey everyone,

I wanted to quickly drop in here and mention that I’ve just open-sourced a project called Lexicon with some colleagues of mine.

It’s a pre-built, customizable native mobile app built on top of the Discourse API. We built it to help quickly integrate discussion and messaging features into other native mobile projects.

This project was really enjoyable to build, primarily due to all of the hard work done in advance by the Discourse core team and community over the years.

Screenshots are available in the introduction.

Technically-minded folks can check out our Quick Start, which will enable you to browse this Discourse site while trying out the app!

Don’t hesitate to reach out if you have any questions, comments, or feedback.

Thanks,
Ryan

P.S. I wasn’t sure which category would be the best to post this in. Feel free to reassign if there’s a better one.

56 Likes

Really appreciate the clear documentation, particularly the architechtural stuff. Can’t wait to check it out locally!

Push notifications | :x::hammer: Under Development

Any timeline on that one?

7 Likes

That’s awesome @RyanKF ! In which direction new devs should help first of all? I have some experience with mobile apps in React.

3 Likes

This is very cool. It looks like it is under MIT?

1 Like

Oh, is this supposed to be a native Discourse client like Fig? If so, I really like it! :grinning:

4 Likes

Fig looks nice! It seems like they really nailed it with producing a native iOS experience for Discourse.

Some differences I can see…

Tablet Support

Fig has really nice tablet support. We haven’t tackled that yet.

Single-site App

Similar to Discourse mobile, Fig has taken the “site manager” approach, allowing you to add multiple Discourse sites that you can browse. Lexicon is more focused on producing an individual, possibly white-labeled app for a Discourse site.

Lexicon itself is not an App

Additionally, Lexicon is more of an “app template” that you could take, customize, and publish to the App / Play store yourself. Fig provides a published app.

Premium Offering

Fig has a premium offering for some features. Lexicon has no premium offering.

The only point where money would come into play is if you didn’t have anyone else to help you integrate, customize, or publish Lexicon. In that case, we’d be happy to talk about how to engage with us.

Having said that, I know many users of this site are technical or semi-technical, so I’m hoping the documentation is detailed enough to guide many people through that process without additional input.

Technologies & Device Support

I’m taking a guess here, but it looks like Fig built their app using Swift, so truly native, which is fantastic.

We built Lexicon using React Native, meaning with Javascript (understandable that not everyone is a fan of that approach).

One benefit of our usage of React Native is that we automatically have publishable Android and iOS apps out of the box, and we have a high ratio of code-reuse.

Most of the differences between Android and iOS in our code base are details for look-and-feel, such as a Floating Action Button on Android as opposed to a header button on iOS.

11 Likes

It is MIT. And in all of the other details of announcing this I had forgotten to add a LICENSE file to the repo - thanks for pointing that out!

6 Likes

And you’re awesome for already wanting to contribute @4ong!

Frontend

On the frontend side, one area where I’d like to improve is our support of features embedded in the raw content of a post.

On top of handling the regular Markdown content of the post, we can also support several features provided by Discourse’s custom markup.

As you might already be familiar, Discourse supports a custom syntax for features like quotes, toggles, dates, and even polls.

In a fairly typical approach, we have carved out some initial support for basic features like code embeds, and then have a " is not supported at this time" block for the features that aren’t implemented yet.

I’d love to completely eliminate those “not supported” blocks from our app. Polls and Toggles would be really great to have supported in particular.

Also, because Lexicon operates off of the raw content of a post, we bypass OneBox support. So at a minimum, it would be good to have basic support for link previews.

Backend

One feature I’m stoked to eventually support is deep-linking from emails. This is probably not a trivial feature to implement, and would likely involve building a Discourse plugin in Ruby.

Essentially, this would allow users to tap on a link to a post in an email from Discourse, and have it open the app (if installed) to that exact post via a deep-link through Discourse.

And if the app isn’t installed, or the user is not on a mobile device, it would pass them through to the site as usual.

If anyone wants to tackle this one, reach out to me. It’d be huge to have that working.


EDIT: Also check out the Supported Discourse Features page of our documentation to see which features aren’t yet supported, and feel free to tackle any of those (other than push notifications, which we’re already working on).

7 Likes

Optimistically, in the next few weeks here—I just can’t make any hard guarantees yet.

We’re already past the proof-of-concept stage, but have some rough edges to smooth out.

And support for this feature will involve installing our Discourse plugin on your site.

To provide some details, we built the Lexicon Mobile App with Expo, which is an incredible set of build tools and services for React Native apps—and it includes support for Push Notifications.

However, we weren’t able to find any existing Discourse plugins that integrate with Expo’s push service, so we ended up needing to build one. Fortunately, the existing open-source integration with OneSignal is very similar to what we needed, and so we were able to use their project as a starting point. (very grateful to pmusaraj for that :pray:).

In addition to publishing the plugin and integrating it with the mobile app, we’ll obviously want to update the documentation as well. Because Lexicon allows you to publish your own app, it’s more than just setting up push notifications for a single app on the App / Play Stores.

So we’ll want to make sure users of the project are properly guided through the process of setting it up properly so that it just works.

7 Likes

Thanks for all of the feedback everyone. Let me know if you have any other questions.

By the way, I forgot to mention, we also have a post on ProductHunt today that is doing pretty well. If you’d like to show some support, feel free to go check it out!

1 Like

Ah, okay. Thanks for clarifying! Lexicon sounds really interesting. I’m looking forward to tablet support!

If I wanted to build a social media platform off of Discourse, would Lexicon be ideal for that purpose? Assuming Lexicon doesn’t come to desktop platforms in the future, desktop support would be a hurdle.

1 Like

Pretty exciting!

A few comments/questions:

  1. It’s not clear if DiscourseConnect is supported; might be worth adding that to the supported features page.

  2. There’s a lot of options available for ways of installing Prose, both in the tutorial and the docs. I suspect that material could be better organised. I found myself unclear about how SSL setup would work if I was trying to do things as simply as possible using your docker image.

  3. I’d love to try it out, but there’s no obvious way of doing so. If you made an app available for meta, we could :slight_smile:

  4. Push notifications & deep linking as you mention are definitely important features in my mind.

  5. Given the complexities of updates, app deployment, prose, etc., my mind quickly goes to being interested in a paid turn-key hosted/supported service where you handle all this. Might be worth you offering one. I’m curious what pricing would be like.

5 Likes

Along with tablet support, right? :wink:

1 Like

this is excellent work

4 Likes

Does Lexicon have its own Discourse community? The GitHub is nice, but you can’t really talk about Lexicon there in a proper manner.

5 Likes

Hi, there seems to be some issue when the application is loading a post contains non-English characters (e.g. 中文 Chinese characters), I guessed that may related to the unicode name feature of discourse (Unicode usernames and group names) and I’ve opened an issue to put the detailed error log at the Github repository:

1 Like

Nice one! Have you incorporated any automated moderation solutions yet? Would love to reduce abuse and spam I see in some forums.

I tried to configure Lexicon mobile app following the Tutorial given on Lexicon. After completing all the steps and launching mobile app for a free discourse instance(https://meta.discourse.org/), I am getting these error on the phone and terminal log respectively.
lexicon_mobile

Terminal error:

None of these files exist:

\generated\server\globalTypes(.native|.android.js|.native.js|.js|.android.json|.native.json|.json|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx|.android.svg|.native.svg|.svg)

src\generated\server\globalTypes\index(.native|.android.js|.native.js|.js|.android.json|.native.json|.json|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx|.android.svg|.native.svg|.svg)
 5 | import { DEFAULT_CHANNEL } from '../constants';
  6 | import { Text } from '../core-ui';
>  7 | import { TopicsSortEnum } from '../generated/server/globalTypes';
    |                                 ^
   8 | import {
  9 |   anchorToMarkdown,
  10 |   errorHandler,
2 Likes

After setting up the project, the following errors are occurring repeatedly:


I have provided http:// in the MOBILE_HOST_PRONE but even then it’s showing error while running the app in the phone

1 Like

Also another error is this:
Unable to start your application : no-registered-application.

1 Like