Skip to content

Dhriti143/LifePulse

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

34 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

LifePulse

Status Backend Frontend Database Deployment CI%2FCD


🧠 Overview

LifePulse is a full-stack personal productivity and mental wellness system designed to help users track habits, mood patterns, journaling insights, and long-term goals.

It is built using a fully containerized distributed architecture consisting of:

  • React + Vite frontend (Docker container)
  • FastAPI backend (Docker container)
  • PostgreSQL database (Docker volume persistence)
  • Nginx reverse proxy
  • CI/CD pipeline via GitHub Actions
  • AWS EC2 deployment

The project demonstrates production-grade engineering practices including asynchronous APIs, modular architecture, secure authentication, and automated cloud deployment.


πŸš€ Key Features

πŸ“ Personal Journaling

Daily journaling system for self-reflection and emotional tracking.

πŸ” Habit Tracking

  • Streak-based logic
  • Calendar-based visualization
  • Persistent progress history

😊 Mood Tracking

  • Daily mood logging
  • Trend visualization
  • Emotional pattern analysis

πŸ“Š Smart Dashboard

Unified overview of:

  • Habits
  • Journals
  • Mood trends
  • Daily progress

πŸ’‘ Daily Inspiration

External API integration for motivational quotes

πŸ” Authentication System

  • JWT-based authentication
  • Secure password hashing (bcrypt)
  • Protected API routes

πŸ—οΈ System Architecture

                β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                β”‚   React Frontend Container  β”‚
                β”‚     (Vite + React)         β”‚
                β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                             β”‚ /api
                             β–Ό
                β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                β”‚        Nginx Proxy         β”‚
                β”‚  (Reverse Proxy Layer)     β”‚
                β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                             β”‚
                β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                β”‚     FastAPI Backend         β”‚
                β”‚   (Docker Container)        β”‚
                β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                             β”‚
                β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                β”‚   PostgreSQL Database       β”‚
                β”‚ (Docker + Persistent Volume)β”‚
                β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

🌐 Production Request Flow (AWS EC2)

In production, the system runs behind an Nginx reverse proxy on AWS EC2.

Browser
   ↓
https://your-domain.com (or EC2 Public IP)
   ↓
Nginx (port 80 / 443)
   β”œβ”€β”€ / β†’ React Frontend Container
   └── /api β†’ FastAPI Backend Container (port 8000)

πŸ” API Communication Flow

Frontend calls:

fetch("/api/users")

Nginx internally forwards it to:

http://backend:8000/users

The backend is NOT exposed directly to the internet.


πŸ”’ Why This Architecture

  • Prevents CORS issues completely
  • Single domain for frontend + backend
  • Backend remains private
  • Fully containerized microservice-style architecture
  • Clean reverse proxy routing with Nginx
  • Production-grade deployment pattern
  • Scalable via Docker Compose

🧱 Tech Stack

Frontend

  • React 19
  • Vite
  • TypeScript
  • Tailwind CSS v4
  • Context API + Hooks
  • Lucide Icons

Backend

  • FastAPI (Python 3.11+)
  • SQLModel ORM
  • PostgreSQL 15
  • JWT Authentication
  • Alembic migrations
  • Passlib (bcrypt hashing)

DevOps & Infrastructure

  • Docker & Docker Compose
  • Nginx reverse proxy
  • GitHub Actions CI/CD
  • AWS EC2 deployment

🐳 Infrastructure Model

  • React frontend runs in a Docker container
  • FastAPI backend runs in a separate container
  • PostgreSQL runs with persistent Docker volume storage
  • Nginx acts as a single entry point (reverse proxy)
  • All services communicate over a Docker internal network

⚠️ Docker Image Naming Clarification

The GitHub repository name and Docker image names are intentionally different.

  • GitHub Repository: LifePulse

  • Docker Images:

    • neonbluewhale/rumi-frontend
    • neonbluewhale/rumi-backend

Why this exists:

  • Docker images are published under a Docker Hub namespace
  • Image naming originated from an earlier project structure
  • CI/CD pipeline is independent of repository naming
  • This does NOT affect functionality or deployment

πŸ”„ CI/CD Pipeline (GitHub Actions)

Automated workflow:

  1. Trigger on push or PR to frontend/ or backend/
  2. Build Docker images for services
  3. Push images to Docker Hub
  4. SSH into AWS EC2 instance
  5. Pull latest images
  6. Restart services using docker compose up -d

☁️ Deployment to AWS EC2 (Production Setup)

LifePulse is deployed on AWS EC2 using Docker and Nginx.

πŸ—οΈ Production Architecture

Browser
   ↓
EC2 Public URL (Domain / Elastic IP)
   ↓
Nginx (Port 80 / 443)
   β”œβ”€β”€ /      β†’ React Frontend Container
   └── /api   β†’ FastAPI Backend Container

πŸš€ Deployment Steps

1. EC2 Setup

Install:

  • Docker
  • Docker Compose

2. Clone repository

git clone <repo-url>
cd project

3. Configure environment

SECRET_KEY=your_secret_key
DATABASE_URL=postgresql://user:password@db:5432/LifePulse

4. Start services

docker compose up -d --build

This starts:

  • Frontend container
  • Backend container
  • PostgreSQL (persistent volume)
  • Nginx reverse proxy

🌐 Accessing the Application

http://<EC2-PUBLIC-IP>

or (recommended):

https://your-domain.com

πŸ“Œ Highlights

  • Fully containerized production-grade architecture
  • Real-world reverse proxy setup using Nginx
  • Microservice-style service separation
  • Persistent database layer using Docker volumes
  • Fully automated CI/CD pipeline with GitHub Actions
  • Secure JWT authentication system
  • AWS EC2 cloud deployment experience
  • Clean separation of frontend, backend, and infrastructure

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors