An open API service indexing awesome lists of open source software.

https://github.com/badrisinghoo7/temperol-ai

Profile Editor is a full-stack application that allows users to log in, access their profile, update their details, and persist changes through a Temporal workflow โ€” ensuring instant and consistent updates to the database using background job execution.
https://github.com/badrisinghoo7/temperol-ai

auth0 expressjs mongodb nodejs react-router-dom reactjs temporalio

Last synced: 3 months ago
JSON representation

Profile Editor is a full-stack application that allows users to log in, access their profile, update their details, and persist changes through a Temporal workflow โ€” ensuring instant and consistent updates to the database using background job execution.

Awesome Lists containing this project

README

          

# ๐Ÿš€ Profile Editor

**Profile Editor** is a full-stack application that allows users to log in, access their profile, update their details, and persist changes through a Temporal workflow โ€” ensuring instant and consistent updates to the database using background job execution.

## ๐Ÿ›  Tech Stack

- **Frontend:** React + Vite
- **Backend:** Node.js + Express + MongoDB
- **Workflow Orchestration:** [Temporal.io](https://temporal.io/)
- **Containerization:** Docker + Docker Compose

---

## ๐Ÿง  Temporal Workflow Usage

This project leverages **Temporal** to manage the user profile update process in the background. Instead of connecting to the database repeatedly, a **`userUpdateWorkflow`** is triggered on each update, and Temporal handles the persistence and reliability of the update.

---

---

## โœ… Features

* ๐Ÿ” Login using Auth0
* ๐Ÿ‘ค View & update profile details
* โš™๏ธ Backend orchestrated using Temporal workflows
* ๐Ÿง  Async updates with Temporal queue
* ๐Ÿณ Easy Docker-based setup

---

## ๐Ÿง  Temporal Workflow Logic

* User clicks **Update Profile**
* Backend route `/api/users/:id` triggers a **PUT** request
* Temporal client starts a workflow (`updateUserWorkflow`) with task queue `user-queue`
* Temporal worker handles the DB update using activities
* Ensures reliable background execution with retries and monitoring

---

## ๐Ÿ“‚ Folder Structure

```
project-root/
โ”œโ”€โ”€ backend/
โ”‚ โ”œโ”€โ”€ activities/userActivities.ts
โ”‚ โ”œโ”€โ”€ models/User.ts
โ”‚ โ”œโ”€โ”€ routes/userRoutes.ts
โ”‚ โ”œโ”€โ”€ workflows/userWorkflows.ts
โ”‚ โ”œโ”€โ”€ .env
โ”‚ โ””โ”€โ”€ index.ts
โ”œโ”€โ”€ frontend/
โ”‚ โ”œโ”€โ”€ public/
โ”‚ โ”œโ”€โ”€ src/
โ”‚ โ”‚ โ”œโ”€โ”€ assets/
โ”‚ โ”‚ โ”œโ”€โ”€ auth/
โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ auth0-context.ts
โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ AuthProvider.tsx
โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ useAuth0.ts
โ”‚ โ”‚ โ”œโ”€โ”€ Pages/
โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ Profile.css
โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ Profile.tsx
โ”‚ โ”‚ โ”œโ”€โ”€ App.tsx
โ”‚ โ”‚ โ””โ”€โ”€ main.tsx
โ”‚ โ”œโ”€โ”€ index.html
โ”‚ โ”œโ”€โ”€ package.json
โ”‚ โ””โ”€โ”€ package-lock.json
โ”œโ”€โ”€ docker-compose/
โ”‚ โ””โ”€โ”€ docker-compose.yml
โ””โ”€โ”€ README.md
```

---

## ๐Ÿงช Environment Variables

### ๐Ÿ” Frontend (`.env`)
```env
VITE_AUTH0_DOMAIN=dev-0fbpkzbuaedmrghn.us.auth0.com
VITE_AUTH0_CLIENT_ID=hx0sTLTqCvHgEzyCi0ycKqeVFjETyY4I
```

### ๐Ÿ” Backend (`.env`)
```env
MONGO_URI=mongodb+srv://badri:singh@cluster0.frdj16f.mongodb.net/temperolAiDB?retryWrites=true&w=majority&appName=Cluster0
```

### ๐Ÿณ Docker (`docker-compose/.env`)
```env
COMPOSE_PROJECT_NAME=temporal
CASSANDRA_VERSION=3.11.9
ELASTICSEARCH_VERSION=7.17.27
MYSQL_VERSION=8
TEMPORAL_VERSION=1.27.2
TEMPORAL_ADMINTOOLS_VERSION=1.27.2-tctl-1.18.2-cli-1.3.0
TEMPORAL_UI_VERSION=2.34.0
POSTGRESQL_VERSION=16
POSTGRES_PASSWORD=temporal
POSTGRES_USER=temporal
POSTGRES_DEFAULT_PORT=5432
OPENSEARCH_VERSION=2.5.0
```

---

## ๐Ÿš€ Local Development Setup

### 1. Clone the Repository

```bash
https://github.com/badrisinghoo7/Temperol-AI.git
cd Temperol-AI
```

---

### 2. Start Temporal Services via Docker

Clone the official Temporal Docker Compose setup:

```bash
git clone https://github.com/temporalio/docker-compose.git
cd docker-compose
docker-compose up -d
```

> This will start Temporal server and UI.
> Temporal UI: [http://localhost:8080](http://localhost:8080)

---

### 3. Run Backend

```bash
cd backend
npm install
npm run dev
```

> Backend runs on: [http://localhost:5000](http://localhost:5000)

---

### 4. Run Frontend

```bash
cd frontend
npm install
npm run dev
```

> Frontend runs on: [http://localhost:5173](http://localhost:5173)

## โœจ Author

๐Ÿ‘จโ€๐Ÿ’ป [@badrisinghoo7](https://github.com/badrisinghoo7)

---

## ๐Ÿ“œ License

This project is licensed under the MIT License. See `LICENSE` for details.