Skip to content

raprapchh/AREA

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

AREA – Automation Platform

An IFTTT-style automation platform that connects multiple services (Google, Discord, Outlook, GitHub, Spotify, etc.) to trigger reactions based on actions. Built with Go backend, Vue 3 web client, and React Native mobile app.

πŸ“š User Documentation

For a complete user guide covering installation, OAuth configuration, step-by-step workflows for Web and Mobile, and troubleshooting, see:

  • documentation/USER_GUIDE.md

For developer documentation, see:

  • documentation/DEVELOPER_GUIDE.md - Architecture, API reference, and service integration guide
  • documentation/HOWTOCONTRIBUTE.md - Contribution guidelines and Git workflow

πŸ›  Technologies

  • Backend: Go (Gin, GORM), OAuth 2.0, JWT authentication
  • Database: PostgreSQL with GORM migrations
  • Web Client: Vue 3, Vite, TypeScript, Nginx
  • Mobile Client: React Native via Expo
  • Containerization: Docker, Docker Compose
  • Testing: Cypress (E2E and component testing for web)

πŸš€ Quick Start (Docker - Recommended)

  1. Clone the repository:

    git clone <repository-url>
    cd G-DEV-500-PAR-5-1-area-6
  2. Create a .env file at the root (optional, see OAuth configuration section):

    WEB_PUBLIC_BASE_URL=http://localhost:8081
    OAUTH_PUBLIC_BASE_URL=http://localhost:8081
    MOBILE_API_BASE_URL=http://localhost:8080
  3. Build and start all services:

    docker compose up --build
  4. Access the services:

The database is automatically migrated and seeded with services, actions, and reactions on first startup.

πŸ”§ Development Setup (without Docker)

Prerequisites

  • Docker and Docker Compose (for quick start)
  • Node.js 20.19+ (or 22.12+) for web client
  • Node.js 18+ for mobile client
  • Go 1.21+ for server
  • Expo CLI (via npm i -g expo-cli or npx expo)

API Server (Go)

cd server
go mod download
go run .

The API listens on :8080 by default.

Web Client (Vite)

cd client_web
npm install
npm run dev

