{"id":20187493,"url":"https://github.com/wordpress-mobile/wordpress-fluxc-android","last_synced_at":"2025-04-10T06:44:02.598Z","repository":{"id":37470623,"uuid":"48792991","full_name":"wordpress-mobile/WordPress-FluxC-Android","owner":"wordpress-mobile","description":"WordPress Network and Persistence layer based on the Flux architecture","archived":false,"fork":false,"pushed_at":"2024-05-22T18:58:27.000Z","size":33229,"stargazers_count":58,"open_issues_count":154,"forks_count":37,"subscribers_count":10,"default_branch":"trunk","last_synced_at":"2024-05-23T01:05:45.171Z","etag":null,"topics":["android","flux-capacitor","library","networking","persistence","wordpress"],"latest_commit_sha":null,"homepage":null,"language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wordpress-mobile.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-12-30T09:21:57.000Z","updated_at":"2024-08-23T22:01:26.979Z","dependencies_parsed_at":"2023-10-16T13:24:35.243Z","dependency_job_id":"becba7ff-ebe1-4df8-933e-ef7cd78c471a","html_url":"https://github.com/wordpress-mobile/WordPress-FluxC-Android","commit_stats":null,"previous_names":[],"tags_count":396,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wordpress-mobile%2FWordPress-FluxC-Android","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wordpress-mobile%2FWordPress-FluxC-Android/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wordpress-mobile%2FWordPress-FluxC-Android/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wordpress-mobile%2FWordPress-FluxC-Android/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wordpress-mobile","download_url":"https://codeload.github.com/wordpress-mobile/WordPress-FluxC-Android/tar.gz/refs/heads/trunk","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248173641,"owners_count":21059595,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","flux-capacitor","library","networking","persistence","wordpress"],"created_at":"2024-11-14T03:24:20.185Z","updated_at":"2025-04-10T06:44:02.580Z","avatar_url":"https://github.com/wordpress-mobile.png","language":"Kotlin","readme":"# 🚨 Repository Archived 🚨\n\n\u003e [!WARNING]\n\u003e **This repository has been archived** because its functionality has been merged into its only two former clients: [WordPress/Jetpack](https://github.com/wordpress-mobile/WordPress-Android) and [WooCommerce](https://github.com/woocommerce/woocommerce-android). Future development will continue in those repositories.\n\n---\n\n# WordPress-FluxC-Android\n\nWordPress-FluxC-Android is a networking and persistence library that helps to connect and sync data from a WordPress site (self hosted, or wordpress.com site).\n\nBased on the [Flux][1] pattern, we're using: [Dagger2][2] for dependency injection, [WellSql][3] for persistence.\n\nFluxC is pronounced ‘fluxy’, and stands for ‘Flux Capacitor’. This makes a double reference to the architecture model (since a capacitor is a kind of storage unit, or ‘store’). More importantly, a flux capacitor is the core component of the DeLorean time machine in [Back to the Future](https://en.wikipedia.org/wiki/Back_to_the_Future), which ‘makes time travel possible.’\n\n**Most of our documentation for using and contributing to FluxC can be found in our [wiki](https://github.com/wordpress-mobile/WordPress-FluxC-Android/wiki).**\n\n## Using FluxC as a library\n\nPlease see our [Using FluxC](https://github.com/wordpress-mobile/WordPress-FluxC-Android/wiki/Using-FluxC#initial-setup) wiki page for setup instructions.\n\n## Building the library\n\nThe gradle build system will fetch all dependencies and generate\nfiles you need to build the project. You first need to generate the\nlocal.properties (replace YOUR_SDK_DIR with your actual android SDK directory)\nfile and create the gradle.properties file. The easiest way is to copy\nour example:\n\n    $ echo \"sdk.dir=YOUR_SDK_DIR\" \u003e local.properties\n    $ cp gradle.properties-example gradle.properties\n    $ ./gradlew fluxc:build\n\n## Building and running tests and the example app\n\n    $ cp -a example/properties-example/ example/properties/\n    $ ./gradlew cAT       # Regression tests\n    $ ./gradlew testDebug # Unit tests\n\nNote: this uses the default `example/properties/api.properties` file. You'll have to get\na [WordPress.com OAuth2 ID and secret](#oauth2-authentication).\n\nWe have some tests connecting to real HTTP servers, URL and credentials are defined in `example/properties/tests.properties`, you must edit it or obtain the real file to run the tests.\n\nPlease note that, unless using special credentials which cannot be shared publicly, some of the WordPress.com connected tests will not pass unless the OAuth2 ID and secret are registered to the account that the test is attempting to log into.\n\n## OAuth2 Authentication\n\nTo test with your own OAuth2 ID and Secret you will need to create an application or view the details for your existing application with our [WordPress.com applications manager][7].\n\nWhen creating your application, you should select \"Native client\" for the application type. The applications manager currently requires a \"redirect URL\", but this isn't used for mobile apps. Just use \"https://localhost\".\n\nOnce you've created your application in the [applications manager][7], you'll need to edit the `example/properties/api.properties` file and change the `wp.OAUTH.APP.ID` and `wp.OAUTH.APP.SECRET` fields.\n\n## Setting up Checkstyle\n\nThe FluxC project uses [Checkstyle](http://checkstyle.sourceforge.net/). You can run checkstyle using `./gradlew checkstyle`.  You can also view errors and warnings in realtime with the Checkstyle plugin.  When importing the project into Android Studio, Checkstyle should be set up automatically.  If it is not, follow the steps below.\n\nYou can install the CheckStyle-IDEA plugin in Android Studio here:\n\n`Android Studio \u003e Preferences... \u003e Plugins \u003e CheckStyle-IDEA`\n\nOnce installed, you can configure the plugin here:\n\n`Android Studio \u003e Preferences... \u003e Tools \u003e Checkstyle`\n\nFrom there, add and enable the configuration file for FluxC, located at [config/checkstyle.xml](https://github.com/wordpress-mobile/WordPress-FluxC-Android/blob/trunk/config/checkstyle.xml).\n\n## Using Detekt\n\nThe FluxC project uses [detekt](https://github.com/detekt/detekt) for Kotlin linting and code style check.\n\nYou can run detekt using `./gradlew detekt`.\n\nYou can also view errors and warnings in realtime with the Detekt plugin.\n\nYou can install the detekt plugin in Android Studio here:\n\n`Android Studio \u003e Preferences... \u003e Plugins \u003e detekt`\n\nOnce installed, you can configure the plugin here:\n\n`Android Studio \u003e Preferences... \u003e Tools \u003e Detekt`\n\nFrom there, add and enable the custom configuration file, located at [config/detekt/detekt.yml](https://github.com/wordpress-mobile/WordPress-FluxC-Android/blob/trunk/config/detekt/detekt.yml).\n\nIf you want to use the **AutoCorrect** feature of the plugin, make sure that the option `Enable formatting (ktlint) rules` is enabled in the above settings, then you will be able to reformat any file according to detekt's rules using the refactor menu `AutoCorrect by Detekt Rules`\n\n## Contributing\n\n### Actions\n\nEach store should have a corresponding enum defining actions for that store. For example, [SiteStore][4]'s actions are defined in the [SiteAction][5] enum.\n\nAction naming guide:\n\n    FETCH_X - request data from the server\n    PUSH_X - send data to the server\n    UPDATE_X - local change\n    REMOVE_X - local remove\n    DELETE_X - request deletion on the server\n\nEach action enum should be annotated with `@ActionEnum`, with individual actions receiving an `@Action` annotation with an optional `payloadType` setting (see [SiteAction][5] for an example).\n\n### Endpoints\n\nEndpoints for each of the supported APIs are centralized in a generated endpoint file: `WPCOMREST.java` and `XMLRPC.java` (also `WPAPI.java`).\n\nTo add a new endpoint, first add it to the appropriate `fluxc-processor/src/main/resources/*.txt` file, and then rebuild the project to update the generated (Java) endpoint file.\n\nNote that, for WordPress.com REST API endpoints, the final endpoint will be normalized to include a trailing slash.\n\n\n#### Response Models\n\nCreate a class implementing `Response` interface in a corresponding package in `org.wordpress.android.fluxc.network.rest` tree.\n\nPrefer using nullable types in response models to prevent crashes when the API changes. Map nullable types to non-nullable types (if applicable) when mapping response models to domain models.\n\n\n### On Changed Events\n\nAll On Changed Events extend the OnChanged class. They encapsulate an `error`\nfield. Events can be checked for an error by calling `event.isError()`.\n\nOn Changed Events naming guide:\n\n    onXChanged(int rowsAffected) - Keep X singular even if multiple X were changed\n    onXRemoved(int rowsAffected) - Keep X singular even if multiple X were removed\n\n## Need help to build or hack?\n\nSay hello on our [Slack][6] channel: `#mobile`.\n\n## LICENSE\n\nWordPress-FluxC-Android is an Open Source project covered by the [GNU General Public License version 2](LICENSE.md).\n\n[1]: https://facebook.github.io/flux/docs/overview/\n[2]: https://google.github.io/dagger/\n[3]: https://github.com/yarolegovich/wellsql\n[4]: https://github.com/wordpress-mobile/WordPress-FluxC-Android/blob/ba9dd84c54b12d53e01dfdb8efb4a18ed8343311/fluxc/src/main/java/org/wordpress/android/fluxc/store/SiteStore.java\n[5]: https://github.com/wordpress-mobile/WordPress-FluxC-Android/blob/ba9dd84c54b12d53e01dfdb8efb4a18ed8343311/fluxc/src/main/java/org/wordpress/android/fluxc/action/SiteAction.java\n[6]: https://make.wordpress.org/chat/\n[7]: https://developer.wordpress.com/apps/\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwordpress-mobile%2Fwordpress-fluxc-android","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwordpress-mobile%2Fwordpress-fluxc-android","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwordpress-mobile%2Fwordpress-fluxc-android/lists"}