-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #147 from ASM-Studios/dev
Dev
- Loading branch information
Showing
158 changed files
with
9,990 additions
and
2,343 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,9 @@ | ||
VITE_PORT=8081 | ||
NODE_ENV=development # development or production | ||
VITE_PORT=8081 | ||
|
||
# Server database environment variables | ||
DB_NAME=area | ||
DB_PASSWORD=change-me | ||
DB_HOST=mariadb | ||
DB_PORT=3306 | ||
DB_USER=root |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -136,3 +136,5 @@ dist | |
.yarn/build-state.yml | ||
.yarn/install-state.gz | ||
.pnp.* | ||
|
||
ssl/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,11 +6,11 @@ With AREA, you can create automated workflows that integrate various services an | |
## Table of Contents | ||
|
||
- [Getting Started](#getting-started) | ||
- [Prerequisites](#prerequisites) | ||
- [Installation & Usage](#installation--usage) | ||
- [Prerequisites](#prerequisites) | ||
- [Installation & Usage](#installation--usage) | ||
- [Documentation](#documentation) | ||
- [Requirements](#requirements) | ||
- [Usage](#usage) | ||
- [Requirements](#requirements) | ||
- [Usage](#usage) | ||
- [Tests](#tests) | ||
- [License](#license) | ||
- [Contributors](#contributors) | ||
|
@@ -19,50 +19,39 @@ With AREA, you can create automated workflows that integrate various services an | |
|
||
### Prerequisites | ||
|
||
- vite js | ||
- go | ||
- docker | ||
- make | ||
|
||
### Installation & Usage | ||
|
||
<details> | ||
<summary>Click to expand</summary> | ||
|
||
1. Clone the repo | ||
|
||
```sh | ||
git clone [email protected]:ASM-Studios/AREA.git | ||
``` | ||
|
||
2. Create .env files | ||
|
||
- Run the following command to create private env files | ||
|
||
```sh | ||
cp .env.example .env | ||
cp server/.env.server.example server/.env.server | ||
cp client_web/.env.local.example .env.local | ||
cp client_mobile/.env.mobile.example .env.mobile | ||
``` | ||
|
||
- Fill the .env, .env.web and .env.mobile files | ||
|
||
3. Install NPM packages | ||
```sh | ||
cd AREA/client-web | ||
npm install | ||
``` | ||
4. Run the project | ||
|
||
3. Install Go packages | ||
```sh | ||
cd AREA/server | ||
<TODO> | ||
make start | ||
``` | ||
|
||
4. Run the project | ||
```sh | ||
cd AREA/client-web | ||
npm run start | ||
``` | ||
```sh | ||
cd AREA/server | ||
go run ./... | ||
``` | ||
</details> | ||
|
||
### Documentation | ||
|
@@ -87,6 +76,7 @@ The documentation is automatically built and deployed to GitHub Pages when a pus | |
You can consult the documentation online at [AREA Documentation](https://asm-studios.github.io/AREA/). | ||
|
||
You can build the documentation locally by running the following command: | ||
|
||
```sh | ||
cd AREA/docs | ||
make docs | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,43 @@ | ||
FROM ghcr.io/cirruslabs/flutter:stable | ||
FROM ghcr.io/cirruslabs/flutter:3.24.5 AS builder | ||
|
||
WORKDIR /app | ||
|
||
ARG VITE_PORT | ||
ARG VITE_ENDPOINT | ||
ARG VITE_GOOGLE_CLIENT_ID | ||
ARG VITE_GOOGLE_CLIENT_SECRET | ||
ARG VITE_MICROSOFT_CLIENT_ID | ||
ARG VITE_LINKEDIN_CLIENT_ID | ||
ARG VITE_LINKEDIN_CLIENT_SECRET | ||
ARG VITE_SPOTIFY_CLIENT_ID | ||
ARG VITE_SPOTIFY_CLIENT_SECRET | ||
# Create a non-root user and give permissions to Android SDK directory | ||
RUN useradd -m -d /home/flutteruser -s /bin/bash flutteruser && \ | ||
chown -R flutteruser:flutteruser /app && \ | ||
chown -R flutteruser:flutteruser /sdks/flutter && \ | ||
chown -R flutteruser:flutteruser /opt/android-sdk-linux && \ | ||
mkdir -p /opt/android-sdk-linux/licenses && \ | ||
chown -R flutteruser:flutteruser /opt/android-sdk-linux/licenses | ||
|
||
USER flutteruser | ||
|
||
RUN git config --global --add safe.directory /sdks/flutter && \ | ||
git config --global --add safe.directory /app | ||
|
||
# Ensure Flutter is properly set up | ||
RUN flutter doctor -v && \ | ||
flutter config --no-analytics | ||
|
||
COPY --chown=flutteruser:flutteruser pubspec.* ./ | ||
|
||
RUN flutter pub get | ||
|
||
COPY --chown=flutteruser:flutteruser . . | ||
|
||
ARG API_URL | ||
ARG WEB_CLIENT_URL | ||
ARG MOBILE_CLIENT_URL | ||
ARG GITHUB_CLIENT_ID | ||
ARG GITHUB_CLIENT_SECRET | ||
|
||
COPY . . | ||
# Accept Android licenses and install SDK components | ||
RUN yes | sdkmanager --licenses && \ | ||
sdkmanager "build-tools;30.0.3" | ||
|
||
RUN flutter pub get | ||
RUN flutter build apk --release | ||
# Clean and get dependencies again after copying all files | ||
RUN flutter clean && \ | ||
flutter pub get | ||
|
||
RUN mv build/app/outputs/flutter-apk/app-release.apk build/app/outputs/flutter-apk/client.apk | ||
RUN chmod -R 755 build/app/outputs/flutter-apk/ | ||
RUN flutter build apk --release | ||
RUN mv build/app/outputs/flutter-apk/app-release.apk build/app/outputs/flutter-apk/client.apk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import 'package:client_mobile/data/parameter.dart'; | ||
|
||
class WorkflowActionReaction { | ||
final int id; | ||
final String name; | ||
final String description; | ||
final List<Parameter> parameters; | ||
String? serviceName; | ||
int? serviceId; | ||
|
||
WorkflowActionReaction({ | ||
required this.id, | ||
required this.name, | ||
required this.description, | ||
required this.parameters, | ||
this.serviceName, | ||
this.serviceId | ||
}); | ||
|
||
factory WorkflowActionReaction.fromJson(Map<String, dynamic> json) { | ||
return WorkflowActionReaction( | ||
id: json['id'], | ||
name: json['name'], | ||
description: json['description'] ?? "", | ||
parameters: json['parameters'] != null | ||
? (json['parameters'] as List) | ||
.map((param) => Parameter.fromJson(param)) | ||
.toList() | ||
: [], | ||
); | ||
} | ||
|
||
Map<String, dynamic> toJson(String type) { | ||
return { | ||
'id': id, | ||
'name': name, | ||
'type': type, | ||
'description': description, | ||
'parameters': parameters.map((p) => p.toJson()).toList(), | ||
}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
class Parameter { | ||
final String name; | ||
final String description; | ||
final String type; | ||
String? value; | ||
|
||
Parameter({ | ||
required this.name, | ||
required this.description, | ||
required this.type, | ||
this.value, | ||
}); | ||
|
||
factory Parameter.fromJson(Map<String, dynamic> json) { | ||
return Parameter( | ||
name: json['name'], | ||
description: json['description'] ?? "", | ||
type: json['type'], | ||
); | ||
} | ||
|
||
Map<String, dynamic> toJson() { | ||
return { | ||
'name': name, | ||
'type': type, | ||
'value': value | ||
}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import 'package:client_mobile/data/action.dart'; | ||
|
||
class WorkflowService { | ||
final int id; | ||
final String name; | ||
final List<WorkflowActionReaction> actions; | ||
final List<WorkflowActionReaction> reactions; | ||
|
||
WorkflowService({ | ||
required this.id, | ||
required this.name, | ||
required this.actions, | ||
required this.reactions, | ||
}); | ||
|
||
factory WorkflowService.fromJson(Map<String, dynamic> json) { | ||
try { | ||
return WorkflowService( | ||
id: json['id'] ?? 0, | ||
name: json['name'] ?? | ||
'Unknown', | ||
actions: _parseActionsOrReactions(json['actions']), | ||
reactions: _parseActionsOrReactions(json['reactions']), | ||
); | ||
} catch (e) { | ||
print('Error parsing WorkflowService: $e'); | ||
return WorkflowService( | ||
id: 0, name: 'Unknown', actions: [], reactions: []); | ||
} | ||
} | ||
|
||
static List<WorkflowActionReaction> _parseActionsOrReactions(dynamic data) { | ||
if (data == null) { | ||
return []; | ||
} | ||
if (data is List) { | ||
return data.map((item) => WorkflowActionReaction.fromJson(item)).toList(); | ||
} else { | ||
print('Expected a list for actions or reactions, but got: $data'); | ||
return []; | ||
} | ||
} | ||
|
||
Map<String, dynamic> toJson() { | ||
return { | ||
'id': id, | ||
'name': name, | ||
'actions': actions.map((a) => a.toJson("action")).toList(), | ||
'reactions': reactions.map((r) => r.toJson("reaction")).toList(), | ||
}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
class ServiceMetadata { | ||
final String name; | ||
final Color color; | ||
final String imagePath; | ||
|
||
ServiceMetadata({ | ||
required this.name, | ||
required this.color, | ||
required this.imagePath, | ||
}); | ||
|
||
static List<ServiceMetadata> services = [ | ||
ServiceMetadata( | ||
name: "spotify", | ||
color: Colors.green, | ||
imagePath: 'assets/images/spotify.png'), | ||
ServiceMetadata( | ||
name: "discord", | ||
color: Colors.lightBlue, | ||
imagePath: 'assets/images/discord.png'), | ||
ServiceMetadata( | ||
name: "microsoft", | ||
color: Colors.grey, | ||
imagePath: 'assets/images/microsoft.png'), | ||
ServiceMetadata( | ||
name: "google", | ||
color: Colors.amber, | ||
imagePath: 'assets/images/google.png'), | ||
]; | ||
|
||
static ServiceMetadata? getServiceByName(String name) { | ||
return services.firstWhere((service) => service.name == name); | ||
} | ||
} |
Oops, something went wrong.