diff --git a/README.md b/README.md new file mode 100644 index 0000000..ab92c9e --- /dev/null +++ b/README.md @@ -0,0 +1,88 @@ +# Action-Reaction + +## Create an Automation Platform (similar to IFTTT / Zapier) + +## 📌 Overview + +Action-Reaction is an automation platform designed to connect services together. +Users can define **AREAs** (*Action + REAction*) that automatically execute when certain events occur. + +The system is composed of three main parts: + +- **Application Server**: Business logic & REST API. +- **Web Client**: Browser-based UI, communicates with the server. +- **Mobile Client**: Android app, communicates with the server. + +--- + +## ✨ Features + +- User registration & authentication (password-based + OAuth2). +- Service subscription (Google, Outlook, Dropbox, etc.). +- Action components (event triggers). +- REAction components (automated tasks). +- AREAs: link Actions to REActions. +- Hooks: monitor & trigger automation. + +--- + +## 🏗 Architecture + +- **Server**: Runs business logic, exposes REST API (`http://localhost:8080`). +- **Web Client**: User interface (`http://localhost:8081`). +- **Mobile Client**: Android application, distributed via APK. +- **Docker Compose**: Orchestration of all components. + +--- + +## 🚀 Getting Started + +### Prerequisites + +- [Docker](https://docs.docker.com/get-docker/) +- [Docker Compose](https://docs.docker.com/compose/) + +### Installation + + - **Step 1**: Go to back and a create a \`config.toml\` file. Fill it based on the data in exemples/exemple_config: + The `jwt_secret` is an ascii string. + Create an `uri` (or copy for exemples/exemple_config) and fill it with `"sqlite+aiosqlite:///app.db"`. + Each routes is defined following that structure: [routes.{service}]. The list of services can be found in back/app/routes. + For each routes fill the `client_id` and `client_secret` with your own. + Note for caldav/gmail/youtube, use the same `client_id`/`client_secret`. The `client_id` must finish with `.apps.googleusercontent.com`. + + +- **Step 2**: Go to front and create a \`gradle.properties\` file. Fill it with the informations in exemples/exemple_gradle. Fill `RELEASE_STORE_PASSWORD` and `RELEASE_KEY_PASSWORD` with your own password. The two must have an identical one. + +- **Step 3**: In your terminal run `keytool -genkey -v -keystore apk_key.jks -keyalg RSA -keysize 2048 -validity 10000 -alias alias;`. +It will ask for a keystore password, put the one you chose for the second step. It will follow by asking more information; those information don't need to be necesarilly true. +Enter 'y' to confirm the datas you entered. + +- **Step 4**: Run `docker compose up --build` + + +### Services + +- Server -> `http://localhost:8080/about.json` +- Web Client -> `http://localhost:8081/` +- Mobile Client APK -> YES + +--- + +## 📜 API Example: `about.json` + +WIP + +--- + +## 📅 Project Timeline + +- **21/09/2025**: Tech stack selection, PoC, task distribution. +- **06/10/2025**: Core architecture & base functionality. +- **02/11/2025**: Full feature set, UI, Docker deployment. + +--- + +## 📖 Documentation + +- **API**: http://localhost:8080/docs diff --git a/examples/example_config b/examples/example_config new file mode 100644 index 0000000..c279c1e --- /dev/null +++ b/examples/example_config @@ -0,0 +1,54 @@ +[security] +jwt_secret = "" + +[db] +uri="sqlite+aiosqlite:///app.db" + + +[routes.discord] +client_id = "" +client_secret = "" + +[routes.spotify] +# scope = "user-read-email user-read-currently-playing user-follow-read" +client_id = "" +client_secret = "" + +[routes.gmail] +# Provide your Google OAuth 2.0 Web client credentials +# Ensure the redirect URI http://127.0.0.1:8080/gmail/auth is added in Google Cloud Console +client_id = "" +client_secret = "" +# Optional: override scope or redirect URI here if needed +# scope = "https://www.googleapis.com/auth/gmail.readonly openid email profile" +# redirect_uri = "http://127.0.0.1:8080/gmail/auth" + +[routes.caldav] +# Uses Google OAuth credentials (you can reuse the same client as Gmail/YouTube) +# Add redirect URI: http://127.0.0.1:8080/caldav/auth +client_id = "" +client_secret = "" +# Optional overrides +# scope = "https://www.googleapis.com/auth/calendar.readonly openid email profile" +# redirect_uri = "http://127.0.0.1:8080/caldav/auth" + +[routes.youtube] +# Create OAuth credentials at https://console.cloud.google.com/apis/credentials +# Add http://127.0.0.1:8080/youtube/auth as an authorized redirect URI +client_id = "-." +client_secret = "" +# Optional overrides +# scope = "https://www.googleapis.com/auth/youtube.readonly openid email profile" +# redirect_uri = "http://127.0.0.1:8080/youtube/auth" + +[routes.reddit] +# Create a Reddit app at https://www.reddit.com/prefs/apps +# For local dev, use type: installed app (or web app) and add redirect URI: +# http://127.0.0.1:8080/reddit/auth +# Note: Installed apps have no secret; keep client_secret empty. Web apps have a secret. +client_id = "" +client_secret = "" +# Optional overrides: +# scope = "identity read" +# redirect_uri = "http://127.0.0.1:8080/reddit/auth" +# resource_headers.User-Agent should be descriptive; override via code if needed \ No newline at end of file diff --git a/examples/example_gradle b/examples/example_gradle new file mode 100644 index 0000000..5b9f34c --- /dev/null +++ b/examples/example_gradle @@ -0,0 +1,26 @@ +# Project-wide Gradle settings. + +# IDE (e.g. Android Studio) users: +# Gradle settings configured through the IDE *will override* +# any settings specified in this file. + +# For more details on how to configure your build environment visit +# http://www.gradle.org/docs/current/userguide/build_environment.html + +# Specifies the JVM arguments used for the daemon process. +# The setting is particularly useful for tweaking memory settings. +org.gradle.jvmargs=-Xmx1536m + +# When configured, Gradle will run in incubating parallel mode. +# This option should only be used with decoupled projects. More details, visit +# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects +# org.gradle.parallel=true + +# AndroidX package structure to make it clearer which packages are bundled with the +# Android operating system, and which are packaged with your app's APK +# https://developer.android.com/topic/libraries/support-library/androidx-rn +android.useAndroidX=true +RELEASE_STORE_FILE=/build/apk_key.jks +RELEASE_STORE_PASSWORD=xxxxxx +RELEASE_KEY_ALIAS=alias +RELEASE_KEY_PASSWORD=xxxxxx \ No newline at end of file