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.
- Host: GitHub
- URL: https://github.com/badrisinghoo7/temperol-ai
- Owner: badrisinghoo7
- Created: 2025-06-13T13:22:49.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2025-06-13T17:27:01.000Z (4 months ago)
- Last Synced: 2025-06-13T18:26:29.237Z (4 months ago)
- Topics: auth0, expressjs, mongodb, nodejs, react-router-dom, reactjs, temporalio
- Language: TypeScript
- Homepage:
- Size: 83 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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.