Lexicon is a customizable, open source mobile App Template that provides an elegant mobile discussions experience. Built on top of Discourse, a platform for communities.
Lexicon is currently under active development. You can stay up to date on the features we're working on by viewing the Project Roadmap.
For more detailed information, updates, and discussions, please visit the Lexicon Discussions section on GitHub.
Clone the repository and navigate into it:
git clone git@github.com:lexiconhq/lexicon.git
cd lexicon
Next, execute the following command.
$ yarn && yarn generate
yarn
will install the dependencies needed, while yarn generate
will launch two processes sequentially.
First, it will generate a GraphQL schema in the api
directory.
Then it will create a new folder called generated
in the frontend
directory. This contains the GraphQL query and mutation types based on the schema generated above. Click here to learn more about this process.
You can run the Lexicon Mobile App and test it out by running this command from the project root:
$ yarn quickstart
This will simultaneously launch two processes:
The quickstart
commands are designed to point at an existing public Discourse server, Discourse Meta.
Configuring it to point at your own Discourse site will take additional configuration.
We guide you through the basics of this in the next section below.
You can also learn more about this process in detail in the Lexicon Documentation.
This is a brief example to demonstrate how to quickly point the project at a custom Discourse site.
In the example below, we'll use the Rust Users forum.
You can also follow along using your own site if you'd like.
After running yarn && yarn generate
from the project root, execute the following:
$ echo "PROSE_DISCOURSE_HOST=https://users.rust-lang.org" > api/.env
The above command sets the required environment variable for the Prose GraphQL API.
Next, open up frontend/Config.ts
, and set the value at config.localDevelopment.proseUrl
to http://localhost
.
const config = {
localDevelopment: {
proseUrl: 'http://localhost',
},
// ...
};
This instructs the frontend to attempt to connect to a Prose GraphQL API running at http://localhost
.
To bring it all together:
The frontend (via localDevelopment.proseUrl
) has been instructed to connect to a Prose GraphQL API running at http://localhost
(port 80).
The Prose GraphQL API (via PROSE_DISCOURSE_HOST
) has been instructed to connect to a Discourse instance at https://users.rust-lang.org
.
When you launch the Mobile App via Expo Go, it will reach out to the API running at http://localhost
, which will contact the Discourse server at https://users.rust-lang.org
, and the content of that server will appear in the Mobile App.
The API's default config instructs the server to listen on a hostname of 0.0.0.0
(the public interface) and port 80.
Next, start the Prose GraphQL API server.
$ yarn --cwd api start
You should see output that looks similar to this:
Attempting to reach your Discourse instance at https://users.rust-lang.org...
Your Discourse instance was reachable and valid.
-- Prose GraphQL Discourse API --
forwarding Discourse requests to https://users.rust-lang.org
💡 🧘 Yoga - Running GraphQL Server at http://0.0.0.0:8999/graphql
After that, in a separate shell, start Expo to run the frontend app:
$ cd frontend
$ yarn start
You should see the typical Expo output with a QR code that you can scan from your mobile device to open the app, as well as some output similar to this:
Starting project at lexicon/frontend
Starting Metro Bundler
...
› Metro waiting on exp://192.168.0.53:19000
› Scan the QR code above with Expo Go (Android) or the Camera app (iOS)
...
Logs for your project will appear below. Press Ctrl+C to exit.
Started Metro Bundler
Once you've scanned the QR code on your mobile device, you will be instructed to download Expo / Expo Go if you haven't already.
After that, you should be able to open the Lexicon frontend on your mobile device via the QR code, and will be able to interact with the Discourse site you configured Prose to connect to.
With official support, you get expert help straight from the core team. We provide dedicated support, prioritize feature requests, deployment strategies, advice on best practices, design decisions, and team augmentation. Reach out to us for consulting at support@kodefox.com.
The full documentation for Lexicon is located at docs.lexicon.is.
If you'd like to contribute to it, or just want to browse it locally, you can run the following command from the project root:
yarn docs:install
yarn docs:start