Access the interface at the URL shown in the terminal (typically http://localhost:5173).

Mobile Client (Expo)

cd client_mobile
npm install
npm start

Scan the QR code with Expo Go app or launch a simulator. The mobile app auto-detects the LAN IP; you can also force the API URL if needed.

✨ Features

Authentication

  • JWT-based authentication
  • OAuth login with Google and GitHub
  • Email/password registration and login
  • Token refresh mechanism
  • User profile management

Service Integration

The platform supports 20+ integrated services:

  • Google Services: Gmail, Drive, Calendar, Sheets, Tasks
  • Microsoft: Outlook
  • Communication: Discord, LinkedIn
  • Code Management: GitHub, GitLab
  • Productivity: Notion, Trello, Todoist
  • Storage: Dropbox
  • Social Media: X (Twitter), Reddit, Dribbble, Twitch
  • Entertainment: Spotify
  • Built-in: Timer, Weather

AREA Management

  • Create, list, update, and delete AREAs
  • Activate/deactivate AREAs
  • Manual trigger for testing
  • Favorite AREAs
  • Execution history
  • Parameter management for actions and reactions
  • Real-time polling hooks for trigger detection

OAuth Connections

  • Connect and disconnect service accounts
  • OAuth 2.0 flow for all supported services
  • Token refresh management
  • Connection status checking
  • Service-specific OAuth configurations

Webhooks

  • Webhook endpoints for services that support it
  • Webhook logging and debugging
  • Test webhook functionality

User Management

  • User profile (view and update)
  • Account deletion
  • Service subscriptions
  • Admin panel (user management, system stats)

Testing Infrastructure

  • Web Client: Cypress E2E tests and component tests
    • E2E tests: npm run test:e2e (interactive) or npm run test:e2e:headless
    • Component tests: npm run test:component (interactive) or npm run test:component:headless

πŸ“– Code References

  • AREA Handlers: server/internal/handlers/areas.go
  • OAuth Connections: server/internal/handlers/oauth_connections.go
  • Service Connectors: server/internal/connectors/ (drive.go, gmail.go, discord.go, etc.)
  • API Client (Web): client_web/src/services/api.ts
  • API Client (Mobile): client_mobile/src/services/api.ts
  • Docker Orchestration: docker-compose.yml
  • Web Router: client_web/src/router/index.ts
  • Mobile Screens: client_mobile/src/screens/

πŸ” OAuth Configuration

For production use, configure OAuth credentials in your .env file or Docker environment variables:

Google OAuth

  • GOOGLE_CLIENT_ID
  • GOOGLE_CLIENT_SECRET
  • GOOGLE_LOGIN_REDIRECT_URL
  • GOOGLE_OAUTH_REDIRECT_URL
  • GOOGLE_LOGIN_REDIRECT_URL_MOBILE
  • GOOGLE_OAUTH_REDIRECT_URL_MOBILE

Discord OAuth

  • DISCORD_CLIENT_ID
  • DISCORD_CLIENT_SECRET
  • DISCORD_REDIRECT_URL

Microsoft/Outlook OAuth

  • MICROSOFT_CLIENT_ID
  • MICROSOFT_CLIENT_SECRET
  • MICROSOFT_REDIRECT_URL
  • MICROSOFT_TENANT

GitHub OAuth

  • GITHUB_CLIENT_ID
  • GITHUB_CLIENT_SECRET
  • GITHUB_LOGIN_REDIRECT_URL
  • GITHUB_OAUTH_REDIRECT_URL
  • GITHUB_LOGIN_REDIRECT_URL_MOBILE
  • GITHUB_OAUTH_REDIRECT_URL_MOBILE

And similar variables for other services (Spotify, Dropbox, Notion, X, Trello, LinkedIn, Twitch, Reddit, GitLab, Todoist, Dribbble).

See server/internal/config/config.go for the complete list of required environment variables.

Note: Default local values exist for development, but create OAuth applications in respective developer portals for production use.

πŸ“ Project Structure

.
β”œβ”€β”€ server/              # Go backend
β”‚   β”œβ”€β”€ cmd/main.go     # Entry point
β”‚   β”œβ”€β”€ internal/
β”‚   β”‚   β”œβ”€β”€ handlers/   # API handlers
β”‚   β”‚   β”œβ”€β”€ connectors/ # Service connectors (20+ services)
β”‚   β”‚   β”œβ”€β”€ models/     # Database models
β”‚   β”‚   β”œβ”€β”€ services/   # Business logic
β”‚   β”‚   β”œβ”€β”€ middleware/ # Auth, CORS middleware
β”‚   β”‚   └── config/     # Configuration
β”‚   └── pkg/auth/       # JWT authentication
β”œβ”€β”€ client_web/         # Vue 3 web application
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ pages/      # Route pages
β”‚   β”‚   β”œβ”€β”€ components/ # Vue components
β”‚   β”‚   β”œβ”€β”€ services/   # API client
β”‚   β”‚   └── router/     # Vue Router
β”‚   └── cypress/        # E2E and component tests
β”œβ”€β”€ client_mobile/      # React Native (Expo)
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ screens/    # App screens
β”‚   β”‚   β”œβ”€β”€ services/   # API client
β”‚   β”‚   └── contexts/   # React contexts
β”‚   └── app/            # Expo Router
β”œβ”€β”€ documentation/      # User and developer guides
└── docker-compose.yml  # Docker orchestration

πŸ§ͺ Testing

Web Client Tests

E2E Tests:

cd client_web
npm run test:e2e          # Interactive mode
npm run test:e2e:headless # Headless mode

Component Tests:

cd client_web
npm run test:component          # Interactive mode
npm run test:component:headless # Headless mode

See client_web/cypress/README.md and client_web/cypress/COMPONENT_TESTING.md for detailed testing documentation.

🚒 Deployment

The project is containerized with Docker Compose. Key services:

  • postgres: PostgreSQL database (port 5433 on host)
  • pgadmin: Database administration UI (port 5050)
  • server: Go API server (port 8080)
  • client_web: Vue app served via Nginx (port 8081)
  • client_mobile: Expo build container

For production deployment, configure:

  • Environment variables in .env
  • OAuth redirect URLs for your domain
  • Database credentials
  • SSL/TLS certificates if needed

πŸ‘₯ Authors

  • Hubert Touraine - Project Owner
  • RaphaΓ«l Chanliongco - Scrum Master
  • Jean-Baptiste Boshra - Developer
  • Gabin Rudigoz - Developer

🀝 Contributing

See documentation/HOWTOCONTRIBUTE.md for contribution guidelines, Git workflow, and code quality requirements.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors