Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e22a1284de | ||
|
|
2a5de6df36
|
||
|
|
7fa78e870b
|
||
|
|
f17c0d08a1
|
||
|
|
9eb293ccb1
|
||
|
|
cedf771f16
|
||
|
|
bb2e4f2a42
|
||
|
|
1bd4ca0d98
|
||
|
|
d04304b573
|
||
|
|
e9fa0ea685
|
||
|
|
45a0be4210
|
||
|
|
f4df2431ad
|
||
|
|
2bfec1640f
|
||
|
|
281d35d63a
|
||
|
|
fcb35f1e40 | ||
|
|
048c2edb9b | ||
|
|
f7096108f0 | ||
|
|
de8aa503ba | ||
|
|
d5ca679865 | ||
|
|
9362d110a5 | ||
|
|
2e94702ec2 | ||
|
|
709caf208a | ||
|
|
70fe066cdd | ||
|
|
73f456ed00 | ||
|
|
c9431f62ef | ||
|
|
b91f7fcfba | ||
|
|
58b25b0a44 | ||
|
|
01ed427b54 | ||
|
|
fbaaf60d3f | ||
|
|
8fd37ec556 | ||
|
|
8f5ec53ac4 | ||
|
|
a7833a9314 | ||
|
|
78399b5d1d | ||
|
|
e387be003b | ||
|
|
e69a89e5d3 | ||
|
|
8ef1febccc | ||
|
|
81d580ca99 | ||
|
|
a845797b3d | ||
|
|
2366be8432 | ||
|
|
b415164852 | ||
|
|
c1b073c707 | ||
|
|
b67b88e916 | ||
|
|
df39029fd2 | ||
|
|
0b27ee4a9b | ||
|
|
87feefc139 | ||
|
|
4f23b2e657 | ||
|
|
0cf95d2cd4 | ||
|
|
9fcaef1068 | ||
|
|
51f4f7499c | ||
|
|
87d5b85c55 | ||
|
|
996b4097fd | ||
|
|
f21238b61e | ||
|
|
80af0530c9 | ||
|
|
0e4e0ce224 | ||
|
|
f67ab11ec7 | ||
|
|
8acdc92689 | ||
|
|
99259489ab | ||
|
|
396078240b | ||
|
|
4c67666c15 | ||
|
|
df72c33705 | ||
|
|
164b1e5197 | ||
|
|
7d5bf0f7ee | ||
|
|
6e756e0792 | ||
|
|
ca376559db | ||
|
|
94078ad1d5 | ||
|
|
57f42584de | ||
|
|
e3a9e4badc | ||
|
|
263aae54b4 | ||
|
|
50c7ba87ef | ||
|
|
33cf657c70 | ||
|
|
30518e56d4 |
No files matched your search
@@ -0,0 +1,43 @@
|
||||
FROM node:14-bullseye
|
||||
|
||||
# Install additional tools including Ionic CLI and build dependencies for older projects
|
||||
RUN apt-get update && apt-get install -y \
|
||||
git \
|
||||
curl \
|
||||
vim \
|
||||
python2.7 \
|
||||
python2.7-dev \
|
||||
build-essential \
|
||||
&& ln -sf /usr/bin/python2.7 /usr/bin/python \
|
||||
&& ln -sf /usr/bin/python2.7 /usr/bin/python2 \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Install MongoDB shell via npm (works on all architectures)
|
||||
# Note: mongosh requires Node 18+, but we're using Node 14 for legacy compatibility
|
||||
# We'll use the mongo command from the mongo container instead
|
||||
|
||||
# Install global npm packages for development
|
||||
RUN npm install -g \
|
||||
@ionic/cli \
|
||||
@angular/cli \
|
||||
nodemon \
|
||||
concurrently \
|
||||
eslint \
|
||||
prettier
|
||||
|
||||
# Set working directory
|
||||
WORKDIR /workspaces/PfosiLooking-monorepo
|
||||
|
||||
# Copy package files for dependency caching
|
||||
COPY package*.json ./
|
||||
COPY app/package*.json ./app/
|
||||
COPY backend/package*.json ./backend/
|
||||
|
||||
# Install dependencies separately to avoid node-sass issues during build
|
||||
# We'll install them after container starts
|
||||
# RUN npm install
|
||||
# RUN cd app && npm install
|
||||
# RUN cd backend && npm install
|
||||
|
||||
# Keep container running
|
||||
CMD ["sleep", "infinity"]
|
||||
@@ -0,0 +1,764 @@
|
||||
# Looking - DevContainer Configuration
|
||||
|
||||
> **VS Code Development Container setup for the Looking monorepo**
|
||||
|
||||
This directory contains the complete Docker-based development environment configuration for the Looking project. The DevContainer provides a consistent, isolated development environment with all necessary tools and dependencies pre-installed.
|
||||
|
||||
---
|
||||
|
||||
## 📋 Table of Contents
|
||||
|
||||
- [Overview](#overview)
|
||||
- [What's Included](#whats-included)
|
||||
- [Architecture](#architecture)
|
||||
- [Services](#services)
|
||||
- [Port Mappings](#port-mappings)
|
||||
- [Volume Mounts](#volume-mounts)
|
||||
- [Installation Process](#installation-process)
|
||||
- [VS Code Integration](#vs-code-integration)
|
||||
- [Environment Variables](#environment-variables)
|
||||
- [Troubleshooting](#troubleshooting)
|
||||
|
||||
---
|
||||
|
||||
## 🎯 Overview
|
||||
|
||||
The DevContainer setup provides:
|
||||
|
||||
- **Consistent Environment**: Same Node 14, Python 2.7, and build tools across all developers
|
||||
- **Isolated Dependencies**: No conflicts with your local system packages
|
||||
- **Auto-Configuration**: Automatic dependency installation and VS Code extensions
|
||||
- **Multi-Service Stack**: Frontend, backend, database, and admin UI all running together
|
||||
- **Volume Optimization**: Fast performance with node_modules isolation
|
||||
|
||||
**Technologies**: Docker Compose, VS Code Remote - Containers, Node 14, MongoDB 4.4
|
||||
|
||||
---
|
||||
|
||||
## 📦 What's Included
|
||||
|
||||
### Base Container
|
||||
|
||||
**Image**: Custom Dockerfile based on `node:14-bullseye`
|
||||
|
||||
**System Packages**:
|
||||
|
||||
- Git (version control)
|
||||
- curl & wget (HTTP clients)
|
||||
- vim (text editor)
|
||||
- **Python 2.7** (required for legacy node-sass)
|
||||
- build-essential (C++ compiler for native modules)
|
||||
|
||||
**Global NPM Packages**:
|
||||
|
||||
- `@ionic/cli` - Ionic framework CLI
|
||||
- `@angular/cli` - Angular CLI (though project uses ionic-app-scripts)
|
||||
- `nodemon` - Auto-restart development server
|
||||
- `concurrently` - Run multiple commands in parallel
|
||||
- `eslint` - JavaScript linting
|
||||
- `prettier` - Code formatting
|
||||
|
||||
### VS Code Extensions (Auto-Installed)
|
||||
|
||||
| Extension | Purpose |
|
||||
| -------------------------------------- | --------------------------- |
|
||||
| **ms-vscode.vscode-json** | JSON language support |
|
||||
| **bradlc.vscode-tailwindcss** | Tailwind CSS IntelliSense |
|
||||
| **esbenp.prettier-vscode** | Code formatting |
|
||||
| **dbaeumer.vscode-eslint** | JavaScript linting |
|
||||
| **ms-vscode.vscode-typescript-next** | TypeScript support |
|
||||
| **formulahendry.auto-rename-tag** | HTML/XML tag rename |
|
||||
| **christian-kohler.path-intellisense** | Autocomplete file paths |
|
||||
| **mongodb.mongodb-vscode** | MongoDB database management |
|
||||
|
||||
### Editor Settings (Auto-Configured)
|
||||
|
||||
- **Format on Save**: Enabled
|
||||
- **Default Formatter**: Prettier
|
||||
- **ESLint Auto-Fix**: Runs on save
|
||||
- **Emmet**: Enabled for JavaScript (React/JSX)
|
||||
|
||||
---
|
||||
|
||||
## 🏗️ Architecture
|
||||
|
||||
```
|
||||
┌─────────────────────────────────────────────────────────────┐
|
||||
│ DevContainer Stack │
|
||||
├─────────────────────────────────────────────────────────────┤
|
||||
│ │
|
||||
│ ┌──────────────────────────────────────────────────────┐ │
|
||||
│ │ App Container (node:14-bullseye) │ │
|
||||
│ │ - VS Code Remote Server │ │
|
||||
│ │ - Node.js 14.x + npm │ │
|
||||
│ │ - Python 2.7 (for node-sass) │ │
|
||||
│ │ - Ionic/Angular Dev Server (port 8100) │ │
|
||||
│ │ - Express API Server (port 3069) │ │
|
||||
│ │ - Development tools (nodemon, eslint, prettier) │ │
|
||||
│ └──────────────────────────────────────────────────────┘ │
|
||||
│ ↓↑ │
|
||||
│ ┌──────────────────────────────────────────────────────┐ │
|
||||
│ │ MongoDB 4.4 (mongo:4.4) │ │
|
||||
│ │ - Database: urge │ │
|
||||
│ │ - Port: 27017 │ │
|
||||
│ │ - Credentials: admin/password │ │
|
||||
│ │ - Health Check: ping command every 30s │ │
|
||||
│ │ - Seed Data: /docker-entrypoint-initdb.d │ │
|
||||
│ └──────────────────────────────────────────────────────┘ │
|
||||
│ ↓↑ │
|
||||
│ ┌──────────────────────────────────────────────────────┐ │
|
||||
│ │ Mongo Express (mongo-express:latest) │ │
|
||||
│ │ - Web-based MongoDB admin UI │ │
|
||||
│ │ - Port: 8081 │ │
|
||||
│ │ - Login: admin/password │ │
|
||||
│ │ - Browse collections, run queries │ │
|
||||
│ └──────────────────────────────────────────────────────┘ │
|
||||
│ │
|
||||
│ Network: dev-network (bridge driver) │
|
||||
└─────────────────────────────────────────────────────────────┘
|
||||
↓ ↓ ↓
|
||||
Port 8100 Port 3069 Port 27017
|
||||
(Frontend Dev) (Backend API) (MongoDB)
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 🔌 Services
|
||||
|
||||
### 1. App Service (Development Container)
|
||||
|
||||
**File**: [docker-compose.yml](docker-compose.yml)
|
||||
|
||||
**Configuration**:
|
||||
|
||||
```yaml
|
||||
service: app
|
||||
build:
|
||||
context: ..
|
||||
dockerfile: .devcontainer/Dockerfile
|
||||
command: sleep infinity
|
||||
volumes:
|
||||
- ../..:/workspaces:cached
|
||||
- /workspaces/PfosiLooking-monorepo/app/node_modules
|
||||
- /workspaces/PfosiLooking-monorepo/backend/node_modules
|
||||
depends_on:
|
||||
mongo:
|
||||
condition: service_healthy
|
||||
```
|
||||
|
||||
**Purpose**:
|
||||
|
||||
- Main development container where you write code
|
||||
- Runs VS Code Remote Server
|
||||
- Hosts Ionic dev server (port 8100) and Express API (port 3069)
|
||||
- Waits for MongoDB health check before starting
|
||||
|
||||
**Command**: `sleep infinity` keeps container running indefinitely
|
||||
|
||||
**Node Modules Isolation**:
|
||||
|
||||
- Anonymous volumes for `app/node_modules` and `backend/node_modules`
|
||||
- Prevents host filesystem performance issues (especially on Mac/Windows)
|
||||
- Each workspace has its own isolated dependencies
|
||||
|
||||
---
|
||||
|
||||
### 2. MongoDB Service
|
||||
|
||||
**Configuration**:
|
||||
|
||||
```yaml
|
||||
service: mongo
|
||||
image: mongo:4.4
|
||||
environment:
|
||||
- MONGO_INITDB_DATABASE=urge
|
||||
- MONGO_INITDB_ROOT_USERNAME=admin
|
||||
- MONGO_INITDB_ROOT_PASSWORD=password
|
||||
ports:
|
||||
- "27017:27017"
|
||||
volumes:
|
||||
- mongo_data:/data/db
|
||||
- ../backend/data:/docker-entrypoint-initdb.d:ro
|
||||
healthcheck:
|
||||
test: echo 'db.runCommand("ping").ok' | mongo localhost:27017/urge --quiet
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
start_period: 40s
|
||||
```
|
||||
|
||||
**Purpose**:
|
||||
|
||||
- NoSQL database for profiles, users, and messages
|
||||
- Persistent storage via `mongo_data` volume
|
||||
- Auto-loads seed data from `backend/data/` on first run
|
||||
|
||||
**Credentials**:
|
||||
|
||||
- **Admin User**: `admin`
|
||||
- **Admin Password**: `password`
|
||||
- **Database**: `urge`
|
||||
|
||||
**Health Check**:
|
||||
|
||||
- Runs every 30 seconds
|
||||
- Pings database to verify it's responsive
|
||||
- App container waits for healthy status before starting
|
||||
|
||||
**Seed Data**:
|
||||
|
||||
- Files in `backend/data/` are mounted to `/docker-entrypoint-initdb.d`
|
||||
- MongoDB automatically executes `.js` and `.sh` files in that directory
|
||||
- Used for initial database population (if scripts exist)
|
||||
|
||||
---
|
||||
|
||||
### 3. Mongo Express Service
|
||||
|
||||
**Configuration**:
|
||||
|
||||
```yaml
|
||||
service: mongo-express
|
||||
image: mongo-express:latest
|
||||
environment:
|
||||
- ME_CONFIG_MONGODB_SERVER=mongo
|
||||
- ME_CONFIG_MONGODB_PORT=27017
|
||||
- ME_CONFIG_MONGODB_ADMINUSERNAME=admin
|
||||
- ME_CONFIG_MONGODB_ADMINPASSWORD=password
|
||||
- ME_CONFIG_BASICAUTH_USERNAME=admin
|
||||
- ME_CONFIG_BASICAUTH_PASSWORD=password
|
||||
ports:
|
||||
- "8081:8081"
|
||||
depends_on:
|
||||
- mongo
|
||||
```
|
||||
|
||||
**Purpose**:
|
||||
|
||||
- Web-based database administration tool
|
||||
- View/edit collections without command-line mongo shell
|
||||
- Useful for debugging data issues
|
||||
|
||||
**Access**: http://localhost:8081
|
||||
|
||||
- **Login**: admin / password
|
||||
|
||||
**Features**:
|
||||
|
||||
- Browse collections visually
|
||||
- Run MongoDB queries
|
||||
- Create/edit/delete documents
|
||||
- View indexes and stats
|
||||
|
||||
---
|
||||
|
||||
## 🔌 Port Mappings
|
||||
|
||||
| Port | Service | Purpose | Access |
|
||||
| --------- | ---------------- | -------------------- | ------------------------- |
|
||||
| **8100** | Ionic Dev Server | Frontend application | http://localhost:8100 |
|
||||
| **3069** | Express API | Backend REST API | http://localhost:3069 |
|
||||
| **27017** | MongoDB | Database server | mongodb://localhost:27017 |
|
||||
| **8081** | Mongo Express | Database admin UI | http://localhost:8081 |
|
||||
|
||||
### Port Forwarding Configuration
|
||||
|
||||
**File**: [devcontainer.json](devcontainer.json)
|
||||
|
||||
```json
|
||||
"forwardPorts": [8100, 3069, 27017, 8081],
|
||||
"portsAttributes": {
|
||||
"8100": {
|
||||
"label": "Frontend (Ionic)",
|
||||
"onAutoForward": "notify"
|
||||
},
|
||||
"3069": {
|
||||
"label": "Backend API",
|
||||
"onAutoForward": "notify"
|
||||
},
|
||||
"27017": {
|
||||
"label": "MongoDB",
|
||||
"onAutoForward": "silent"
|
||||
},
|
||||
"8081": {
|
||||
"label": "Mongo Express",
|
||||
"onAutoForward": "notify"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
**Notifications**:
|
||||
|
||||
- **notify**: VS Code shows notification when port is forwarded
|
||||
- **silent**: No notification (database port)
|
||||
|
||||
---
|
||||
|
||||
## 💾 Volume Mounts
|
||||
|
||||
### Workspace Volume
|
||||
|
||||
```yaml
|
||||
volumes:
|
||||
- ../..:/workspaces:cached
|
||||
```
|
||||
|
||||
**Purpose**:
|
||||
|
||||
- Mounts parent directory (entire monorepo) into container
|
||||
- `:cached` flag optimizes for read-heavy operations
|
||||
- Enables live code changes to reflect immediately
|
||||
|
||||
**Path Inside Container**: `/workspaces/PfosiLooking-monorepo/`
|
||||
|
||||
---
|
||||
|
||||
### Node Modules Isolation
|
||||
|
||||
```yaml
|
||||
volumes:
|
||||
- /workspaces/PfosiLooking-monorepo/app/node_modules
|
||||
- /workspaces/PfosiLooking-monorepo/backend/node_modules
|
||||
```
|
||||
|
||||
**Purpose**:
|
||||
|
||||
- Creates anonymous Docker volumes for node_modules directories
|
||||
- Isolates dependencies from host filesystem
|
||||
- **Solves performance issues** on Mac/Windows (Docker Desktop)
|
||||
|
||||
**Why?**:
|
||||
|
||||
- node_modules can have 100,000+ files
|
||||
- Host filesystem sync is slow for that many files
|
||||
- Volume isolation provides native container filesystem performance
|
||||
|
||||
---
|
||||
|
||||
### MongoDB Data Volume
|
||||
|
||||
```yaml
|
||||
volumes: mongo_data:/data/db
|
||||
```
|
||||
|
||||
**Purpose**:
|
||||
|
||||
- Persistent storage for MongoDB data
|
||||
- Survives container restarts
|
||||
- Named volume managed by Docker
|
||||
|
||||
**Location**: Docker volume `mongo_data` (not visible in project directory)
|
||||
|
||||
---
|
||||
|
||||
### Seed Data Volume
|
||||
|
||||
```yaml
|
||||
volumes:
|
||||
- ../backend/data:/docker-entrypoint-initdb.d:ro
|
||||
```
|
||||
|
||||
**Purpose**:
|
||||
|
||||
- Mounts seed data directory into MongoDB initialization location
|
||||
- `:ro` = read-only (MongoDB can't modify host files)
|
||||
- Scripts run automatically on first database creation
|
||||
|
||||
---
|
||||
|
||||
## 🔄 Installation Process
|
||||
|
||||
### Automatic Setup (postCreateCommand)
|
||||
|
||||
**File**: [postCreateCommand.sh](postCreateCommand.sh)
|
||||
|
||||
The script runs automatically after the container is created:
|
||||
|
||||
```bash
|
||||
#!/bin/bash
|
||||
set -e # Exit on any error
|
||||
|
||||
# 1. Install root dependencies
|
||||
npm install
|
||||
|
||||
# 2. Install backend dependencies
|
||||
cd backend && npm install
|
||||
|
||||
# 3. Install app dependencies with legacy support
|
||||
cd app && npm install --legacy-peer-deps
|
||||
```
|
||||
|
||||
**Execution Time**: 5-10 minutes (first time only)
|
||||
|
||||
**What Happens**:
|
||||
|
||||
1. **Root workspace** (`package.json`):
|
||||
- Installs `concurrently`, `npm-run-all`
|
||||
- Enables `npm run dev:all` script
|
||||
2. **Backend** (`backend/package.json`):
|
||||
- Installs Express, Mongoose, JWT, etc.
|
||||
- Standard npm install (no special flags)
|
||||
3. **Frontend** (`app/package.json`):
|
||||
- Installs Ionic 3, Angular 5, TypeScript 2.4
|
||||
- **Uses `--legacy-peer-deps`** flag
|
||||
- Required for old Ionic 3 packages with npm 7+
|
||||
- Falls back to `--force` if legacy deps fail
|
||||
|
||||
**Progress Visibility**:
|
||||
|
||||
- VS Code shows "Running postCreateCommand" notification
|
||||
- View detailed output: Terminal → "postCreateCommand" tab
|
||||
|
||||
---
|
||||
|
||||
### Manual Installation
|
||||
|
||||
If automatic setup fails:
|
||||
|
||||
```bash
|
||||
# 1. Open VS Code terminal inside DevContainer
|
||||
# Terminal → New Terminal (or Ctrl + `)
|
||||
|
||||
# 2. Install dependencies manually
|
||||
npm install
|
||||
cd backend && npm install && cd ..
|
||||
cd app && npm install --legacy-peer-deps && cd ..
|
||||
|
||||
# 3. Verify installation
|
||||
npm run dev:all
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 🎨 VS Code Integration
|
||||
|
||||
### DevContainer Configuration
|
||||
|
||||
**File**: [devcontainer.json](devcontainer.json)
|
||||
|
||||
**Key Settings**:
|
||||
|
||||
```json
|
||||
{
|
||||
"name": "PfosiLooking Full Stack",
|
||||
"dockerComposeFile": "docker-compose.yml",
|
||||
"service": "app",
|
||||
"workspaceFolder": "/workspaces/PfosiLooking-monorepo",
|
||||
"shutdownAction": "stopCompose"
|
||||
}
|
||||
```
|
||||
|
||||
**Shutdown Behavior**:
|
||||
|
||||
- `"stopCompose"` - Stops all services when closing VS Code
|
||||
- Preserves data in volumes (MongoDB data, node_modules)
|
||||
- Fast restart on next open (no rebuild needed)
|
||||
|
||||
---
|
||||
|
||||
### Features
|
||||
|
||||
**Auto-Installed**:
|
||||
|
||||
```json
|
||||
{
|
||||
"ghcr.io/devcontainers/features/node:1": {
|
||||
"version": "14"
|
||||
},
|
||||
"ghcr.io/devcontainers/features/git:1": {},
|
||||
"ghcr.io/devcontainers/features/github-cli:1": {}
|
||||
}
|
||||
```
|
||||
|
||||
**Provides**:
|
||||
|
||||
- Node.js 14.x (managed version)
|
||||
- Git (latest stable)
|
||||
- GitHub CLI (`gh` command)
|
||||
|
||||
---
|
||||
|
||||
### Post-Start Message
|
||||
|
||||
```json
|
||||
"postStartCommand": "echo 'DevContainer ready! Run npm run dev:all to start development.'"
|
||||
```
|
||||
|
||||
Displays helpful message after container starts.
|
||||
|
||||
---
|
||||
|
||||
## 🔐 Environment Variables
|
||||
|
||||
### Development Environment File
|
||||
|
||||
**File**: [dev.env](dev.env)
|
||||
|
||||
**Contains** (example values):
|
||||
|
||||
```bash
|
||||
NODE_ENV=development
|
||||
MONGODB_URI=mongodb://mongo:27017/urge
|
||||
REACT_APP_API_URL=http://localhost:3069
|
||||
PORT=3069
|
||||
IONIC_PORT=8100
|
||||
JWT_SECRET=dev-secret-change-in-production
|
||||
```
|
||||
|
||||
**Usage**:
|
||||
|
||||
```yaml
|
||||
env_file:
|
||||
- dev.env
|
||||
```
|
||||
|
||||
⚠️ **Security Note**:
|
||||
|
||||
- `dev.env` may contain secrets
|
||||
- DO NOT commit real credentials
|
||||
- Use `dev.env.example` for templates
|
||||
- Add `dev.env` to `.gitignore`
|
||||
|
||||
---
|
||||
|
||||
### Inline Environment Variables
|
||||
|
||||
**In docker-compose.yml**:
|
||||
|
||||
```yaml
|
||||
environment:
|
||||
- NODE_ENV=development
|
||||
- MONGODB_URI=mongodb://mongo:27017/urge
|
||||
- PORT=3069
|
||||
```
|
||||
|
||||
These override values from `dev.env` if both are present.
|
||||
|
||||
---
|
||||
|
||||
## 🔧 Troubleshooting
|
||||
|
||||
### Container Won't Start
|
||||
|
||||
**Problem**: DevContainer fails to start or build
|
||||
|
||||
**Solutions**:
|
||||
|
||||
1. **Rebuild without cache**:
|
||||
|
||||
```
|
||||
F1 → "Dev Containers: Rebuild Container Without Cache"
|
||||
```
|
||||
|
||||
2. **Check Docker Desktop is running**:
|
||||
|
||||
```bash
|
||||
docker ps
|
||||
```
|
||||
|
||||
3. **Free up disk space**:
|
||||
|
||||
```bash
|
||||
docker system prune -a
|
||||
```
|
||||
|
||||
4. **View build logs**:
|
||||
```
|
||||
F1 → "Dev Containers: Show Container Log"
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### Python 2.7 Errors
|
||||
|
||||
**Problem**: `node-sass` or `node-gyp` errors about Python
|
||||
|
||||
**Check Python symlinks**:
|
||||
|
||||
```bash
|
||||
# Inside container
|
||||
which python
|
||||
python --version # Should show Python 2.7.x
|
||||
```
|
||||
|
||||
**Dockerfile installs**:
|
||||
|
||||
```dockerfile
|
||||
RUN apt-get install -y python2.7 python2.7-dev \
|
||||
&& ln -sf /usr/bin/python2.7 /usr/bin/python
|
||||
```
|
||||
|
||||
**Why?**: node-sass (used by Ionic 3) requires Python 2.7 to build native modules.
|
||||
|
||||
---
|
||||
|
||||
### MongoDB Connection Failed
|
||||
|
||||
**Problem**: Backend can't connect to MongoDB
|
||||
|
||||
**1. Check MongoDB is healthy**:
|
||||
|
||||
```bash
|
||||
docker ps
|
||||
# Look for "healthy" status on mongo container
|
||||
```
|
||||
|
||||
**2. Test connection manually**:
|
||||
|
||||
```bash
|
||||
docker exec -it <mongo-container-id> mongo --eval "db.runCommand('ping')"
|
||||
```
|
||||
|
||||
**3. Verify connection string**:
|
||||
|
||||
```bash
|
||||
echo $MONGODB_URI
|
||||
# Should be: mongodb://mongo:27017/urge
|
||||
```
|
||||
|
||||
**4. Wait for health check**:
|
||||
|
||||
- Health check runs every 30s
|
||||
- Container may need 40s start period
|
||||
- App service waits for `service_healthy` condition
|
||||
|
||||
---
|
||||
|
||||
### Port Already in Use
|
||||
|
||||
**Problem**: Port 8100, 3069, or 27017 already in use on host
|
||||
|
||||
**Find conflicting process**:
|
||||
|
||||
```bash
|
||||
# Mac/Linux
|
||||
lsof -i :8100
|
||||
lsof -i :3069
|
||||
lsof -i :27017
|
||||
|
||||
# Kill process
|
||||
kill -9 <PID>
|
||||
```
|
||||
|
||||
**Or change ports** in [docker-compose.yml](docker-compose.yml):
|
||||
|
||||
```yaml
|
||||
ports:
|
||||
- "8101:8100" # Changed from 8100
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### Node Modules Issues
|
||||
|
||||
**Problem**: Module not found, peer dependency warnings, or version conflicts
|
||||
|
||||
**Solution 1 - Reinstall**:
|
||||
|
||||
```bash
|
||||
# Remove all node_modules
|
||||
rm -rf node_modules app/node_modules backend/node_modules
|
||||
|
||||
# Reinstall
|
||||
npm run install:all
|
||||
```
|
||||
|
||||
**Solution 2 - Clear volume**:
|
||||
|
||||
```bash
|
||||
# Exit container, then from host
|
||||
docker-compose -f .devcontainer/docker-compose.yml down -v
|
||||
# This deletes ALL volumes including node_modules and MongoDB data
|
||||
|
||||
# Rebuild container
|
||||
F1 → "Dev Containers: Rebuild Container"
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### Slow Performance
|
||||
|
||||
**Problem**: File watching or compilation is slow
|
||||
|
||||
**Causes**:
|
||||
|
||||
- Docker Desktop on Mac/Windows has filesystem sync overhead
|
||||
- Large node_modules directories
|
||||
|
||||
**Solutions**:
|
||||
|
||||
1. **Verify node_modules isolation**:
|
||||
|
||||
```yaml
|
||||
# These volumes should exist in docker-compose.yml
|
||||
- /workspaces/PfosiLooking-monorepo/app/node_modules
|
||||
- /workspaces/PfosiLooking-monorepo/backend/node_modules
|
||||
```
|
||||
|
||||
2. **Increase Docker resources**:
|
||||
|
||||
- Docker Desktop → Settings → Resources
|
||||
- Increase CPU: 4+ cores
|
||||
- Increase Memory: 8+ GB
|
||||
|
||||
3. **Use `:cached` mount flag** (already configured):
|
||||
```yaml
|
||||
- ../..:/workspaces:cached
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### Database Permissions
|
||||
|
||||
**Problem**: Can't write to MongoDB or access Mongo Express
|
||||
|
||||
**Check credentials**:
|
||||
|
||||
```yaml
|
||||
# MongoDB
|
||||
MONGO_INITDB_ROOT_USERNAME=admin
|
||||
MONGO_INITDB_ROOT_PASSWORD=password
|
||||
|
||||
# Mongo Express
|
||||
ME_CONFIG_MONGODB_ADMINUSERNAME=admin
|
||||
ME_CONFIG_MONGODB_ADMINPASSWORD=password
|
||||
ME_CONFIG_BASICAUTH_USERNAME=admin
|
||||
ME_CONFIG_BASICAUTH_PASSWORD=password
|
||||
```
|
||||
|
||||
**Access Mongo Express**:
|
||||
|
||||
- URL: http://localhost:8081
|
||||
- Login: admin / password (HTTP Basic Auth)
|
||||
|
||||
---
|
||||
|
||||
### VS Code Extensions Not Installing
|
||||
|
||||
**Problem**: Extensions listed in devcontainer.json don't install
|
||||
|
||||
**Manual install**:
|
||||
|
||||
```
|
||||
F1 → "Extensions: Install Extensions"
|
||||
Search for extension ID (e.g., "esbenp.prettier-vscode")
|
||||
```
|
||||
|
||||
**Rebuild to retry auto-install**:
|
||||
|
||||
```
|
||||
F1 → "Dev Containers: Rebuild Container"
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 📚 Related Documentation
|
||||
|
||||
- **[Root README](../README.md)** - Project overview and quick start
|
||||
- **[Backend README](../backend/README.md)** - API server setup
|
||||
- **[Frontend README](../app/README.md)** - Ionic app setup
|
||||
- **[Deployment Guide](../DEPLOYMENT.md)** - Production deployment
|
||||
|
||||
---
|
||||
|
||||
**Need Help?** Check the [root troubleshooting section](../README.md#troubleshooting) for additional solutions.
|
||||
@@ -0,0 +1,18 @@
|
||||
NODE_ENV=development
|
||||
MONGODB_URI=mongodb://admin:password@localhost:27017/urge?authSource=admin
|
||||
JWT_SECRET=your-dev-jwt-secret-here
|
||||
PORT=3069
|
||||
REACT_APP_API_URL=http://localhost:3069
|
||||
|
||||
# MongoDB
|
||||
MONGO_ROOT_USER=admin
|
||||
MONGO_ROOT_PASSWORD=password
|
||||
MONGO_EXPRESS_USER=admin
|
||||
MONGO_EXPRESS_PASSWORD=password
|
||||
|
||||
# Optional API keys for development
|
||||
GOOGLE_MAPS_API_KEY=your-google-maps-api-key
|
||||
MAIL_HOST=smtp.gmail.com
|
||||
MAIL_PORT=587
|
||||
MAIL_USER=your-email@gmail.com
|
||||
MAIL_PASS=your-email-password
|
||||
@@ -0,0 +1,60 @@
|
||||
{
|
||||
"name": "PfosiLooking Full Stack",
|
||||
"dockerComposeFile": "docker-compose.yml",
|
||||
"service": "app",
|
||||
"workspaceFolder": "/workspaces/PfosiLooking-monorepo",
|
||||
"shutdownAction": "stopCompose",
|
||||
"features": {
|
||||
"ghcr.io/devcontainers/features/node:1": {
|
||||
"version": "14"
|
||||
},
|
||||
"ghcr.io/devcontainers/features/git:1": {},
|
||||
"ghcr.io/devcontainers/features/github-cli:1": {}
|
||||
},
|
||||
"customizations": {
|
||||
"vscode": {
|
||||
"extensions": [
|
||||
"ms-vscode.vscode-json",
|
||||
"bradlc.vscode-tailwindcss",
|
||||
"esbenp.prettier-vscode",
|
||||
"dbaeumer.vscode-eslint",
|
||||
"ms-vscode.vscode-typescript-next",
|
||||
"formulahendry.auto-rename-tag",
|
||||
"christian-kohler.path-intellisense",
|
||||
"ms-vscode.vscode-json",
|
||||
"mongodb.mongodb-vscode"
|
||||
],
|
||||
"settings": {
|
||||
"editor.formatOnSave": true,
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
||||
"editor.codeActionsOnSave": {
|
||||
"source.fixAll.eslint": "explicit"
|
||||
},
|
||||
"emmet.includeLanguages": {
|
||||
"javascript": "javascriptreact"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"forwardPorts": [8100, 3069, 27017, 8081],
|
||||
"portsAttributes": {
|
||||
"8100": {
|
||||
"label": "Frontend (Ionic)",
|
||||
"onAutoForward": "notify"
|
||||
},
|
||||
"3069": {
|
||||
"label": "Backend API",
|
||||
"onAutoForward": "notify"
|
||||
},
|
||||
"27017": {
|
||||
"label": "MongoDB",
|
||||
"onAutoForward": "silent"
|
||||
},
|
||||
"8081": {
|
||||
"label": "Mongo Express",
|
||||
"onAutoForward": "notify"
|
||||
}
|
||||
},
|
||||
"postCreateCommand": ".devcontainer/postCreateCommand.sh",
|
||||
"postStartCommand": "echo 'DevContainer ready! Run npm run dev:all to start development.'"
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
version: "3.8"
|
||||
|
||||
services:
|
||||
app:
|
||||
build:
|
||||
context: ..
|
||||
dockerfile: .devcontainer/Dockerfile
|
||||
volumes:
|
||||
- ../..:/workspaces:cached
|
||||
- /workspaces/PfosiLooking-monorepo/app/node_modules
|
||||
- /workspaces/PfosiLooking-monorepo/backend/node_modules
|
||||
command: sleep infinity
|
||||
environment:
|
||||
- NODE_ENV=development
|
||||
- MONGODB_URI=mongodb://mongo:27017/urge
|
||||
- REACT_APP_API_URL=http://localhost:3069
|
||||
- PORT=3069
|
||||
- IONIC_PORT=8100
|
||||
env_file:
|
||||
- dev.env
|
||||
networks:
|
||||
- dev-network
|
||||
depends_on:
|
||||
mongo:
|
||||
condition: service_healthy
|
||||
|
||||
mongo:
|
||||
image: mongo:4.4
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
- MONGO_INITDB_DATABASE=urge
|
||||
- MONGO_INITDB_ROOT_USERNAME=admin
|
||||
- MONGO_INITDB_ROOT_PASSWORD=password
|
||||
ports:
|
||||
- "27017:27017"
|
||||
networks:
|
||||
- dev-network
|
||||
volumes:
|
||||
- mongo_data:/data/db
|
||||
- ../backend/data:/docker-entrypoint-initdb.d:ro
|
||||
healthcheck:
|
||||
test: echo 'db.runCommand("ping").ok' | mongo localhost:27017/urge --quiet
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
start_period: 40s
|
||||
|
||||
mongo-express:
|
||||
image: mongo-express:latest
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
- ME_CONFIG_MONGODB_SERVER=mongo
|
||||
- ME_CONFIG_MONGODB_PORT=27017
|
||||
- ME_CONFIG_MONGODB_ADMINUSERNAME=admin
|
||||
- ME_CONFIG_MONGODB_ADMINPASSWORD=password
|
||||
- ME_CONFIG_BASICAUTH_USERNAME=admin
|
||||
- ME_CONFIG_BASICAUTH_PASSWORD=password
|
||||
ports:
|
||||
- "8081:8081"
|
||||
networks:
|
||||
- dev-network
|
||||
depends_on:
|
||||
- mongo
|
||||
|
||||
volumes:
|
||||
mongo_data:
|
||||
|
||||
networks:
|
||||
dev-network:
|
||||
driver: bridge
|
||||
@@ -0,0 +1,31 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
echo "Setting up PfosiLooking monorepo dependencies..."
|
||||
echo "Using Node version: $(node --version)"
|
||||
|
||||
# Install root dependencies first
|
||||
echo "Installing root dependencies..."
|
||||
npm install
|
||||
|
||||
echo "Installing backend dependencies..."
|
||||
cd backend && npm install
|
||||
cd ..
|
||||
|
||||
echo "Installing app dependencies (Ionic 3 with legacy packages)..."
|
||||
cd app
|
||||
|
||||
# For Node 14 and older Ionic 3 projects, we need special handling
|
||||
echo "Installing with legacy peer dependencies support..."
|
||||
if npm install --legacy-peer-deps; then
|
||||
echo "App dependencies installed successfully!"
|
||||
else
|
||||
echo "Standard install failed, trying alternative approach..."
|
||||
# Try with force flag as last resort for very old packages
|
||||
npm install --legacy-peer-deps --force
|
||||
fi
|
||||
|
||||
cd ..
|
||||
|
||||
echo "All dependencies installed successfully!"
|
||||
echo "You can now start development with: npm run dev:all"
|
||||
@@ -1,184 +0,0 @@
|
||||
kind: pipeline
|
||||
type: docker
|
||||
name: Publish Pipeline
|
||||
|
||||
workspace:
|
||||
path: /drone/looking
|
||||
|
||||
steps:
|
||||
- name: Publish Image
|
||||
image: plugins/docker
|
||||
settings:
|
||||
auto_tag: true
|
||||
repo: git.mifi.dev/mifi/pfosi-looking-api
|
||||
registry: git.mifi.dev
|
||||
build_args:
|
||||
- MONGO_ENTRY_FILE=latest
|
||||
- MONGO_VERSION=latest
|
||||
- NPM_TOKEN:
|
||||
from_secret: reg_token
|
||||
ssh-agent-key:
|
||||
from_secret: reg_token
|
||||
username: <token>
|
||||
password:
|
||||
from_secret: reg_token
|
||||
secrets: [reg_token]
|
||||
- name: Report Image Publish Status
|
||||
image: plugins/webhook
|
||||
settings:
|
||||
urls: https://lab.mifi.dev/hooks/ccw34hdf7tgbjmzp96nptn938r
|
||||
content_type: application/json
|
||||
template: |
|
||||
{
|
||||
"icon_url":"https://emojipedia-us.s3.dualstack.us-west-1.amazonaws.com/thumbs/120/apple/198/freezing-face_1f976.png",
|
||||
"text": "[{{ repo.name }} - New docker image release {{tag}} from # {{ build.number }}] Deploy {{ build.status }} {{#success build.status}}:tada:{{else}}:poop:{{/success}}",
|
||||
"username":"DroneBot"
|
||||
}
|
||||
when:
|
||||
status:
|
||||
- success
|
||||
- failure
|
||||
|
||||
volumes:
|
||||
- name: dockerconfig
|
||||
host:
|
||||
path: /volume1/docker/dockerconfig.json
|
||||
- name: dockersock
|
||||
host:
|
||||
path: /var/run/docker.sock
|
||||
|
||||
trigger:
|
||||
branch:
|
||||
- master
|
||||
- develop
|
||||
event:
|
||||
- push
|
||||
|
||||
# trigger:
|
||||
# event:
|
||||
# - tag
|
||||
|
||||
# ---
|
||||
# kind: pipeline
|
||||
# type: docker
|
||||
# name: Staging Deploy Pipeline
|
||||
|
||||
# workspace:
|
||||
# path: /drone/auth
|
||||
|
||||
# steps:
|
||||
# - name: Deploy Container
|
||||
# image: docker
|
||||
# privileged: true
|
||||
# environment:
|
||||
# CONTAINER_PREFIX: staging
|
||||
# HOST: area51.mifi.dev
|
||||
# ROUTE_PREFIX: /auth
|
||||
# PORT: 9001
|
||||
# commands:
|
||||
# - docker compose -f docker-compose.staging-build.yml build --pull --no-cache
|
||||
# - docker compose -f docker-compose.staging-build.yml up --remove-orphans --force-recreate --wait
|
||||
# volumes:
|
||||
# - name: env-secrets
|
||||
# path: /drone/auth/staging.env
|
||||
# - name: dockersock
|
||||
# path: /var/run/docker.sock
|
||||
# - name: dockerconfig
|
||||
# path: /drone/auth/.docker/config.json
|
||||
# - name: Send Status Notifications
|
||||
# image: plugins/webhook
|
||||
# privileged: true
|
||||
# settings:
|
||||
# urls: https://lab.mifi.dev/hooks/ccw34hdf7tgbjmzp96nptn938r
|
||||
# content_type: application/json
|
||||
# template: |
|
||||
# {
|
||||
# "icon_url":"https://emojipedia-us.s3.dualstack.us-west-1.amazonaws.com/thumbs/120/apple/198/freezing-face_1f976.png",
|
||||
# "text": "[{{ repo.name }} - Build # {{ build.number }}] Staging Deploy {{ build.status }} {{#success build.status}}:tada:{{else}}:poop:{{/success}}",
|
||||
# "username":"DroneBot"
|
||||
# }
|
||||
# when:
|
||||
# status:
|
||||
# - success
|
||||
# - failure
|
||||
|
||||
# volumes:
|
||||
# - name: dockerconfig
|
||||
# host:
|
||||
# path: /volume1/docker/dockerconfig.json
|
||||
# - name: dockersock
|
||||
# host:
|
||||
# path: /var/run/docker.sock
|
||||
# - name: env-secrets
|
||||
# host:
|
||||
# path: /volume1/docker/beethoven/labs-auth/staging.env
|
||||
|
||||
# depends_on:
|
||||
# - Test Pipeline
|
||||
|
||||
# trigger:
|
||||
# branch:
|
||||
# - develop
|
||||
# event:
|
||||
# - push
|
||||
|
||||
# ---
|
||||
# kind: pipeline
|
||||
# type: docker
|
||||
# name: Production Deploy Pipeline
|
||||
|
||||
# workspace:
|
||||
# path: /drone/looking
|
||||
|
||||
# clone:
|
||||
# disable: true
|
||||
|
||||
# steps:
|
||||
# - name: Deploy Container
|
||||
# image: plugins/webhook
|
||||
# settings:
|
||||
# # urls: https://portainer.mifi.dev/api/stacks/webhooks/968d2244-2548-4f0b-8c18-bbc9bc35305d
|
||||
# - name: Send Status Notifications
|
||||
# image: plugins/webhook
|
||||
# privileged: true
|
||||
# settings:
|
||||
# urls: https://lab.mifi.dev/hooks/ccw34hdf7tgbjmzp96nptn938r
|
||||
# content_type: application/json
|
||||
# template: |
|
||||
# {
|
||||
# "icon_url":"https://emojipedia-us.s3.dualstack.us-west-1.amazonaws.com/thumbs/120/apple/198/freezing-face_1f976.png",
|
||||
# "text": "[{{ repo.name }} - Build # {{ build.number }}] Production Deploy {{ build.status }} {{#success build.status}}:tada:{{else}}:poop:{{/success}}",
|
||||
# "username":"DroneBot"
|
||||
# }
|
||||
# when:
|
||||
# status:
|
||||
# - success
|
||||
# - failure
|
||||
|
||||
# depends_on:
|
||||
# - Publish Pipeline
|
||||
|
||||
# trigger:
|
||||
# event:
|
||||
# - promote
|
||||
# target:
|
||||
# - production
|
||||
|
||||
# kind: pipeline
|
||||
# type: docker
|
||||
# name: Deploy to miCloud
|
||||
|
||||
# steps:
|
||||
# - name: deploy-dev
|
||||
# image: node:latest
|
||||
# commands:
|
||||
# - npm install -g forever
|
||||
# - npm install
|
||||
# - forever start bin/www
|
||||
|
||||
# trigger:
|
||||
# branch:
|
||||
# - master
|
||||
# event:
|
||||
# - push
|
||||
|
||||
@@ -1 +1,54 @@
|
||||
.vscode/settings.json
|
||||
# Dependencies
|
||||
node_modules/
|
||||
*/node_modules/
|
||||
|
||||
# Production builds
|
||||
/app/www/
|
||||
/app/dist/
|
||||
/backend/dist/
|
||||
|
||||
# Logs
|
||||
*.log
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
|
||||
# Environment files
|
||||
.env
|
||||
.env.local
|
||||
.env.development.local
|
||||
.env.test.local
|
||||
.env.production.local
|
||||
|
||||
# IDE
|
||||
.vscode/
|
||||
.idea/
|
||||
*.swp
|
||||
*.swo
|
||||
|
||||
# OS
|
||||
.DS_Store
|
||||
Thumbs.db
|
||||
|
||||
# Cache
|
||||
.cache/
|
||||
.parcel-cache/
|
||||
.angular/
|
||||
|
||||
# Coverage
|
||||
coverage/
|
||||
.nyc_output/
|
||||
|
||||
# Docker
|
||||
.dockerignore
|
||||
|
||||
# Database
|
||||
*.db
|
||||
*.sqlite
|
||||
|
||||
# Images (if large)
|
||||
/backend/src/images/uploads/
|
||||
|
||||
# Temporary
|
||||
tmp/
|
||||
temp/
|
||||
@@ -0,0 +1,640 @@
|
||||
# Looking - PfosiLooking Monorepo
|
||||
|
||||
> **An art project exploring modern gay dating culture through interactive storytelling**
|
||||
|
||||
"Looking" is a documentary photography and art project by Nick Pfosi that examines the cultural landscape of gay dating apps like Grindr and modern LGBTQ+ meeting spaces. The project captures user stories, experiences, and narratives about contemporary gay dating culture through an interactive mobile application.
|
||||
|
||||
---
|
||||
|
||||
## 📋 Table of Contents
|
||||
|
||||
- [Project Overview](#project-overview)
|
||||
- [Tech Stack](#tech-stack)
|
||||
- [Prerequisites](#prerequisites)
|
||||
- [Quick Start](#quick-start)
|
||||
- [Project Structure](#project-structure)
|
||||
- [Available Scripts](#available-scripts)
|
||||
- [Data Management](#data-management)
|
||||
- [Documentation Links](#documentation-links)
|
||||
- [Troubleshooting](#troubleshooting)
|
||||
- [Technical Debt & Security](#technical-debt--security)
|
||||
- [Future Modernization Path](#future-modernization-path)
|
||||
|
||||
---
|
||||
|
||||
## 🎨 Project Overview
|
||||
|
||||
This monorepo contains the full-stack "Looking" application:
|
||||
|
||||
- **Frontend**: Ionic 3 / Angular 5 mobile application for browsing profiles and stories
|
||||
- **Backend**: Express.js REST API with MongoDB for data management
|
||||
- **DevContainer**: Complete Docker-based development environment
|
||||
|
||||
The name "Urnings" (seen in code) references a historical term for homosexual men, adding a scholarly dimension to the project's exploration of queer identity and dating culture.
|
||||
|
||||
---
|
||||
|
||||
## 🛠 Tech Stack
|
||||
|
||||
### Frontend ([app/](app/))
|
||||
|
||||
- **Framework**: Ionic 3.9.2 with Angular 5.0.3
|
||||
- **Language**: TypeScript 2.4.2
|
||||
- **Build Tool**: `@ionic/app-scripts` 3.2.4
|
||||
- **UI Components**: Ionic Angular, Ionicons
|
||||
- **HTTP**: Angular HTTP module with RxJS 5.5.2
|
||||
- **Dev Server**: Port 8100
|
||||
|
||||
### Backend ([backend/](backend/))
|
||||
|
||||
- **Framework**: Express 4.14.0
|
||||
- **Runtime**: Node.js 14.x
|
||||
- **Database**: MongoDB 4.4
|
||||
- **ODM**: Mongoose 4.7.4
|
||||
- **Authentication**: JWT (jsonwebtoken 7.3.0)
|
||||
- **Security**: PBKDF2 password hashing (233,335 iterations)
|
||||
- **Image Processing**: Multer 1.2.0
|
||||
- **Logging**: Winston 2.4.0, Morgan 1.7.0
|
||||
- **Email**: Nodemailer 4.0.1
|
||||
- **API Server**: Port 3069
|
||||
|
||||
### DevOps
|
||||
|
||||
- **DevContainer**: Node 14 (Debian Bullseye)
|
||||
- **Database**: MongoDB 4.4
|
||||
- **Database Admin**: Mongo Express (port 8081)
|
||||
- **Production**: Docker Compose + Traefik + Let's Encrypt SSL
|
||||
|
||||
---
|
||||
|
||||
## ✅ Prerequisites
|
||||
|
||||
Before you begin, ensure you have:
|
||||
|
||||
- **Docker Desktop** (latest version) - [Download here](https://www.docker.com/products/docker-desktop)
|
||||
- **Visual Studio Code** (latest version) - [Download here](https://code.visualstudio.com/)
|
||||
- **VS Code Remote - Containers extension** - [Install from marketplace](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers)
|
||||
- **Git** (for cloning the repository)
|
||||
|
||||
> **Note**: You do NOT need Node.js, npm, or MongoDB installed locally. The DevContainer provides everything.
|
||||
|
||||
---
|
||||
|
||||
## 🚀 Quick Start
|
||||
|
||||
### Using DevContainer (Recommended)
|
||||
|
||||
1. **Clone the repository**:
|
||||
|
||||
```bash
|
||||
git clone <repository-url>
|
||||
cd PfosiLooking-monorepo
|
||||
```
|
||||
|
||||
2. **Open in VS Code**:
|
||||
|
||||
```bash
|
||||
code .
|
||||
```
|
||||
|
||||
3. **Reopen in Container**:
|
||||
|
||||
- VS Code should prompt: "Reopen in Container"
|
||||
- Or manually: Press `F1` → "Dev Containers: Reopen in Container"
|
||||
|
||||
4. **Wait for setup** (first time only - 5-10 minutes):
|
||||
|
||||
- Container builds with Node 14 + Python 2.7
|
||||
- Dependencies install automatically via `postCreateCommand.sh`
|
||||
- MongoDB starts and initializes
|
||||
|
||||
5. **Start development servers**:
|
||||
|
||||
```bash
|
||||
npm run dev:all
|
||||
```
|
||||
|
||||
6. **Access the application**:
|
||||
- **Frontend**: http://localhost:8100
|
||||
- **Backend API**: http://localhost:3069
|
||||
- **MongoDB**: localhost:27017
|
||||
- **Mongo Express**: http://localhost:8081 (admin/password)
|
||||
|
||||
---
|
||||
|
||||
## 📁 Project Structure
|
||||
|
||||
```
|
||||
PfosiLooking-monorepo/
|
||||
├── app/ # Ionic 3 / Angular 5 frontend
|
||||
│ ├── src/
|
||||
│ │ ├── app/ # App module and root component
|
||||
│ │ ├── pages/ # Page components (grid, chat, profile, etc.)
|
||||
│ │ ├── services/ # Data services (ProfileService)
|
||||
│ │ └── assets/ # Static assets, images, data
|
||||
│ └── package.json # Frontend dependencies
|
||||
│
|
||||
├── backend/ # Express.js API
|
||||
│ ├── src/
|
||||
│ │ ├── routes/ # API route handlers
|
||||
│ │ ├── models/ # Mongoose schemas
|
||||
│ │ ├── modules/ # Utilities (auth, images, mailer, etc.)
|
||||
│ │ └── bin/www # Server startup script
|
||||
│ ├── data/ # Seed data (profiles.json)
|
||||
│ └── package.json # Backend dependencies
|
||||
│
|
||||
├── .devcontainer/ # Development container configuration
|
||||
│ ├── devcontainer.json # VS Code DevContainer config
|
||||
│ ├── docker-compose.yml # Dev services (app, mongo, mongo-express)
|
||||
│ ├── Dockerfile # Custom dev image (Node 14 + Python 2.7)
|
||||
│ └── postCreateCommand.sh # Auto-install dependencies
|
||||
│
|
||||
├── docker-compose.yml # Production deployment configuration
|
||||
├── package.json # Root workspace configuration
|
||||
└── README.md # This file
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 📜 Available Scripts
|
||||
|
||||
### Development
|
||||
|
||||
```bash
|
||||
# Start both frontend and backend concurrently
|
||||
npm run dev:all
|
||||
|
||||
# Start only backend (port 3069)
|
||||
npm run dev:backend
|
||||
|
||||
# Start only frontend (port 8100)
|
||||
npm run dev:app
|
||||
```
|
||||
|
||||
### Installation
|
||||
|
||||
```bash
|
||||
# Install all dependencies (root + workspaces)
|
||||
npm run install:all
|
||||
|
||||
# Install workspace dependencies only
|
||||
npm run install:workspaces
|
||||
```
|
||||
|
||||
### Database
|
||||
|
||||
```bash
|
||||
# Seed MongoDB with initial data from backend/data/profiles.json
|
||||
npm run seed
|
||||
|
||||
# Access MongoDB shell
|
||||
npm run mongo:shell
|
||||
```
|
||||
|
||||
### Build & Deploy
|
||||
|
||||
```bash
|
||||
# Build both frontend and backend
|
||||
npm run build
|
||||
|
||||
# Build Docker images for production
|
||||
npm run docker:build
|
||||
|
||||
# Deploy to production (docker-compose up)
|
||||
npm run deploy
|
||||
```
|
||||
|
||||
### Testing & Quality
|
||||
|
||||
```bash
|
||||
# Run all tests (backend + frontend)
|
||||
npm test
|
||||
|
||||
# Run backend tests only (Mocha/Chai)
|
||||
npm run test:backend
|
||||
|
||||
# Run frontend tests only
|
||||
npm run test:app
|
||||
|
||||
# Lint all code
|
||||
npm run lint
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 💾 Data Management
|
||||
|
||||
### ⚠️ Important: No Interactive Data Entry
|
||||
|
||||
**This application currently does NOT support adding or editing data through the UI.** All profile and message data is seeded from static JSON files.
|
||||
|
||||
### How to Add/Edit Content
|
||||
|
||||
1. **Edit the seed data file**: [`backend/data/profiles.json`](backend/data/profiles.json)
|
||||
|
||||
2. **Re-seed the database**:
|
||||
|
||||
```bash
|
||||
npm run seed
|
||||
```
|
||||
|
||||
3. **For production deployments**: The database is wiped and reseeded on each deployment, so all changes must be committed to `profiles.json` before deploying.
|
||||
|
||||
### Data Structure
|
||||
|
||||
Profiles are stored in `backend/data/profiles.json` with this structure:
|
||||
|
||||
```json
|
||||
{
|
||||
"order": 1,
|
||||
"details": {
|
||||
"name": "John",
|
||||
"age": 28,
|
||||
"location": "San Francisco, CA",
|
||||
"about": "User's story...",
|
||||
"pic": {
|
||||
"thumb": "profile/john_thumbnail.png",
|
||||
"detail": "profile/john_detail.png"
|
||||
}
|
||||
},
|
||||
"messages": [
|
||||
{
|
||||
"text": "What's your story?",
|
||||
"isUser": false
|
||||
},
|
||||
{
|
||||
"text": "I've been using dating apps for...",
|
||||
"isUser": true
|
||||
}
|
||||
],
|
||||
"submitted": true,
|
||||
"approved": true
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 📚 Documentation Links
|
||||
|
||||
- **[App Documentation](app/README.md)** - Frontend architecture, pages, and services
|
||||
- **[Backend Documentation](backend/README.md)** - API server, routes, and models
|
||||
- **[API Reference](backend/API.md)** - Complete REST API endpoint documentation
|
||||
- **[Database Schema](backend/SCHEMA.md)** - MongoDB collection schemas and relationships
|
||||
- **[DevContainer Guide](.devcontainer/README.md)** - Development environment setup
|
||||
- **[Deployment Guide](DEPLOYMENT.md)** - Production deployment with Docker and Traefik
|
||||
|
||||
---
|
||||
|
||||
## 🔧 Troubleshooting
|
||||
|
||||
### DevContainer Issues
|
||||
|
||||
**Problem**: Container fails to start or build
|
||||
|
||||
```bash
|
||||
# Solution: Rebuild container without cache
|
||||
F1 → "Dev Containers: Rebuild Container Without Cache"
|
||||
```
|
||||
|
||||
**Problem**: Port conflicts (8100, 3069, 27017, 8081 already in use)
|
||||
|
||||
```bash
|
||||
# Solution: Stop conflicting services
|
||||
docker ps # Find conflicting containers
|
||||
docker stop <container-id>
|
||||
|
||||
# Or change ports in .devcontainer/docker-compose.yml
|
||||
```
|
||||
|
||||
**Problem**: `node_modules` issues or permission errors
|
||||
|
||||
```bash
|
||||
# Solution: Remove node_modules and reinstall
|
||||
rm -rf app/node_modules backend/node_modules node_modules
|
||||
npm run install:all
|
||||
```
|
||||
|
||||
### Frontend Issues
|
||||
|
||||
**Problem**: `node-sass` build failed
|
||||
|
||||
```bash
|
||||
# Solution: Python 2.7 is required (included in DevContainer)
|
||||
# If running locally without DevContainer:
|
||||
npm install --legacy-peer-deps
|
||||
```
|
||||
|
||||
**Problem**: Peer dependency warnings during `npm install`
|
||||
|
||||
```bash
|
||||
# Solution: Use legacy peer deps flag (included in postCreateCommand.sh)
|
||||
cd app
|
||||
npm install --legacy-peer-deps
|
||||
```
|
||||
|
||||
**Problem**: Module not found errors
|
||||
|
||||
```bash
|
||||
# Solution: Clear cache and reinstall
|
||||
cd app
|
||||
rm -rf node_modules package-lock.json
|
||||
npm install --legacy-peer-deps
|
||||
```
|
||||
|
||||
**Problem**: JavaScript heap out of memory
|
||||
|
||||
```bash
|
||||
# Solution: Increase Node.js memory limit
|
||||
export NODE_OPTIONS="--max-old-space-size=4096"
|
||||
npm run dev:app
|
||||
```
|
||||
|
||||
### Backend Issues
|
||||
|
||||
**Problem**: MongoDB connection failed
|
||||
|
||||
```bash
|
||||
# Solution: Verify MongoDB container is running
|
||||
docker ps | grep mongo
|
||||
|
||||
# Check MongoDB health
|
||||
docker exec -it <mongo-container-id> mongo --eval "db.adminCommand('ping')"
|
||||
|
||||
# Restart MongoDB service
|
||||
docker-compose -f .devcontainer/docker-compose.yml restart mongo
|
||||
```
|
||||
|
||||
**Problem**: JWT token invalid errors
|
||||
|
||||
```bash
|
||||
# Solution: Verify JWT_SECRET is set in .devcontainer/dev.env
|
||||
# Check backend/.env.example for required environment variables
|
||||
```
|
||||
|
||||
**Problem**: Image upload fails
|
||||
|
||||
```bash
|
||||
# Solution: Check volume permissions and multer configuration
|
||||
# Verify backend/src/images directory exists and is writable
|
||||
ls -la backend/src/images
|
||||
```
|
||||
|
||||
**Problem**: Cannot connect to API from frontend
|
||||
|
||||
```bash
|
||||
# Solution: Verify backend is running on port 3069
|
||||
curl http://localhost:3069/profiles
|
||||
|
||||
# Check CORS settings in backend/src/app.js
|
||||
```
|
||||
|
||||
### Database Issues
|
||||
|
||||
**Problem**: Seed data not loading
|
||||
|
||||
```bash
|
||||
# Solution: Manually run seed script
|
||||
cd backend
|
||||
npm run seed
|
||||
|
||||
# Or check data file exists
|
||||
ls -la backend/data/profiles.json
|
||||
```
|
||||
|
||||
**Problem**: Mongo Express not accessible
|
||||
|
||||
```bash
|
||||
# Solution: Verify service is running and credentials are correct
|
||||
# Default: http://localhost:8081 (admin/password)
|
||||
docker logs <mongo-express-container-id>
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## ⚠️ Technical Debt & Security
|
||||
|
||||
### Outdated Dependencies
|
||||
|
||||
This project uses **legacy technologies** (circa 2017-2018) that are significantly outdated:
|
||||
|
||||
| Component | Current Version | Latest Stable | Status |
|
||||
| ------------ | --------------- | ------------- | --------------------------- |
|
||||
| **Node.js** | 14.x | 20.x LTS | ⛔ EOL April 2023 |
|
||||
| **Angular** | 5.0.3 | 17.x | ⛔ 12 major versions behind |
|
||||
| **Ionic** | 3.9.2 | 7.x | ⛔ 4 major versions behind |
|
||||
| **Express** | 4.14.0 | 4.18.x | ⚠️ Missing security patches |
|
||||
| **MongoDB** | 4.4 | 7.0 | ⚠️ 3 major versions behind |
|
||||
| **Mongoose** | 4.7.4 | 8.x | ⛔ 4 major versions behind |
|
||||
|
||||
### Security Concerns
|
||||
|
||||
1. **CORS Configuration**: Wide open (`Access-Control-Allow-Origin: *`)
|
||||
|
||||
- **Risk**: Any domain can make requests to API
|
||||
- **Fix**: Restrict to specific origins in production (already configured in docker-compose.yml)
|
||||
|
||||
2. **No Rate Limiting**: API has no request throttling
|
||||
|
||||
- **Risk**: Vulnerable to brute force and DoS attacks
|
||||
- **Fix**: Add `express-rate-limit` middleware
|
||||
|
||||
3. **Missing Input Validation**: No validation library
|
||||
|
||||
- **Risk**: Potential injection attacks
|
||||
- **Fix**: Add Joi or express-validator
|
||||
|
||||
4. **JWT Secret Management**: Secret must be set via environment variable
|
||||
|
||||
- **Risk**: If leaked, tokens can be forged
|
||||
- **Fix**: Use strong secrets, rotate regularly, consider refresh tokens
|
||||
|
||||
5. **Image Upload Security**: No file type/size restrictions visible
|
||||
|
||||
- **Risk**: Malicious file uploads
|
||||
- **Fix**: Validate MIME types, set size limits, sanitize filenames
|
||||
|
||||
6. **Node.js 14 EOL**: No longer receives security updates
|
||||
- **Risk**: Unpatched vulnerabilities
|
||||
- **Fix**: Upgrade to Node 20 LTS (see modernization path below)
|
||||
|
||||
### Code Quality Issues
|
||||
|
||||
- No TypeScript in backend (JavaScript only)
|
||||
- Limited test coverage (backend has Mocha tests, frontend has none)
|
||||
- No automated CI/CD pipeline
|
||||
- `ionic-app-scripts` is deprecated
|
||||
- Gulp is dated for task running
|
||||
|
||||
---
|
||||
|
||||
## 🚀 Future Modernization Path
|
||||
|
||||
For developers tasked with modernizing this codebase, follow this **incremental upgrade strategy**:
|
||||
|
||||
### Phase 1: Critical Security Updates (2-4 weeks)
|
||||
|
||||
1. **Upgrade Node.js**:
|
||||
|
||||
```bash
|
||||
# Update Dockerfile to use Node 20 LTS
|
||||
FROM node:20-bullseye
|
||||
|
||||
# Remove Python 2.7 symlinks (modern node-sass doesn't need it)
|
||||
```
|
||||
|
||||
2. **Update Backend Dependencies**:
|
||||
|
||||
```bash
|
||||
cd backend
|
||||
npm update express mongoose jsonwebtoken
|
||||
npm install express-rate-limit express-validator helmet
|
||||
```
|
||||
|
||||
3. **Add Security Middleware**:
|
||||
|
||||
```javascript
|
||||
// backend/src/app.js
|
||||
const rateLimit = require("express-rate-limit");
|
||||
const helmet = require("helmet");
|
||||
const { body, validationResult } = require("express-validator");
|
||||
|
||||
app.use(helmet());
|
||||
app.use(rateLimit({ windowMs: 15 * 60 * 1000, max: 100 }));
|
||||
```
|
||||
|
||||
4. **Fix CORS** (already done in production docker-compose.yml):
|
||||
```javascript
|
||||
// Restrict to specific origin
|
||||
res.header("Access-Control-Allow-Origin", "https://pfosi.mifi.dev");
|
||||
```
|
||||
|
||||
### Phase 2: Backend Modernization (4-6 weeks)
|
||||
|
||||
1. **Convert Backend to TypeScript**:
|
||||
|
||||
```bash
|
||||
npm install -D typescript @types/express @types/node @types/mongoose
|
||||
npx tsc --init
|
||||
# Incrementally convert .js files to .ts
|
||||
```
|
||||
|
||||
2. **Upgrade MongoDB & Mongoose**:
|
||||
|
||||
```bash
|
||||
# Update docker-compose.yml
|
||||
mongo:
|
||||
image: mongo:7.0
|
||||
|
||||
# Update Mongoose
|
||||
npm install mongoose@latest
|
||||
```
|
||||
|
||||
3. **Modern Testing Setup**:
|
||||
|
||||
```bash
|
||||
npm install -D jest ts-jest @types/jest supertest
|
||||
# Migrate from Mocha/Chai to Jest
|
||||
```
|
||||
|
||||
4. **Add API Documentation**:
|
||||
```bash
|
||||
npm install swagger-jsdoc swagger-ui-express
|
||||
# Generate OpenAPI/Swagger docs from code
|
||||
```
|
||||
|
||||
### Phase 3: Frontend Modernization (8-12 weeks)
|
||||
|
||||
This is the **most complex** phase due to breaking changes.
|
||||
|
||||
**Option A: Incremental Angular Upgrade** (Slower but safer)
|
||||
|
||||
```bash
|
||||
# Upgrade through each major version
|
||||
ng update @angular/cli@6 @angular/core@6
|
||||
ng update @angular/cli@7 @angular/core@7
|
||||
# ... continue through each version to 17
|
||||
```
|
||||
|
||||
**Option B: Fresh Ionic 7 Rewrite** (Faster, cleaner)
|
||||
|
||||
```bash
|
||||
# Create new Ionic 7 app with Angular 17
|
||||
ionic start looking-v2 tabs --type=angular
|
||||
# Port components one by one
|
||||
# Benefits: Standalone components, Signals, better performance
|
||||
```
|
||||
|
||||
**Recommendation**: For novice developers, **Option B (rewrite)** is recommended because:
|
||||
|
||||
- Angular 5 → 17 migration is complex with many breaking changes
|
||||
- Ionic 3 → 7 requires complete UI component rewrites
|
||||
- Fresh start allows modern architecture (standalone components, no NgModules)
|
||||
- Cleaner codebase without legacy workarounds
|
||||
|
||||
### Phase 4: Modern Build Pipeline (2-3 weeks)
|
||||
|
||||
1. **Replace deprecated build tools**:
|
||||
|
||||
```bash
|
||||
# Remove ionic-app-scripts, use Angular CLI
|
||||
# Remove Gulp, use npm scripts
|
||||
```
|
||||
|
||||
2. **Add CI/CD**:
|
||||
|
||||
```yaml
|
||||
# .github/workflows/ci.yml or .gitlab-ci.yml
|
||||
- Run tests on every commit
|
||||
- Automated Docker builds
|
||||
- Deployment to staging/production
|
||||
```
|
||||
|
||||
3. **Code Quality Tools**:
|
||||
```bash
|
||||
npm install -D eslint prettier husky lint-staged
|
||||
# Pre-commit hooks for linting
|
||||
```
|
||||
|
||||
### Estimated Total Effort
|
||||
|
||||
- **Phase 1 (Security)**: 2-4 weeks - **START HERE**
|
||||
- **Phase 2 (Backend)**: 4-6 weeks
|
||||
- **Phase 3 (Frontend)**: 8-12 weeks - **Most complex**
|
||||
- **Phase 4 (DevOps)**: 2-3 weeks
|
||||
|
||||
**Total**: 16-25 weeks (4-6 months) for full modernization
|
||||
|
||||
### Resources for Learning
|
||||
|
||||
- [Angular Update Guide](https://update.angular.io/) - Step-by-step migration instructions
|
||||
- [Ionic Migration Guide](https://ionicframework.com/docs/intro/upgrading-to-ionic-7)
|
||||
- [Node.js Best Practices](https://github.com/goldbergyoni/nodebestpractices)
|
||||
- [Express Security Best Practices](https://expressjs.com/en/advanced/best-practice-security.html)
|
||||
|
||||
---
|
||||
|
||||
## 🤝 Contributing
|
||||
|
||||
This is an art project with specific artistic intent. Before making changes:
|
||||
|
||||
1. Understand the artistic and documentary purpose
|
||||
2. Preserve the original narrative and user stories
|
||||
3. Consult with the artist (Nick Pfosi) for content changes
|
||||
4. Follow the modernization path for technical improvements
|
||||
|
||||
---
|
||||
|
||||
## 📄 License
|
||||
|
||||
See project repository for license information.
|
||||
|
||||
---
|
||||
|
||||
## 👤 Author
|
||||
|
||||
**Nick Pfosi** - Artist & Creator
|
||||
**Mike Fitzpatrick** - Technical Implementation (badmf@mifi.dev)
|
||||
|
||||
---
|
||||
|
||||
**Questions or Issues?** Check the [troubleshooting section](#troubleshooting) or refer to component-specific documentation linked above.
|
||||
@@ -0,0 +1,17 @@
|
||||
# EditorConfig helps developers define and maintain consistent coding styles between different editors and IDEs
|
||||
# editorconfig.org
|
||||
|
||||
root = true
|
||||
|
||||
[*]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
|
||||
# We recommend you to keep these unchanged
|
||||
end_of_line = lf
|
||||
charset = utf-8
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
|
||||
[*.md]
|
||||
trim_trailing_whitespace = false
|
||||
@@ -0,0 +1,35 @@
|
||||
# Specifies intentionally untracked files to ignore when using Git
|
||||
# http://git-scm.com/docs/gitignore
|
||||
|
||||
*~
|
||||
*.sw[mnpcod]
|
||||
*.log
|
||||
*.tmp
|
||||
*.tmp.*
|
||||
log.txt
|
||||
*.sublime-project
|
||||
*.sublime-workspace
|
||||
.vscode/
|
||||
npm-debug.log*
|
||||
|
||||
.idea/
|
||||
.sourcemaps/
|
||||
.sass-cache/
|
||||
.tmp/
|
||||
.versions/
|
||||
coverage/
|
||||
dist/
|
||||
node_modules/
|
||||
tmp/
|
||||
temp/
|
||||
hooks/
|
||||
platforms/
|
||||
plugins/
|
||||
plugins/android.json
|
||||
plugins/ios.json
|
||||
www/
|
||||
$RECYCLE.BIN/
|
||||
|
||||
.DS_Store
|
||||
Thumbs.db
|
||||
UserInterfaceState.xcuserstate
|
||||
@@ -0,0 +1,713 @@
|
||||
# Looking - Frontend Application
|
||||
|
||||
> **Ionic 3 / Angular 5 mobile application for browsing dating app profiles and stories**
|
||||
|
||||
This is the frontend mobile application for the "Looking" art project. Built with Ionic 3 and Angular 5, it provides an interactive interface for exploring user profiles, stories, and messages about modern gay dating culture.
|
||||
|
||||
---
|
||||
|
||||
## 📋 Table of Contents
|
||||
|
||||
- [Overview](#overview)
|
||||
- [Tech Stack](#tech-stack)
|
||||
- [Project Structure](#project-structure)
|
||||
- [Pages & Components](#pages--components)
|
||||
- [Services](#services)
|
||||
- [Data Flow](#data-flow)
|
||||
- [Development](#development)
|
||||
- [Building](#building)
|
||||
- [Troubleshooting](#troubleshooting)
|
||||
|
||||
---
|
||||
|
||||
## 🎯 Overview
|
||||
|
||||
The frontend is a **hybrid mobile application** that can run as:
|
||||
|
||||
- Web application (development mode on port 8100)
|
||||
- iOS native app (requires Xcode)
|
||||
- Android native app (requires Android Studio)
|
||||
|
||||
**Key Features:**
|
||||
|
||||
- Grid-based profile browsing (Tinder-like swipe interface)
|
||||
- Detailed profile views with images and user stories
|
||||
- Message threads with conversation history
|
||||
- Story submission form ("Tell Your Story")
|
||||
- Tab-based navigation
|
||||
- Offline support with local JSON fallback
|
||||
|
||||
---
|
||||
|
||||
## 🛠 Tech Stack
|
||||
|
||||
| Technology | Version | Purpose |
|
||||
| ------------------- | ------- | ---------------------------------------- |
|
||||
| **Ionic Framework** | 3.9.2 | Hybrid mobile framework |
|
||||
| **Angular** | 5.0.3 | Component framework |
|
||||
| **TypeScript** | 2.4.2 | Type-safe JavaScript |
|
||||
| **RxJS** | 5.5.2 | Reactive programming |
|
||||
| **@angular/http** | 5.0.3 | HTTP client (deprecated, pre-HttpClient) |
|
||||
| **ionic-swipe-all** | 1.2.0 | Swipe gesture library |
|
||||
| **moment** | 2.21.0 | Date/time formatting |
|
||||
| **@ionic/storage** | 2.1.3 | Local storage abstraction |
|
||||
| **ionicons** | 3.0.0 | Icon library |
|
||||
|
||||
**Build Tool**: `@ionic/app-scripts` 3.2.4 (Ionic's custom webpack wrapper)
|
||||
|
||||
---
|
||||
|
||||
## 📁 Project Structure
|
||||
|
||||
```
|
||||
app/
|
||||
├── src/
|
||||
│ ├── app/ # Root application module
|
||||
│ │ ├── app.component.ts # Root component (title: "Urnings")
|
||||
│ │ ├── app.module.ts # Main NgModule with declarations
|
||||
│ │ ├── app.html # Root template
|
||||
│ │ ├── app.scss # Global styles
|
||||
│ │ └── main.ts # Bootstrap entry point
|
||||
│ │
|
||||
│ ├── pages/ # Page components (routable views)
|
||||
│ │ ├── tabs/ # Tab navigation container
|
||||
│ │ │ ├── tabs.ts # TabsPage component
|
||||
│ │ │ └── tabs.html # Tab layout (3 tabs)
|
||||
│ │ │
|
||||
│ │ ├── grid/ # Profile grid view (main browse page)
|
||||
│ │ │ ├── grid.ts # Grid logic with swipe handling
|
||||
│ │ │ ├── grid.html # Grid layout with profile cards
|
||||
│ │ │ └── grid.scss # Grid styles
|
||||
│ │ │
|
||||
│ │ ├── profile/ # Detailed profile view
|
||||
│ │ │ ├── profile.ts # Profile display logic
|
||||
│ │ │ ├── profile.html # Profile template (name, age, about, pics)
|
||||
│ │ │ └── profile.scss # Profile styles
|
||||
│ │ │
|
||||
│ │ ├── chat/ # Individual conversation view
|
||||
│ │ │ ├── chat.ts # Chat message display
|
||||
│ │ │ ├── chat.html # Message thread UI
|
||||
│ │ │ └── chat.scss # Chat bubble styles
|
||||
│ │ │
|
||||
│ │ ├── messages/ # Message list/inbox view
|
||||
│ │ │ ├── messages.ts # Message list logic
|
||||
│ │ │ ├── messages.html # List of conversations
|
||||
│ │ │ └── messages.scss # Message list styles
|
||||
│ │ │
|
||||
│ │ ├── users/ # User list view
|
||||
│ │ │ ├── users.ts # User list logic
|
||||
│ │ │ ├── users.html # User grid/list
|
||||
│ │ │ └── users.scss # User list styles
|
||||
│ │ │
|
||||
│ │ ├── lightbox/ # Full-screen image viewer
|
||||
│ │ │ ├── lightbox.ts # Image zoom/pan logic
|
||||
│ │ │ ├── lightbox.html # Fullscreen image display
|
||||
│ │ │ └── lightbox.scss # Lightbox styles
|
||||
│ │ │
|
||||
│ │ ├── information/ # Info/about page
|
||||
│ │ │ ├── information.ts # Static info page
|
||||
│ │ │ ├── information.html # Project information
|
||||
│ │ │ └── information.scss # Info page styles
|
||||
│ │ │
|
||||
│ │ └── tell/ # Story submission form
|
||||
│ │ ├── tell.ts # Form submission logic
|
||||
│ │ ├── tell.html # Story submission form
|
||||
│ │ └── tell.scss # Form styles
|
||||
│ │
|
||||
│ ├── services/ # Shared services
|
||||
│ │ └── profiles.ts # ProfileService for data management
|
||||
│ │
|
||||
│ ├── theme/ # Global theme configuration
|
||||
│ │ └── variables.scss # Ionic theme variables
|
||||
│ │
|
||||
│ ├── assets/ # Static assets
|
||||
│ │ ├── data/ # Local JSON data files (fallback)
|
||||
│ │ │ ├── profiles.json # All profiles
|
||||
│ │ │ ├── profiles initial.json # Initial seed data
|
||||
│ │ │ └── cruises.json # Additional data
|
||||
│ │ ├── icon/ # App icons
|
||||
│ │ ├── images/ # Profile, message images
|
||||
│ │ │ ├── profile/ # Profile photos
|
||||
│ │ │ ├── message/ # Message attachments
|
||||
│ │ │ └── cruise/ # Cruise-related images
|
||||
│ │ └── imgs/ # UI images and icons
|
||||
│ │
|
||||
│ ├── index.html # Main HTML entry
|
||||
│ ├── manifest.json # PWA manifest
|
||||
│ └── service-worker.js # Service worker for offline support
|
||||
│
|
||||
├── www/ # Build output directory
|
||||
│ ├── build/ # Compiled JS/CSS bundles
|
||||
│ │ ├── main.js # Application code
|
||||
│ │ ├── vendor.js # Third-party libraries
|
||||
│ │ ├── polyfills.js # Browser polyfills
|
||||
│ │ └── main.css # Compiled styles
|
||||
│ └── assets/ # Copied static assets
|
||||
│
|
||||
├── package.json # Dependencies and scripts
|
||||
├── ionic.config.json # Ionic CLI configuration
|
||||
├── tsconfig.json # TypeScript compiler config
|
||||
├── tslint.json # TSLint rules (deprecated)
|
||||
└── .editorconfig # Editor formatting rules
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 📄 Pages & Components
|
||||
|
||||
### TabsPage (`pages/tabs/`)
|
||||
|
||||
**Root navigation container** with three tabs:
|
||||
|
||||
```typescript
|
||||
// tabs.ts - Tab configuration
|
||||
tabs = [
|
||||
{ root: GridPage, tabTitle: "Grid", tabIcon: "grid" },
|
||||
{ root: UsersPage, tabTitle: "Users", tabIcon: "people" },
|
||||
{ root: MessagesPage, tabTitle: "Messages", tabIcon: "chatboxes" },
|
||||
];
|
||||
```
|
||||
|
||||
### GridPage (`pages/grid/`)
|
||||
|
||||
**Main profile browsing interface** - Tinder-like grid:
|
||||
|
||||
- Displays profile thumbnails in grid layout
|
||||
- Supports swipe gestures (using `ionic-swipe-all`)
|
||||
- Taps open detailed profile view
|
||||
- Loads profiles from ProfileService
|
||||
- Falls back to local JSON if API unavailable
|
||||
|
||||
**Key Features:**
|
||||
|
||||
- Swipe left/right for navigation
|
||||
- Pull-to-refresh
|
||||
- Infinite scroll
|
||||
- Click thumbnail → ProfilePage
|
||||
|
||||
### ProfilePage (`pages/profile/`)
|
||||
|
||||
**Detailed profile view** with:
|
||||
|
||||
- Profile photo (large detail image)
|
||||
- Name, age, location
|
||||
- "About" section with user story
|
||||
- Multiple photos in gallery
|
||||
- Message thread (if profile has messages)
|
||||
- Navigation to previous/next profile
|
||||
|
||||
**Navigation:**
|
||||
|
||||
- Receives profile ID via NavParams
|
||||
- "Next" and "Previous" buttons
|
||||
- Photo gallery opens LightboxPage
|
||||
|
||||
### ChatPage (`pages/chat/`)
|
||||
|
||||
**Message thread view**:
|
||||
|
||||
- Displays conversation history
|
||||
- Question/answer format
|
||||
- User responses vs. interviewer questions
|
||||
- Image attachments supported
|
||||
- Timestamps with moment.js
|
||||
|
||||
**Message Types:**
|
||||
|
||||
- `isUser: false` → Questions (left-aligned)
|
||||
- `isUser: true` → User responses (right-aligned)
|
||||
|
||||
### MessagesPage (`pages/messages/`)
|
||||
|
||||
**Inbox/conversation list**:
|
||||
|
||||
- Shows all profiles with messages
|
||||
- Displays message preview
|
||||
- Unread indicators
|
||||
- Tap to open ChatPage with full thread
|
||||
|
||||
### UsersPage (`pages/users/`)
|
||||
|
||||
**User list view**:
|
||||
|
||||
- Alternative view to grid
|
||||
- List format with thumbnails
|
||||
- Quick access to profiles
|
||||
- Filter/search options (if implemented)
|
||||
|
||||
### LightboxPage (`pages/lightbox/`)
|
||||
|
||||
**Full-screen image viewer**:
|
||||
|
||||
- Zoom and pan gestures
|
||||
- Swipe between photos
|
||||
- Close button returns to profile
|
||||
- Supports pinch-to-zoom
|
||||
|
||||
### InformationPage (`pages/information/`)
|
||||
|
||||
**Static information page**:
|
||||
|
||||
- About the art project
|
||||
- Artist statement
|
||||
- Project goals
|
||||
- Credits and acknowledgments
|
||||
|
||||
### TellPage (`pages/tell/`)
|
||||
|
||||
**Story submission form**:
|
||||
|
||||
- Users can submit their own stories
|
||||
- Form fields: name, age, location, story
|
||||
- Photo upload
|
||||
- Submission sends to API (if connected)
|
||||
|
||||
---
|
||||
|
||||
## 🔌 Services
|
||||
|
||||
### ProfileService (`services/profiles.ts`)
|
||||
|
||||
**Central data management service** for profiles.
|
||||
|
||||
**Endpoints:**
|
||||
|
||||
```typescript
|
||||
endpoint: "http://localhost:27017/urnings/profiles"; // Primary API
|
||||
fallback: "assets/data/profiles.json"; // Local fallback
|
||||
epSubmitted: "/submitted"; // Submitted profiles
|
||||
epVerified: "/verified"; // Verified profiles
|
||||
```
|
||||
|
||||
**Methods:**
|
||||
|
||||
```typescript
|
||||
load(); // Load all profiles
|
||||
loadSubmitted(); // Load submitted (pending) profiles
|
||||
loadVerified(); // Load verified (approved) profiles
|
||||
getProfiles(); // Get cached profiles
|
||||
getProfileById(id); // Get specific profile
|
||||
getNextProfile(id); // Navigate to next profile
|
||||
getPreviousProfile(id); // Navigate to previous
|
||||
```
|
||||
|
||||
**Data Flow:**
|
||||
|
||||
1. Tries to fetch from API endpoint
|
||||
2. On error, falls back to local `assets/data/profiles.json`
|
||||
3. Caches data in memory
|
||||
4. Builds ID→index map for navigation
|
||||
|
||||
**Fallback Behavior:**
|
||||
|
||||
```typescript
|
||||
doGetRequest(endpoint, resolve, type) {
|
||||
this.http.get(endpoint).subscribe(
|
||||
(data) => { /* Use API data */ },
|
||||
(error) => {
|
||||
// API failed → use local JSON
|
||||
this.doGetRequest(this.fallback, resolve, type);
|
||||
}
|
||||
);
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 🔄 Data Flow
|
||||
|
||||
### Profile Loading Flow
|
||||
|
||||
```mermaid
|
||||
graph TD
|
||||
A[GridPage loads] --> B{ProfileService.load}
|
||||
B --> C[Try API: http://localhost:27017/urnings/profiles]
|
||||
C --> D{API Success?}
|
||||
D -->|Yes| E[Store profiles in memory]
|
||||
D -->|No| F[Fallback to assets/data/profiles.json]
|
||||
F --> E
|
||||
E --> G[Build ID-to-index map]
|
||||
G --> H[Return profiles to GridPage]
|
||||
H --> I[Display grid of thumbnails]
|
||||
I --> J[User taps profile]
|
||||
J --> K[Navigate to ProfilePage with ID]
|
||||
K --> L[ProfilePage fetches profile from service]
|
||||
L --> M[Display full profile details]
|
||||
```
|
||||
|
||||
### Message Loading Flow
|
||||
|
||||
```mermaid
|
||||
graph TD
|
||||
A[ProfilePage loads] --> B[Get profile by ID]
|
||||
B --> C{Profile has messages?}
|
||||
C -->|Yes| D[Extract messages array]
|
||||
C -->|No| E[Show 'No messages']
|
||||
D --> F[Display in ChatPage]
|
||||
F --> G[Format with moment.js]
|
||||
G --> H[Render question/answer pairs]
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 💻 Development
|
||||
|
||||
### Start Dev Server
|
||||
|
||||
```bash
|
||||
# From project root
|
||||
npm run dev:app
|
||||
|
||||
# Or from app directory
|
||||
cd app
|
||||
ionic serve --host=0.0.0.0 --port=8100
|
||||
```
|
||||
|
||||
**Access**: http://localhost:8100
|
||||
|
||||
### Live Reload
|
||||
|
||||
Ionic's dev server watches for file changes and automatically:
|
||||
|
||||
- Recompiles TypeScript
|
||||
- Rebuilds SCSS
|
||||
- Reloads browser
|
||||
- Preserves dev tools open
|
||||
|
||||
### Chrome DevTools
|
||||
|
||||
Open Chrome DevTools to:
|
||||
|
||||
- Inspect components
|
||||
- Debug TypeScript (source maps enabled)
|
||||
- Test responsive layouts
|
||||
- Simulate mobile devices
|
||||
- Monitor network requests
|
||||
|
||||
### API Configuration
|
||||
|
||||
To switch between local and remote API:
|
||||
|
||||
**Edit `services/profiles.ts`:**
|
||||
|
||||
```typescript
|
||||
// Local API (backend running on port 3069)
|
||||
endpoint: "http://localhost:3069/profiles";
|
||||
|
||||
// Remote API (production)
|
||||
endpoint: "https://api.pfosi.mifi.dev/profiles";
|
||||
|
||||
// Fallback (always local)
|
||||
fallback: "assets/data/profiles.json";
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 🏗️ Building
|
||||
|
||||
### Development Build
|
||||
|
||||
```bash
|
||||
npm run build
|
||||
# or
|
||||
ionic build
|
||||
```
|
||||
|
||||
Output: `www/` directory
|
||||
|
||||
### Production Build
|
||||
|
||||
```bash
|
||||
ionic build --prod
|
||||
```
|
||||
|
||||
**Optimizations:**
|
||||
|
||||
- Minification
|
||||
- Tree shaking
|
||||
- Ahead-of-time (AOT) compilation
|
||||
- CSS purging
|
||||
- Source map generation (optional)
|
||||
|
||||
### Build for Mobile Platforms
|
||||
|
||||
**iOS**:
|
||||
|
||||
```bash
|
||||
ionic cordova build ios --prod --release
|
||||
# Requires Xcode and iOS development certificates
|
||||
```
|
||||
|
||||
**Android**:
|
||||
|
||||
```bash
|
||||
ionic cordova build android --prod --release
|
||||
# Requires Android Studio and signing keys
|
||||
```
|
||||
|
||||
**Note**: Mobile builds require additional Cordova setup not covered here.
|
||||
|
||||
---
|
||||
|
||||
## 🔧 Troubleshooting
|
||||
|
||||
### `node-sass` Build Failed
|
||||
|
||||
**Error:**
|
||||
|
||||
```
|
||||
Error: `gyp` failed with exit code: 1
|
||||
Module 'node-sass' not found
|
||||
```
|
||||
|
||||
**Solution:**
|
||||
|
||||
```bash
|
||||
# node-sass requires Python 2.7 (included in DevContainer)
|
||||
# If running locally:
|
||||
npm rebuild node-sass --force
|
||||
|
||||
# Or use legacy peer deps
|
||||
npm install --legacy-peer-deps
|
||||
```
|
||||
|
||||
**Why?** `node-sass` is a native module that requires Python 2.7 and build tools. The DevContainer includes these dependencies via symlinks.
|
||||
|
||||
---
|
||||
|
||||
### Peer Dependency Warnings
|
||||
|
||||
**Error:**
|
||||
|
||||
```
|
||||
npm WARN ERESOLVE overriding peer dependency
|
||||
```
|
||||
|
||||
**Solution:**
|
||||
|
||||
```bash
|
||||
# Use legacy peer dependency resolution (npm 7+)
|
||||
npm install --legacy-peer-deps
|
||||
```
|
||||
|
||||
**Why?** Ionic 3 and Angular 5 were built before npm 7's strict peer dependency checking. The `--legacy-peer-deps` flag uses npm 6 behavior.
|
||||
|
||||
---
|
||||
|
||||
### Module Not Found Errors
|
||||
|
||||
**Error:**
|
||||
|
||||
```
|
||||
Error: Cannot find module '@angular/core'
|
||||
```
|
||||
|
||||
**Solution:**
|
||||
|
||||
```bash
|
||||
# Remove node_modules and reinstall
|
||||
rm -rf node_modules package-lock.json
|
||||
npm install --legacy-peer-deps
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### JavaScript Heap Out of Memory
|
||||
|
||||
**Error:**
|
||||
|
||||
```
|
||||
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed
|
||||
```
|
||||
|
||||
**Solution:**
|
||||
|
||||
```bash
|
||||
# Increase Node.js memory limit
|
||||
export NODE_OPTIONS="--max-old-space-size=4096"
|
||||
npm run ionic:serve
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### Ionic Serve Port Already in Use
|
||||
|
||||
**Error:**
|
||||
|
||||
```
|
||||
Error: Port 8100 is already in use
|
||||
```
|
||||
|
||||
**Solution:**
|
||||
|
||||
```bash
|
||||
# Find process using port 8100
|
||||
lsof -i :8100
|
||||
|
||||
# Kill the process
|
||||
kill -9 <PID>
|
||||
|
||||
# Or use different port
|
||||
ionic serve --port=8101
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### TypeScript Compilation Errors
|
||||
|
||||
**Error:**
|
||||
|
||||
```
|
||||
Error: TS2304: Cannot find name 'Promise'
|
||||
```
|
||||
|
||||
**Solution:**
|
||||
|
||||
```bash
|
||||
# Verify TypeScript version matches project
|
||||
npm install typescript@2.4.2 --save-dev --save-exact
|
||||
```
|
||||
|
||||
**Check `tsconfig.json`:**
|
||||
|
||||
```json
|
||||
{
|
||||
"compilerOptions": {
|
||||
"lib": ["es2015", "dom"],
|
||||
"target": "es5"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### CORS Errors in Browser
|
||||
|
||||
**Error:**
|
||||
|
||||
```
|
||||
Access to XMLHttpRequest at 'http://localhost:3069/profiles' blocked by CORS policy
|
||||
```
|
||||
|
||||
**Solution:**
|
||||
|
||||
**Option 1**: Backend already allows all origins:
|
||||
|
||||
```javascript
|
||||
// backend/src/app.js
|
||||
res.header("Access-Control-Allow-Origin", "*");
|
||||
```
|
||||
|
||||
**Option 2**: Use Ionic's proxy (for dev server):
|
||||
|
||||
**Edit `ionic.config.json`:**
|
||||
|
||||
```json
|
||||
{
|
||||
"proxies": [
|
||||
{
|
||||
"path": "/api",
|
||||
"proxyUrl": "http://localhost:3069"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
**Update service:**
|
||||
|
||||
```typescript
|
||||
endpoint: "/api/profiles"; // Proxied through dev server
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### Images Not Loading
|
||||
|
||||
**Error:**
|
||||
|
||||
```
|
||||
404 Not Found: http://localhost:8100/assets/images/profile/john.png
|
||||
```
|
||||
|
||||
**Solutions:**
|
||||
|
||||
1. **Verify image exists:**
|
||||
|
||||
```bash
|
||||
ls -la src/assets/images/profile/
|
||||
```
|
||||
|
||||
2. **Check path in data:**
|
||||
|
||||
```json
|
||||
// Should be relative to assets/images/
|
||||
"pic": {
|
||||
"thumb": "profile/john_thumbnail.png", // ✅ Correct
|
||||
"detail": "/profile/john_detail.png" // ❌ Leading slash breaks it
|
||||
}
|
||||
```
|
||||
|
||||
3. **Rebuild to copy assets:**
|
||||
```bash
|
||||
ionic build
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### Service Worker Issues (Offline Mode)
|
||||
|
||||
**Problem**: Stale data cached, changes not appearing
|
||||
|
||||
**Solution:**
|
||||
|
||||
```bash
|
||||
# Clear service worker cache in Chrome DevTools
|
||||
Application → Storage → Clear site data
|
||||
|
||||
# Or disable service worker during development
|
||||
# Comment out service worker registration in index.html
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### Ionic CLI Not Found
|
||||
|
||||
**Error:**
|
||||
|
||||
```
|
||||
ionic: command not found
|
||||
```
|
||||
|
||||
**Solution:**
|
||||
|
||||
```bash
|
||||
# Install Ionic CLI globally (included in DevContainer)
|
||||
npm install -g @ionic/cli
|
||||
|
||||
# Verify installation
|
||||
ionic --version
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 📚 Additional Resources
|
||||
|
||||
- **Ionic 3 Documentation**: https://ionicframework.com/docs/v3/
|
||||
- **Angular 5 Documentation**: https://v5.angular.io/docs
|
||||
- **TypeScript Documentation**: https://www.typescriptlang.org/docs/handbook/basic-types.html
|
||||
- **RxJS 5 Documentation**: https://rxjs-dev.firebaseapp.com/api
|
||||
|
||||
---
|
||||
|
||||
## 🔗 Related Documentation
|
||||
|
||||
- [Root README](../README.md) - Project overview and quick start
|
||||
- [Backend README](../backend/README.md) - API server documentation
|
||||
- [API Reference](../backend/API.md) - REST API endpoints
|
||||
- [Database Schema](../backend/SCHEMA.md) - MongoDB collections
|
||||
- [DevContainer Guide](../.devcontainer/README.md) - Development environment
|
||||
- [Deployment Guide](../DEPLOYMENT.md) - Production deployment
|
||||
|
||||
---
|
||||
|
||||
**Need Help?** Check the [root troubleshooting section](../README.md#troubleshooting) or backend documentation for API-related issues.
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"name": "grindd",
|
||||
"app_id": "",
|
||||
"type": "ionic-angular",
|
||||
"integrations": {}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
{
|
||||
"name": "urge",
|
||||
"version": "0.0.1",
|
||||
"author": "Ionic Framework",
|
||||
"homepage": "http://ionicframework.com/",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"clean": "ionic-app-scripts clean",
|
||||
"build": "ionic-app-scripts build",
|
||||
"lint": "ionic-app-scripts lint",
|
||||
"ionic:build": "ionic-app-scripts build",
|
||||
"ionic:serve": "ionic-app-scripts serve"
|
||||
},
|
||||
"dependencies": {
|
||||
"@angular/common": "5.0.3",
|
||||
"@angular/compiler": "5.0.3",
|
||||
"@angular/compiler-cli": "5.0.3",
|
||||
"@angular/core": "5.0.3",
|
||||
"@angular/forms": "5.0.3",
|
||||
"@angular/http": "5.0.3",
|
||||
"@angular/platform-browser": "5.0.3",
|
||||
"@angular/platform-browser-dynamic": "5.0.3",
|
||||
"@ionic-native/core": "4.5.3",
|
||||
"@ionic-native/splash-screen": "4.5.3",
|
||||
"@ionic-native/status-bar": "4.5.3",
|
||||
"@ionic/storage": "2.1.3",
|
||||
"ionic-angular": "3.9.2",
|
||||
"ionic-swipe-all": "^1.2.0",
|
||||
"ionicons": "3.0.0",
|
||||
"moment": "^2.21.0",
|
||||
"rxjs": "5.5.2",
|
||||
"sw-toolbox": "3.6.0",
|
||||
"zone.js": "0.8.18"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@ionic/app-scripts": "3.2.4",
|
||||
"typescript": "2.4.2"
|
||||
},
|
||||
"description": "Nick Pfosi's exploration at modern gay app-based meeting and dating"
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { Platform } from 'ionic-angular';
|
||||
import { StatusBar } from '@ionic-native/status-bar';
|
||||
import { SplashScreen } from '@ionic-native/splash-screen';
|
||||
|
||||
import { TabsPage } from '../pages/tabs/tabs';
|
||||
|
||||
@Component({
|
||||
templateUrl: 'app.html'
|
||||
})
|
||||
export class Urnings {
|
||||
rootPage: any = TabsPage;
|
||||
|
||||
constructor(platform: Platform, statusBar: StatusBar, splashScreen: SplashScreen) {
|
||||
platform.ready().then(() => {
|
||||
// Okay, so the platform is ready and our plugins are available.
|
||||
// Here you can do any higher level native things you might need.
|
||||
statusBar.styleDefault();
|
||||
splashScreen.hide();
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
<ion-nav [root]="rootPage"></ion-nav>
|
||||
@@ -0,0 +1,65 @@
|
||||
import { NgModule, ErrorHandler } from '@angular/core';
|
||||
import { BrowserModule } from '@angular/platform-browser';
|
||||
import { HttpModule } from '@angular/http';
|
||||
import { IonicApp, IonicModule, IonicErrorHandler } from 'ionic-angular';
|
||||
import { IonicSwipeAllModule } from 'ionic-swipe-all';
|
||||
import { Urnings } from './app.component';
|
||||
|
||||
import { ChatPage } from '../pages/chat/chat';
|
||||
import { GridPage } from '../pages/grid/grid';
|
||||
import { InformationPage } from '../pages/information/information';
|
||||
import { LightboxPage } from '../pages/lightbox/lightbox';
|
||||
import { MessagesPage } from '../pages/messages/messages';
|
||||
import { ProfilePage } from '../pages/profile/profile';
|
||||
import { TabsPage } from '../pages/tabs/tabs';
|
||||
import { TellYourStoryPage } from '../pages/tell/tell';
|
||||
import { UsersPage } from '../pages/users/users';
|
||||
|
||||
import { StatusBar } from '@ionic-native/status-bar';
|
||||
import { SplashScreen } from '@ionic-native/splash-screen';
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
Urnings,
|
||||
ChatPage,
|
||||
InformationPage,
|
||||
GridPage,
|
||||
LightboxPage,
|
||||
MessagesPage,
|
||||
ProfilePage,
|
||||
TabsPage,
|
||||
TellYourStoryPage,
|
||||
UsersPage
|
||||
],
|
||||
imports: [
|
||||
BrowserModule,
|
||||
HttpModule,
|
||||
IonicSwipeAllModule,
|
||||
IonicModule.forRoot(Urnings, {
|
||||
iconMode: 'ios',
|
||||
modalEnter: 'modal-slide-in',
|
||||
modalLeave: 'modal-slide-out',
|
||||
tabsPlacement: 'bottom',
|
||||
pageTransition: 'ios-transition'
|
||||
})
|
||||
],
|
||||
bootstrap: [IonicApp],
|
||||
entryComponents: [
|
||||
Urnings,
|
||||
ChatPage,
|
||||
InformationPage,
|
||||
GridPage,
|
||||
LightboxPage,
|
||||
MessagesPage,
|
||||
ProfilePage,
|
||||
TabsPage,
|
||||
TellYourStoryPage,
|
||||
UsersPage
|
||||
],
|
||||
providers: [
|
||||
StatusBar,
|
||||
SplashScreen,
|
||||
{provide: ErrorHandler, useClass: IonicErrorHandler}
|
||||
]
|
||||
})
|
||||
export class AppModule {}
|
||||
@@ -0,0 +1,91 @@
|
||||
// http://ionicframework.com/docs/theming/
|
||||
|
||||
|
||||
// App Global Sass
|
||||
// --------------------------------------------------
|
||||
// Put style rules here that you want to apply globally. These
|
||||
// styles are for the entire app and not just one component.
|
||||
// Additionally, this file can be also used as an entry point
|
||||
// to import other Sass files to be included in the output CSS.
|
||||
//
|
||||
// Shared Sass variables, which can be used to adjust Ionic's
|
||||
// default Sass variables, belong in "theme/variables.scss".
|
||||
//
|
||||
// To declare rules for a specific mode, create a child rule
|
||||
// for the .md, .ios, or .wp mode classes. The mode class is
|
||||
// automatically applied to the <body> element in the app.
|
||||
|
||||
body {
|
||||
font-family: 'PT Sans', sans-serif;
|
||||
}
|
||||
|
||||
ion-toolbar {
|
||||
color: #fff;
|
||||
|
||||
.toolbar-background {
|
||||
background-color: #000000;
|
||||
}
|
||||
|
||||
.bar-button,
|
||||
.toolbar-title {
|
||||
color: #ffffff;
|
||||
}
|
||||
}
|
||||
|
||||
ion-title {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.content {
|
||||
background-color: #191b1c;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.item {
|
||||
background-color: #1d1e1f;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.list {
|
||||
|
||||
.item-block .item-inner {
|
||||
border-bottom-color: #333435;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.tabs {
|
||||
|
||||
.tabbar {
|
||||
background-color: #090a0a;
|
||||
}
|
||||
|
||||
.tab-button {
|
||||
|
||||
.tab-button-icon {
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
&[aria-selected=true] {
|
||||
|
||||
.tab-button-icon {
|
||||
color: #fdb315;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@media screen and (min-width: 769px) {
|
||||
body {
|
||||
background-color: #000000;
|
||||
}
|
||||
|
||||
ion-app.app-root {
|
||||
height: 480px;
|
||||
left: 50%;
|
||||
position: relative;
|
||||
top: 50%;
|
||||
transform: translate3d(-50%, -50%, 0);
|
||||
width: 320px;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
import { enableProdMode } from '@angular/core';
|
||||
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
||||
|
||||
import { AppModule } from './app.module';
|
||||
|
||||
enableProdMode();
|
||||
|
||||
platformBrowserDynamic().bootstrapModule(AppModule);
|
||||
@@ -0,0 +1 @@
|
||||
[{"order":1,"location":{"address":{"street1":"27 Normac Road","street2":"","locality":"Woburn","region":"MA","postal":"01801","country":"USA"},"loc":{"type":"Point","coordinates":[0,0]}},"name":"Bally","pic":{"detail":"images/cruise/bally_detail.jpg","thumb":"images/cruise/bally_thumbnail.jpg"},"text":"<p><b>Category:</b> Cruisy healthclub<br><b>Rating:</b> 1/5 stars<br><b>Submitted:</b> Nov 22 2008 (Edited 01/14/10)</p><p><b>Reviews:</b></p><div><p><b>username:</b> bearsboi<br><em>posted 02/14/2013</em></p><p>Great steam room.</p></div><div><p><b>username:</b> anon<br><em>posted 11/22/2008</em></p><p>is a shitty gym and their company is run by a bunch of crooks, but there is a group of guys here who go every night looking for sex. Some of the most amazing steamroom and shower room sex I've ever seen was in this gym. The guys do not seem to care if they get caught by staff or other patrons. There are also some aggressive trolls who do not take no for an answer.</p></div><p><em>Review(s) from CruisingForSex.com<em></p>"},{"order":2,"location":{"address":{"street1":"","street2":"","locality":"Woburn","region":"MA","postal":"","country":"USA"},"loc":{"type":"Point","coordinates":[0,0]}},"name":"Crowne Plaza Hotel","pic":{"detail":"images/cruise/crowne-plaza-2_detail.jpg","thumb":"images/cruise/crowne-plaza-2_thumbnail.jpg"},"text":"<p><em>In-Person Interview</em></p><p><b>Location:</b> Behind the Crowne Plaza Hotel in Woburn, USA</p><p>I believe I was over 21, but I don’t remember my age. This dude and I met on Craigslist so we had our emails back and forth, figuring out what we were gonna do. Long story short it was for me to pick him up and hang out in my car. We ended up smoking weed, and talking a bit. He had never hooked up with a dude before so this was all new for him. He was 18, a young twinkie-looking dude. We kind of hung out, smoked more, drove around. Chilled. I didn’t know where we could go. I didn’t know where he felt comfortable being. Yet we kind of landed here on a snowy night, the parking lot was packed actually. Even I was nervous cause it was Thursday night and my dad was in the Lion’s Club right here cause that’s where they hosted it. So I was asking myself “Why am I here,” but here I was regardless so we were kind of hanging out and I think we started making out a bit. My plan was not to stay here and ask him where he wanted to go cause we’re near the highway, and cause it’s Woburn so I know the area but he kind of got frisky and wanted to suck me off and I figured, “Why not? This is working well, let’s stay here for a little bit.” So he started blowing me and he liked to be a bit of a sub so he called me sir and stuff.</p><p>I don’t know how much time has past maybe forty minutes not even and my chair is reclined a bit. He’s doing his thing and I kind of open my eyes and I see this lovely cop with his flashlight walking in front of my car. The guy was was like literally sucking me off, and I was like dude get up, and he was like what, and I was like get up there’s a cop! I was nervous cause we had smoked and the cop walks over and I roll down the window and I was all like, “Hi officer how are you?” And he was by my window and like, “Hi, what’s going on…” only adding “if you’re gonna do that, maybe you should turn your lights off next time,” before walking letting us go.</p><p>So I turn to the guy I’m with and we’re both mouth agape and are like wow that was the chillest cop. I was in shock. He was in shock. I had never been caught so we were both thinking holy shit. And then, my hook up just said, we should go. And I was like, umm.. yeah!</p>"},{"order":3,"location":{"address":{"street1":"","street2":"","locality":"Boston","region":"MA","postal":"02116","country":"USA"},"loc":{"type":"Point","coordinates":[0,0]}},"name":"Charles River Esplanade","pic":{"detail":"images/cruise/esplanade_detail.jpg","thumb":"images/cruise/esplanade_thumbnail.jpg"},"text":"<p><b>Category:</b> Cruisy park<br><b>Submitted:</b> Jul 07 2007<br><b>Rating:</b> 3.56/5 stars</p><p><b>Reviews:</b></p><div><p><b>username:</b> anon<br><em>posted Jul 12 2007</em></p><p>I was there the other night and saw this dude who had been riding his bike walking with another dude. They sat on a bench near me and started feeling each other up. They came over to me and sat down. We went to a more secluded place and jacked each other off. Both dudes were hot. One had a nine inch cock and his buddy and I took turns sucking it.</p></div><div><p><b>username:</b> anon<br><em>posted Jul 07 2007</em></p><p>Along the Charles River from Arlington to Fairfield Streets at night is cruisy.</p></div><p><em>Review(s) from CruisingForSex.com</em></p>"},{"order":4,"location":{"address":{"street1":"","street2":"","locality":"Ludlow","region":"MA","postal":"","country":"United States"},"loc":{"type":"Point","coordinates":[0,0]}},"name":"First Church","pic":{"detail":"images/cruise/first-church_detaLine truncated
|
||||
@@ -0,0 +1 @@
|
||||
[{"order":0,"details":{"name":"Matt","about":"straight / new to gay world / insecure / fleeing Poland for greener pastures","pic":{"detail":"images/profile/profile-m-001_detail.jpg","thumb":"images/profile/profile-m-001_thumbnail.jpg"}},"messages":[{"text":"Disclaimer: Matt and I met while out on the gay club scene in Copenhagen. Matt is from Poland and struggles to be out as bisexual there. When we met it was his first time going to a gay club (or doing anything gay honestly). While we were chatting he created a Grindr account for the first time. He has been learning Danish and is planning on moving to Copenhagen partially because Denmark is known for being more LGBT-friendly than Poland. The following conversation occurred on Facebook Messenger.","isUser":false,"timestamp":"02/10/2018 8:26:00"},{"text":"You are now connected on Messenger.","isUser":false,"timestamp":"02/10/2018 8:27:15"},{"text":"Hey matt - nice meeting you last night - how was the rest of the evening","isUser":false,"timestamp":"02/10/2018 8:28:30"},{"text":"Hi :) I don't remember when have You left.. you were with us in the last bar, right?","isUser":true,"timestamp":"02/10/2018 8:29:45"},{"text":"Also, do You remember names of anyone ? I wanted to add them on facebook, so I can plan to meet them again. or maybe You have already planned something ?","isUser":true,"timestamp":"02/10/2018 10:58:00"},{"text":"Hey sorry I haven't replied","isUser":false,"timestamp":"02/11/2018 6:36:00"},{"text":"Was just packing and such for my flight back to the US","isUser":false,"timestamp":"02/11/2018 6:37:15"},{"text":"But now I've learned my flight is cancelled so I'm at a hotel haha","isUser":false,"timestamp":"02/11/2018 6:38:30"},{"text":"And probably won't be able to leave until Tues…","isUser":false,"timestamp":"02/11/2018 6:39:45"},{"text":"So if you wanted to get together again and maybe I could talk more about my project?","isUser":false,"timestamp":"02/11/2018 6:41:00"},{"text":"oh, you cant stay with Johan anymore ?","isUser":true,"timestamp":"02/11/2018 6:42:15"},{"text":"I can but the airline put me up here at their expense","isUser":false,"timestamp":"02/11/2018 6:43:30"},{"text":"ok :) I have no plans for today to be honest. I just asked at couple facebook groups and couchsurfing about who wants to meet up","isUser":true,"timestamp":"02/11/2018 6:44:45"},{"text":"so we can meet anytime you want :)","isUser":true,"timestamp":"02/11/2018 6:46:00"},{"text":"Haha cool. Tomorrow or later this week could work. I need to get some work done... And see the status of my flight.","isUser":false,"timestamp":"02/11/2018 6:47:15"},{"text":"Where are you staying","isUser":false,"timestamp":"02/11/2018 6:48:30"},{"text":"at rented room in Rodovre","isUser":true,"timestamp":"02/11/2018 6:49:45"},{"text":"15 minutes ride from the city center.","isUser":true,"timestamp":"02/11/2018 6:51:00"},{"text":"Mm ok. Like an Airbnb or?","isUser":false,"timestamp":"02/11/2018 6:52:15"},{"text":"yeah, exactly :)","isUser":true,"timestamp":"02/11/2018 6:53:30"},{"text":"Aahh okay. Yeah maybe we can get together at some point","isUser":false,"timestamp":"02/11/2018 6:54:45"},{"text":"Great. We can go wherever you want, I'm open for everything so, I'll wait for message from You, ok?","isUser":true,"timestamp":"02/11/2018 6:56:00"},{"text":"No yeah I'll reach out. I really want to here more about Poland","isUser":false,"timestamp":"02/11/2018 6:57:15"},{"text":"Ok :) so, I'll be waiting then","isUser":true,"timestamp":"02/11/2018 6:58:30"},{"text":"sigh. still not clear what my plan will be","isUser":false,"timestamp":"02/11/2018 12:06:00"},{"text":"I think I will be here at least until Tuesday…","isUser":false,"timestamp":"02/11/2018 12:07:15"},{"text":"well.. i spent all day here, havent gone anywhere","isUser":true,"timestamp":"02/11/2018 12:08:30"},{"text":"yeah I feel that...","isUser":false,"timestamp":"02/11/2018 12:09:45"},{"text":"now i am just hoping to meet someone .. i wrote on facebook groups, i am using couchsurfing hangouts... i am giving myself an hour. if i dont find anyone by 7 pm, I will go out alone...","isUser":true,"timestamp":"02/11/2018 12:11:00"},{"text":"I've definitely traveled to places and spent way to much time in my room haha","isUser":false,"timestamp":"02/11/2018 12:12:15"},{"text":"ok :) To be honest, sooner or later I would have to overcome my anxiety and go to a bar alone.","isUser":true,"timestamp":"02/11/2018 12:13:30"},{"text":"so why not today ?","isUser":true,"timestamp":"02/11/2018 12:14:45"},{"text":"Haha fair enough but bars aren't so fun alone on a Sunday I think.","isUser":false,"timestamp":"02/11/2018 12:16:00"},{"text":"I see…","isUser":true,"timestamp":"02/11/2018 12:17:15"},{"text":"well, I wrote to couple people on Grindr - downloaded it for the first time","isUser":true,"timestamp":"02/11/2018 12:18:30"},{"text":"nice tell me how it goes!","isUser":false,"timestamp":"02/11/2018 12:19:45"},{"text":"Ok. If I do Line truncated
|
||||
@@ -0,0 +1 @@
|
||||
[{"order":3,"details":{"name":"Jim","pic":{"detail":"images/profile/profile-j-002_detail.jpg","thumb":"images/profile/profile-j-002_thumbnail.jpg"},"about":"Jim is a psychologist, father and divorcee. He splits custody with his ex-husband over their adopted son and experiences Grindr as what he encapsulated as “desolation for the old.” It’d be no surprise to any Grindr user that the community on the app, and the gay community more generally, glamorizes youth and discards the old. Jim is a frequent victim of random cruelties, or otherwise summarily dismissed based on his age alone. While leading a loving life as a father and as an established professional, since his divorce, loneliness continues to creep into his heart."},"messages":[{"text":"Hi I may be too old or too large for you. If that’s the case please excuse me and have a great day. Say hi otherwise, I’m looking for friends or more. I’m a Great lover friend and top.","isUser":true,"timestamp":"11/20/2017 0:45:00"},{"text":"Sorry, just seeing this - hi!","isUser":false,"timestamp":"11/20/2017 15:16:00"},{"text":"Hi. How are you?","isUser":true,"timestamp":"11/20/2017 15:57:00"},{"text":"Good!","isUser":false,"timestamp":"11/20/2017 17:29:00"},{"text":"What’s happening?","isUser":true,"timestamp":"11/20/2017 17:46:00"},{"text":"You do photography as a professional?","isUser":true,"timestamp":"11/20/2017 18:09:00"},{"text":"Yes I do!","isUser":false,"timestamp":"11/20/2017 18:10:15"},{"text":"Cool. Fashion, Commercial?","isUser":true,"timestamp":"11/20/2017 18:11:30"},{"text":"Documentary actually.","isUser":false,"timestamp":"11/20/2017 18:12:45"},{"text":"But I do do commercial stuff too","isUser":false,"timestamp":"11/20/2017 18:14:00"},{"text":"Nice. Cool.","isUser":true,"timestamp":"11/20/2017 18:15:15"},{"text":"Why did you need some pictures done?","isUser":false,"timestamp":"11/20/2017 18:16:30"},{"text":"Actually not at the moment. You dont have lenses to make me.look.good.naked.","isUser":true,"timestamp":"11/20/2017 18:17:45"},{"text":"Don’t say that, but it’s up to you. No worries.","isUser":false,"timestamp":"11/20/2017 18:19:00"},{"text":"Thanks for understanding","isUser":true,"timestamp":"11/20/2017 18:20:15"},{"text":"Grindr is desolation for the old","isUser":true,"timestamp":"11/21/2017 00:44:00"},{"text":"Yeah?","isUser":false,"timestamp":"11/21/2017 00:45:15"},{"text":"Tell me more what you mean","isUser":false,"timestamp":"11/21/2017 00:46:30"},{"text":"The culture is so youth oriented. I’m a psychologist - did you know that the highest suicide rate is among gay men over 60? As an old guy you are useless.","isUser":true,"timestamp":"11/21/2017 00:47:45"},{"text":"Gay eople over the age of 40 really don’t go out to bars there are no social outlets. At 60 people are about to just be dead.","isUser":true,"timestamp":"11/21/2017 00:49:00"},{"text":"I see. Wow that’s hard to hear frankly","isUser":false,"timestamp":"11/21/2017 00:50:15"},{"text":"People put in their profiles that they don’t want to be contacted by over a certain age. That’s fine. But other people just put in that they don’t want to be hit on by creepy old man.","isUser":true,"timestamp":"11/21/2017 00:51:30"},{"text":"That lowers us","isUser":true,"timestamp":"11/21/2017 00:52:45"},{"text":"Yeah I hear that","isUser":false,"timestamp":"11/21/2017 00:54:00"},{"text":"And now when I want to try and meet people I have to try and present myself as apologetic in order to minimize the number of people who freak out and call me names.","isUser":true,"timestamp":"11/21/2017 00:55:15"},{"text":"And then there is the actual social aspect of the culture on Grindr. You could spend all night on here and not have one person say hello back or one real conversation or make one friend.","isUser":true,"timestamp":"11/21/2017 00:56:30"},{"text":"Some of my friends died. Others moved away. This place is like a hell you can’t avoid.","isUser":true,"timestamp":"11/21/2017 00:57:45"},{"text":"Grindr is like hell, a place you can’t avoid? Is that what you mean?","isUser":false,"timestamp":"11/21/2017 00:59:00"},{"text":"Yes","isUser":true,"timestamp":"11/21/2017 01:00:15"},{"text":"I have to say I’m a bit at a loss for words","isUser":false,"timestamp":"11/21/2017 01:01:30"},{"text":"Or you can come online and maybe have a superficial hello or get abused or sometimes get nothing at all. It’s like playing Russian Roulette. It’s addictive and you always keep hoping that you’re going to meet somebody.","isUser":true,"timestamp":"11/21/2017 01:02:45"},{"text":"Get abused? What do you mean by that?","isUser":false,"timestamp":"11/21/2017 01:04:00"},{"text":"Pretty demoralizing when people call you faggot or old or ugly or creep. I have even been told I ought to just go off and die.","isUser":true,"timestamp":"11/21/2017 01:05:15"},{"text":"Wow that’s awful","isUser":false,"timestamp":"11/21/2017 01:06:30"},{"text":"Don’t be too surprised this is happeLine truncated
|
||||
@@ -0,0 +1 @@
|
||||
[{"order":0,"details":{"name":"Me","pic":{"detail":"images/profile/profile-n-001_detail.jpg","thumb":"images/profile/profile-n-001_thumbnail.jpg"},"about":"<p>Urnings is a mixed media anthology of gay cis and transmasculine experiences in the often toxic, hypersexualized and evolving world of “the scene.” LGBT culture is always evolving and as our narratives continue to gain prevalence in the mainstream consciousness, particularly white, cis, male narratives, what it means to live as a queer person only continues to change. Apps like Grindr, Scruff, and others are, according to psychological research and overwhelming anecdotal evidence, making their users depressed, yet dependent, while also creating digital communities for people who otherwise would never feel safe entering the LGBT world. This project is a collaboration between myself and the people I work with, intentionally focused on cis male and transmasculine experiences only for the purpose of concision. The work is ongoing. It incorporates interviews done in person, through the dating app Grindr, and various text message platforms, as well as various kinds of photographs (i.e. portraiture, reportage, landscape). The presentation is through this app which is intentionally an imitation of Grindr, through which users, both who are familiar with gay dating apps and those who are not, can understand how this world is impacting the LGBT community. Navigate through profiles or move to the other tabs. Cruising is a series of landscapes made of either known cruising locations sourced by the database CruisingForSex.com or from individual accounts from people I’ve met. The work is ongoing and artistic in its commentary. Interviews are edited for clarity and brevity.</p><p>Research, photography and interviews by Nicholas Pfosi</p><p>Web development and design by Michael Fitzpatrick</p>"},"messages":[{"text":"Dinner is super yummy, thanks for cooking","isUser":false,"timestamp":"3/8/2018 22:53:00"},{"text":"Gooooooddd - you're welcome","isUser":true,"timestamp":"3/8/2018 22:54:15"},{"image":"images/message/avery_nick.jpg","isUser":false,"timestamp":"3/8/2018 22:55:30"},{"text":"Interview thing soon maybe?:","isUser":false,"timestamp":"3/8/2018 22:56:45"},{"text":"Yes indeed","isUser":true,"timestamp":"3/8/2018 22:58:00"},{"text":"Do you want wine? It occurs to me inebriation might facilitate things haha","isUser":false,"timestamp":"3/8/2018 22:59:15"},{"text":"I cannot become inebriated because workkkk","isUser":true,"timestamp":"3/8/2018 23:00:30"},{"text":"Don't you have to work on your project too","isUser":true,"timestamp":"3/8/2018 23:01:45"},{"text":"haha very much so but wine helps the creative juices flow ;)","isUser":false,"timestamp":"3/8/2018 23:03:00"},{"text":"or maybe just mitigates the stress of getting it done by my first deadline","isUser":false,"timestamp":"3/8/2018 23:04:15"},{"text":"What's it actually about that makes it so big for you?","isUser":true,"timestamp":"3/8/2018 23:05:30"},{"text":"i guess it's just the fact that it's ultimately really personal. work i've done in the past has been personal sure, but somehow i feel naked when people look at this project. as much as so many of the guys are vulnerable in what they tell me, i feel put out there too. revealed through what i focus on or what i say in the interviews. it's as much as my take on gay life or whatever as anything empirical, if that makes sense.","isUser":false,"timestamp":"3/8/2018 23:06:45"},{"image":"images/message/img033.jpg","isUser":false,"timestamp":"3/8/2018 23:08:00"},{"text":"Put out there?","isUser":true,"timestamp":"3/8/2018 23:09:15"},{"text":"yeah ... just in the sense that a lot of my thoughts, opinions are guiding this project... if it's rejected, if it falls on deaf ears, it's like telling a joke and no one laughs, or raising a point and everyone in the room disagrees. it's scary like that.","isUser":false,"timestamp":"3/8/2018 23:10:30"},{"text":"not to mention the subject matter is just more intimate. ive played around creatively... sure i do some commercial job or newspaper work... even i know when the pictures suck, i did a bad job or whatever... it's removed from who i am outside of my work","isUser":false,"timestamp":"3/8/2018 23:11:45"},{"text":"in some ways this project doesnt feel removed. it feels like a physicalization of how i feel, how i think in my head","isUser":false,"timestamp":"3/8/2018 23:13:00"},{"text":"I mean I feel that, it seems relevant considering the place you're coming from too in \"gay culture","isUser":true,"timestamp":"3/8/2018 23:14:15"},{"text":"what do you mean","isUser":false,"timestamp":"3/8/2018 23:15:30"},{"text":"I mean we met through that gay hookup \"Grindr\" culture haha, the journey out of that into something more healthy and meaningful was a twisty road at times","isUser":true,"timestamp":"3/8/2018 23:16:45"},{"text":"haha yeah that's true. i forget we're kind of the grindr success story in a way.","isUser":Line truncated
|
||||
|
After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 616 KiB After Width: | Height: | Size: 616 KiB |
|
Before Width: | Height: | Size: 141 KiB After Width: | Height: | Size: 141 KiB |
|
Before Width: | Height: | Size: 370 KiB After Width: | Height: | Size: 370 KiB |
|
Before Width: | Height: | Size: 97 KiB After Width: | Height: | Size: 97 KiB |
|
Before Width: | Height: | Size: 381 KiB After Width: | Height: | Size: 381 KiB |
|
Before Width: | Height: | Size: 106 KiB After Width: | Height: | Size: 106 KiB |
|
Before Width: | Height: | Size: 469 KiB After Width: | Height: | Size: 469 KiB |
|
Before Width: | Height: | Size: 139 KiB After Width: | Height: | Size: 139 KiB |
|
Before Width: | Height: | Size: 748 KiB After Width: | Height: | Size: 748 KiB |
|
Before Width: | Height: | Size: 143 KiB After Width: | Height: | Size: 143 KiB |
|
Before Width: | Height: | Size: 600 KiB After Width: | Height: | Size: 600 KiB |
|
Before Width: | Height: | Size: 130 KiB After Width: | Height: | Size: 130 KiB |
|
Before Width: | Height: | Size: 816 KiB After Width: | Height: | Size: 816 KiB |
|
Before Width: | Height: | Size: 120 KiB After Width: | Height: | Size: 120 KiB |
|
Before Width: | Height: | Size: 746 KiB After Width: | Height: | Size: 746 KiB |
|
Before Width: | Height: | Size: 221 KiB After Width: | Height: | Size: 221 KiB |
|
Before Width: | Height: | Size: 422 KiB After Width: | Height: | Size: 422 KiB |
|
Before Width: | Height: | Size: 106 KiB After Width: | Height: | Size: 106 KiB |
|
Before Width: | Height: | Size: 445 KiB After Width: | Height: | Size: 445 KiB |
|
Before Width: | Height: | Size: 117 KiB After Width: | Height: | Size: 117 KiB |
|
Before Width: | Height: | Size: 358 KiB After Width: | Height: | Size: 358 KiB |
|
Before Width: | Height: | Size: 424 KiB After Width: | Height: | Size: 424 KiB |
|
Before Width: | Height: | Size: 427 KiB After Width: | Height: | Size: 427 KiB |
|
Before Width: | Height: | Size: 466 KiB After Width: | Height: | Size: 466 KiB |
|
Before Width: | Height: | Size: 372 KiB After Width: | Height: | Size: 372 KiB |
|
Before Width: | Height: | Size: 1.3 MiB After Width: | Height: | Size: 1.3 MiB |
|
Before Width: | Height: | Size: 183 KiB After Width: | Height: | Size: 183 KiB |
|
Before Width: | Height: | Size: 182 KiB After Width: | Height: | Size: 182 KiB |
|
Before Width: | Height: | Size: 194 KiB After Width: | Height: | Size: 194 KiB |
|
Before Width: | Height: | Size: 1.7 MiB After Width: | Height: | Size: 1.7 MiB |
|
Before Width: | Height: | Size: 153 KiB After Width: | Height: | Size: 153 KiB |
|
Before Width: | Height: | Size: 275 KiB After Width: | Height: | Size: 275 KiB |
|
Before Width: | Height: | Size: 75 KiB After Width: | Height: | Size: 75 KiB |
|
Before Width: | Height: | Size: 406 KiB After Width: | Height: | Size: 406 KiB |
|
Before Width: | Height: | Size: 624 KiB After Width: | Height: | Size: 624 KiB |
|
Before Width: | Height: | Size: 573 KiB After Width: | Height: | Size: 573 KiB |
|
Before Width: | Height: | Size: 64 KiB After Width: | Height: | Size: 64 KiB |
|
After Width: | Height: | Size: 45 KiB |
|
After Width: | Height: | Size: 45 KiB |
|
After Width: | Height: | Size: 25 KiB |
|
After Width: | Height: | Size: 25 KiB |
|
After Width: | Height: | Size: 13 KiB |
|
After Width: | Height: | Size: 158 KiB |
@@ -0,0 +1,57 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en" dir="ltr">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Urnings</title>
|
||||
<meta name="viewport" content="viewport-fit=cover, width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
|
||||
<meta name="format-detection" content="telephone=no">
|
||||
<meta name="msapplication-tap-highlight" content="no">
|
||||
|
||||
<link rel="icon" type="image/x-icon" href="assets/icon/favicon.ico">
|
||||
<link rel="manifest" href="manifest.json">
|
||||
<meta name="theme-color" content="#4e8ef7">
|
||||
|
||||
<!-- add to homescreen for ios -->
|
||||
<link rel="apple-touch-icon" href="assets/imgs/logo.png">
|
||||
<link rel="apple-touch-startup-image" sizes="640x1136" href="assets/imgs/launch-screen-640x1136.png">
|
||||
<link rel="apple-touch-startup-image" sizes="750x1334" href="assets/imgs/launch-screen-750x1334.png">
|
||||
<link rel="apple-touch-startup-image" sizes="1125x2436" href="assets/imgs/launch-screen-1125x2436.png">
|
||||
<link rel="apple-touch-startup-image" sizes="1242x2208" href="assets/imgs/launch-screen-1242x2208.png">
|
||||
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="black">
|
||||
<meta name="apple-mobile-web-app-title" content="Urge">
|
||||
|
||||
<!-- cordova.js required for cordova apps (remove if not needed) -->
|
||||
<!--script src="cordova.js"></script-->
|
||||
|
||||
<!-- un-comment this code to enable service worker
|
||||
<script>
|
||||
if ('serviceWorker' in navigator) {
|
||||
navigator.serviceWorker.register('service-worker.js')
|
||||
.then(() => console.log('service worker installed'))
|
||||
.catch(err => console.error('Error', err));
|
||||
}
|
||||
</script>-->
|
||||
|
||||
<link href="https://fonts.googleapis.com/css?family=PT+Sans" rel="stylesheet">
|
||||
<link href="build/main.css" rel="stylesheet">
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<!-- Ionic's root component and where the app will load -->
|
||||
<ion-app></ion-app>
|
||||
|
||||
<!-- The polyfills js is generated during the build process -->
|
||||
<script src="build/polyfills.js"></script>
|
||||
|
||||
<!-- The vendor js is generated during the build process
|
||||
It contains all of the dependencies in node_modules -->
|
||||
<script src="build/vendor.js"></script>
|
||||
|
||||
<!-- The main bundle js is generated during the build process -->
|
||||
<script src="build/main.js"></script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"name": "urge",
|
||||
"short_name": "urge",
|
||||
"start_url": "index.html",
|
||||
"display": "standalone",
|
||||
"icons": [{
|
||||
"src": "assets/imgs/logo.png",
|
||||
"sizes": "512x512",
|
||||
"type": "image/png"
|
||||
}],
|
||||
"background_color": "#191b1c",
|
||||
"theme_color": "#191b1c"
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
<ion-header>
|
||||
<ion-toolbar>
|
||||
<ion-buttons left>
|
||||
<button ion-button icon-only (tap)="closeChat($event)">
|
||||
<ion-icon name="arrow-back"></ion-icon>
|
||||
</button>
|
||||
</ion-buttons>
|
||||
<ion-title
|
||||
><img
|
||||
class="title-profile-avatar"
|
||||
[src]="'/assets/' + this.profile.details.pic.thumb"
|
||||
height="24"
|
||||
width="24"
|
||||
/>
|
||||
{{this.profile.details.name}}</ion-title
|
||||
>
|
||||
</ion-toolbar>
|
||||
</ion-header>
|
||||
|
||||
<ion-content>
|
||||
<ion-list>
|
||||
<ion-item
|
||||
class="message-bubble"
|
||||
*ngFor="let message of this.profile.messages"
|
||||
[ngClass]="{ 'is-user': (message.isUser == true) }"
|
||||
>
|
||||
<img
|
||||
*ngIf="message.image"
|
||||
[src]="'/assets/' + message.image"
|
||||
(press)="showLightbox($event, message.image)"
|
||||
/>
|
||||
<p *ngIf="message.text != ''">{{message.text}}</p>
|
||||
</ion-item>
|
||||
</ion-list>
|
||||
</ion-content>
|
||||
|
||||
<ion-footer>
|
||||
<ion-toolbar> </ion-toolbar>
|
||||
</ion-footer>
|
||||
@@ -0,0 +1,48 @@
|
||||
page-chat {
|
||||
|
||||
.toolbar-title {
|
||||
|
||||
.title-profile-avatar {
|
||||
vertical-align: bottom;
|
||||
}
|
||||
}
|
||||
|
||||
.list {
|
||||
|
||||
.message-bubble {
|
||||
background-color: #fdb315;
|
||||
border-radius: 0.5rem;
|
||||
font-family: 'Helvetica Neue', HelveticaNeue, Helvetica, Arial, sans-serif;
|
||||
line-height: 1.5;
|
||||
margin: 1rem 1rem 2.5rem auto;
|
||||
max-width: 75%;
|
||||
overflow: visible;
|
||||
padding: 0.75rem;
|
||||
position: relative;
|
||||
|
||||
&.is-user {
|
||||
background-color: #6fbedf;
|
||||
margin: 1rem auto 2.5rem 1rem;
|
||||
}
|
||||
|
||||
.item-inner {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
ion-label {
|
||||
overflow: visible;
|
||||
text-overflow: unset;
|
||||
margin: 0 0.75rem;
|
||||
}
|
||||
|
||||
p {
|
||||
color: #1d1e1f;
|
||||
white-space: normal;
|
||||
|
||||
&.timestamp {
|
||||
color: #acacac;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { NavController, NavParams } from 'ionic-angular';
|
||||
|
||||
import { LightboxPage } from '../lightbox/lightbox';
|
||||
|
||||
@Component({
|
||||
selector: 'page-chat',
|
||||
templateUrl: 'chat.html'
|
||||
})
|
||||
|
||||
export class ChatPage {
|
||||
|
||||
profile: any;
|
||||
tabNavEl: any;
|
||||
|
||||
constructor(public navCtrl: NavController, private _params: NavParams) {
|
||||
this.profile = this._params.get('profile');
|
||||
this.tabNavEl = document.querySelector('#tab-nav .tabbar');
|
||||
}
|
||||
|
||||
ionViewWillEnter() {
|
||||
this.tabNavEl.style.display = 'none';
|
||||
}
|
||||
|
||||
closeChat(event) {
|
||||
this.navCtrl.pop();
|
||||
}
|
||||
|
||||
showLightbox(event, image) {
|
||||
this.navCtrl.push(LightboxPage, {
|
||||
image: image
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
<ion-header>
|
||||
<ion-toolbar>
|
||||
<ion-title>looking?</ion-title>
|
||||
</ion-toolbar>
|
||||
</ion-header>
|
||||
|
||||
<ion-content no-padding>
|
||||
<ion-grid no-padding>
|
||||
<ion-row align-items-stretch>
|
||||
<ion-col
|
||||
col-4
|
||||
class="profile"
|
||||
*ngFor="let current of profiles"
|
||||
(tap)="profileTapped($event, current)"
|
||||
(press)="profilePressed($event, current)"
|
||||
[style.backgroundImage]="getBackgroundThumbnail(current.details.pic)"
|
||||
>
|
||||
<span
|
||||
class="username"
|
||||
[ngClass]="{ 'online': (current.messages?.length > 0) }"
|
||||
>{{current.details.name}}</span
|
||||
>
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
</ion-grid>
|
||||
</ion-content>
|
||||
@@ -0,0 +1,66 @@
|
||||
page-grid {
|
||||
|
||||
ion-toolbar {
|
||||
|
||||
.toolbar-title {
|
||||
color: #ffffff;
|
||||
font-size: 2.42em;
|
||||
font-weight: 700;
|
||||
line-height: 1.29;
|
||||
text-decoration: underline;
|
||||
}
|
||||
}
|
||||
|
||||
.grid {
|
||||
|
||||
.row {
|
||||
|
||||
.col {
|
||||
|
||||
&.profile {
|
||||
background-size: cover;
|
||||
border: 1px solid #000000;
|
||||
box-sizing: border-box;
|
||||
padding: 0 0 33% !important;
|
||||
position: relative;
|
||||
|
||||
.username {
|
||||
background-size: cover;
|
||||
bottom: 0.25rem;
|
||||
box-sizing: border-box;
|
||||
color: #ffffff;
|
||||
display: inline-block;
|
||||
left: 0.5rem;
|
||||
overflow: hidden;
|
||||
position: absolute;
|
||||
right: 0.25rem;
|
||||
text-overflow: ellipsis;
|
||||
text-shadow: 0 0 3px rgba(0, 0, 0, 1);
|
||||
white-space: nowrap;
|
||||
|
||||
&::before {
|
||||
border: 0.125rem solid #acacac;
|
||||
border-radius: 1rem;
|
||||
bottom: 0.125rem;
|
||||
content: '';
|
||||
display: inline-block;
|
||||
height: 0.8rem;
|
||||
margin-right: 0.5rem;
|
||||
position: relative;
|
||||
vertical-align: middle;
|
||||
width: 0.8rem;
|
||||
}
|
||||
|
||||
&.online {
|
||||
|
||||
&::before {
|
||||
background-color: #00ff00;
|
||||
border-color: #00ff00;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
import { Component } from "@angular/core";
|
||||
import { DomSanitizer } from "@angular/platform-browser";
|
||||
import { NavController } from "ionic-angular";
|
||||
|
||||
import { ChatPage } from "../chat/chat";
|
||||
import { ProfileService } from "../../services/profiles";
|
||||
import { ProfilePage } from "../profile/profile";
|
||||
|
||||
@Component({
|
||||
selector: "page-grid",
|
||||
templateUrl: "grid.html",
|
||||
providers: [ProfileService],
|
||||
})
|
||||
export class GridPage {
|
||||
profiles: any;
|
||||
tabNavEl: any;
|
||||
|
||||
constructor(
|
||||
public navCtrl: NavController,
|
||||
public profileService: ProfileService,
|
||||
private _sanitizer: DomSanitizer
|
||||
) {
|
||||
profileService.loadVerified().then((data) => {
|
||||
this.profiles = data;
|
||||
console.debug("profiles: ", this.profiles);
|
||||
});
|
||||
this.tabNavEl = document.querySelector("#tab-nav .tabbar");
|
||||
}
|
||||
|
||||
ionViewWillEnter() {
|
||||
this.tabNavEl.style.display = "flex";
|
||||
}
|
||||
|
||||
doTellStory() {
|
||||
// this.navCtrl.push(TellYourStoryPage);
|
||||
}
|
||||
|
||||
getBackgroundThumbnail(pics) {
|
||||
return this._sanitizer.bypassSecurityTrustStyle(
|
||||
"url(/assets/" + pics.thumb + ")"
|
||||
);
|
||||
}
|
||||
|
||||
profilePressed(event, profile) {
|
||||
if (profile.messages && profile.messages.length) {
|
||||
this.navCtrl.push(ChatPage, {
|
||||
profile: profile,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
profileTapped(event, profile) {
|
||||
this.navCtrl.push(ProfilePage, {
|
||||
profile: profile,
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
<ion-header>
|
||||
<ion-toolbar>
|
||||
<ion-buttons right>
|
||||
<button ion-button icon-only (tap)="close($event)">
|
||||
<ion-icon name="close"></ion-icon>
|
||||
</button>
|
||||
</ion-buttons>
|
||||
</ion-toolbar>
|
||||
</ion-header>
|
||||
|
||||
<ion-content padding>
|
||||
<div class="content-box" padding margin>
|
||||
<h3>About this Project</h3>
|
||||
<div class="info-blurb">
|
||||
<p>The app was designed by Nicholas Pfosi and developed by Michael Fitzpatrick, modeled after the popular gay dating app Grindr.</p>
|
||||
<p>Presenting these stories in this form, which is the conduit through which much participation in dating occurs, served multiple purposes. First, it educated the viewer who may not have used Grindr before, how it functions and how it is different from other apps such as Tinder, whereby matching with a person is a prerequisite for conversation. Second, it makes the scope of the project flexible, allowing for the submission of stories from the audience to be slotted into an expandable presentation.</p>
|
||||
<p>Please direct any questions or concerns to Nicholas Pfosi at npfosi@gmail.com</p>
|
||||
</div>
|
||||
</div>
|
||||
</ion-content>
|
||||
@@ -0,0 +1,9 @@
|
||||
page-information {
|
||||
|
||||
.content-box {
|
||||
background-color: #ffffff;
|
||||
color: #000000;
|
||||
font-family: 'Helvetica Neue', HelveticaNeue, Helvetica, Arial, sans-serif;
|
||||
line-height: 1.5;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { NavController } from 'ionic-angular';
|
||||
|
||||
@Component({
|
||||
selector: 'page-information',
|
||||
templateUrl: 'information.html',
|
||||
})
|
||||
export class InformationPage {
|
||||
|
||||
tabNavEl: any;
|
||||
|
||||
constructor(public navCtrl: NavController) {
|
||||
this.tabNavEl = document.querySelector('#tab-nav .tabbar');
|
||||
}
|
||||
|
||||
ionViewWillEnter() {
|
||||
this.tabNavEl.style.display = 'none';
|
||||
}
|
||||
|
||||
close(event) {
|
||||
this.navCtrl.pop();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
<ion-header>
|
||||
<ion-toolbar>
|
||||
<ion-buttons right>
|
||||
<button ion-button icon-only (tap)="close($event)">
|
||||
<ion-icon name="close"></ion-icon>
|
||||
</button>
|
||||
</ion-buttons>
|
||||
</ion-toolbar>
|
||||
</ion-header>
|
||||
|
||||
<ion-content (click)="close($event)">
|
||||
<img class="image-detail" [src]="'https://appsby.fitz.guru/urge/' + this.image">
|
||||
</ion-content>
|
||||
@@ -0,0 +1,11 @@
|
||||
page-lightbox {
|
||||
|
||||
.image-detail {
|
||||
display: block;
|
||||
height: auto;
|
||||
position: relative;
|
||||
top: 50%;
|
||||
transform: translate3d(0, -50%, 0);
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { NavController, NavParams } from 'ionic-angular';
|
||||
|
||||
@Component({
|
||||
selector: 'page-lightbox',
|
||||
templateUrl: 'lightbox.html'
|
||||
})
|
||||
|
||||
export class LightboxPage {
|
||||
|
||||
image: string;
|
||||
tabNavEl: any;
|
||||
|
||||
constructor(public navCtrl: NavController, private _params: NavParams) {
|
||||
this.image = this._params.get('image');
|
||||
this.tabNavEl = document.querySelector('#tab-nav .tabbar');
|
||||
}
|
||||
|
||||
ionViewWillEnter() {
|
||||
this.tabNavEl.style.display = 'none';
|
||||
}
|
||||
|
||||
close(event) {
|
||||
this.navCtrl.pop();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
<ion-header>
|
||||
<ion-toolbar>
|
||||
<ion-title>Urnings</ion-title>
|
||||
</ion-toolbar>
|
||||
</ion-header>
|
||||
|
||||
<ion-content no-padding>
|
||||
<ion-list>
|
||||
<ng-container *ngFor="let profile of profiles">
|
||||
<ion-item no-padding *ngIf="profile.messages?.length > 0">
|
||||
<ion-thumbnail
|
||||
padding-left
|
||||
item-start
|
||||
(tap)="profilePictureTapped($event, profile)"
|
||||
>
|
||||
<img [src]="'/assets/' + profile.details.pic.thumb" />
|
||||
</ion-thumbnail>
|
||||
<ion-grid (tap)="interviewTapped($event, profile)">
|
||||
<ion-row nowrap justify-content-between>
|
||||
<ion-col class="username"> {{profile.details.name}} </ion-col>
|
||||
<ion-col
|
||||
class="timestamp"
|
||||
[innerHTML]="getLatestMessageTimestamp(profile.messages)"
|
||||
></ion-col>
|
||||
</ion-row>
|
||||
<ion-row class="latest-message" nowrap>
|
||||
<ion-col [innerHTML]="getLatestMessage(profile.messages)"></ion-col>
|
||||
</ion-row>
|
||||
</ion-grid>
|
||||
</ion-item>
|
||||
</ng-container>
|
||||
</ion-list>
|
||||
</ion-content>
|
||||
@@ -0,0 +1,47 @@
|
||||
page-messages {
|
||||
|
||||
ion-toolbar {
|
||||
|
||||
.toolbar-title {
|
||||
color: #ffffff;
|
||||
font-size: 2.42em;
|
||||
font-weight: 700;
|
||||
line-height: 1.29;
|
||||
text-decoration: underline;
|
||||
}
|
||||
}
|
||||
|
||||
ion-header {
|
||||
|
||||
.button {
|
||||
color: #9e9ea8;
|
||||
}
|
||||
}
|
||||
|
||||
.col {
|
||||
color: #ffffff;
|
||||
font-family: 'Helvetica Neue', HelveticaNeue, Helvetica, Arial, sans-serif;
|
||||
line-height: 1.5;
|
||||
|
||||
&.username {
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
&.timestamp {
|
||||
font-size: 0.7em;
|
||||
font-style: italic;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.latest-message {
|
||||
font-size: 0.8em;
|
||||
}
|
||||
}
|
||||
|
||||
.list {
|
||||
|
||||
> .item-block:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { NavController } from 'ionic-angular';
|
||||
|
||||
import { ProfileService } from '../../services/profiles';
|
||||
import { ProfilePage } from '../profile/profile';
|
||||
import { ChatPage } from '../chat/chat';
|
||||
|
||||
import moment from 'moment';
|
||||
|
||||
@Component({
|
||||
selector: 'page-messages',
|
||||
templateUrl: 'messages.html',
|
||||
providers: [ ProfileService ]
|
||||
})
|
||||
export class MessagesPage {
|
||||
|
||||
profiles: any;
|
||||
tabNavEl: any;
|
||||
|
||||
constructor(public navCtrl: NavController, public profileService: ProfileService) {
|
||||
profileService.load().then((data) => {
|
||||
this.profiles = data;
|
||||
});
|
||||
this.tabNavEl = document.querySelector('#tab-nav .tabbar');
|
||||
}
|
||||
|
||||
ionViewWillEnter() {
|
||||
this.tabNavEl.style.display = 'flex';
|
||||
}
|
||||
|
||||
getLatestMessage(messages) {
|
||||
var latest = messages[(messages.length - 1)];
|
||||
var isUser = latest.isUser;
|
||||
return latest.text ? latest.text : '<em>' + (!isUser ? 'Sent ' : '') + 'Photo' + (isUser ? ' Recieved' : '') + '</em>';
|
||||
}
|
||||
|
||||
getLatestMessageTimestamp(messages) {
|
||||
return moment(messages[(messages.length - 1)].timestamp).fromNow();
|
||||
}
|
||||
|
||||
interviewTapped(event, profile) {
|
||||
this.navCtrl.push(ChatPage, {
|
||||
profile: profile
|
||||
});
|
||||
}
|
||||
|
||||
profilePictureTapped(event, profile) {
|
||||
this.navCtrl.push(ProfilePage, {
|
||||
profile: profile
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
<ion-content no-padding [style.backgroundImage]="getBackground(profile.details.pic)" (press)="showLightbox($event, profile.details.pic.detail)" on-swipe-left="nextProfile($event)" on-swipe-right="previousProfile($event)">
|
||||
<ion-toolbar class="profile-toolbar">
|
||||
<ion-buttons left>
|
||||
<button ion-button icon-only (tap)="closeProfile($event)">
|
||||
<ion-icon name="arrow-back"></ion-icon>
|
||||
</button>
|
||||
</ion-buttons>
|
||||
<ion-title>{{this.profile.details.name}}</ion-title>
|
||||
</ion-toolbar>
|
||||
|
||||
<button ion-button icon-only clear large (tap)="openChat($event, this.profile)" class="button-chat">
|
||||
<ion-icon name="ios-chatboxes"></ion-icon>
|
||||
</button>
|
||||
|
||||
<div id="detail-overlay" class="details">
|
||||
<ion-grid>
|
||||
<ion-row nowrap align-items-center justify-content-between>
|
||||
<ion-col col-12 text-center (click)="toggleProfileDetails($event)" class="detail-toggle">
|
||||
<ion-icon name="arrow-down"></ion-icon>
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
<ion-row class="about" *ngIf="this.profile.details.about">
|
||||
<ion-col col-12 [innerHTML]="this.profile.details.about"></ion-col>
|
||||
</ion-row>
|
||||
</ion-grid>
|
||||
</div>
|
||||
</ion-content>
|
||||
@@ -0,0 +1,72 @@
|
||||
page-profile {
|
||||
|
||||
ion-content {
|
||||
background-position: center;
|
||||
background-repeat: no-repeat;
|
||||
background-size: cover;
|
||||
}
|
||||
|
||||
.scroll-content {
|
||||
overflow-y: hidden;
|
||||
}
|
||||
|
||||
ion-toolbar {
|
||||
border-bottom: 1px solid #ffffff;
|
||||
transition: opacity 250ms 125ms ease-in-out;
|
||||
|
||||
&.hidden {
|
||||
opacity: 0;
|
||||
z-index: -1;
|
||||
}
|
||||
|
||||
.toolbar-background {
|
||||
background-color: rgba(0, 0, 0, 1);
|
||||
}
|
||||
|
||||
.bar-button,
|
||||
.toolbar-title {
|
||||
color: #ffffff;
|
||||
}
|
||||
}
|
||||
|
||||
.button-chat {
|
||||
bottom: 3rem;
|
||||
color: #fdb315;
|
||||
position: absolute;
|
||||
right: 1.5rem;
|
||||
z-index: 100;
|
||||
}
|
||||
|
||||
.detail-toggle {
|
||||
font-size: 2.5em;
|
||||
z-index: 100;
|
||||
}
|
||||
|
||||
.details {
|
||||
bottom: 0;
|
||||
height: 60px;
|
||||
left: 0;
|
||||
position: absolute;
|
||||
right: 0;
|
||||
transition: all 250ms 125ms ease-in-out;
|
||||
|
||||
&.open {
|
||||
background: rgba(0, 0, 0, 0.8);
|
||||
height: 100%;
|
||||
overflow-y: scroll;
|
||||
}
|
||||
|
||||
.about {
|
||||
font-family: 'Helvetica Neue', HelveticaNeue, Helvetica, Arial, sans-serif;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.actions {
|
||||
text-align: right;
|
||||
|
||||
.button-clear {
|
||||
color: #fdb315;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
import { Component } from "@angular/core";
|
||||
import { DomSanitizer } from "@angular/platform-browser";
|
||||
import { NavController, NavParams } from "ionic-angular";
|
||||
|
||||
import { ChatPage } from "../chat/chat";
|
||||
import { LightboxPage } from "../lightbox/lightbox";
|
||||
import { ProfileService } from "../../services/profiles";
|
||||
|
||||
@Component({
|
||||
selector: "page-profile",
|
||||
templateUrl: "profile.html",
|
||||
providers: [ProfileService],
|
||||
})
|
||||
export class ProfilePage {
|
||||
detailsOpen: boolean = false;
|
||||
profile: any;
|
||||
tabNavEl: any;
|
||||
|
||||
constructor(
|
||||
public navCtrl: NavController,
|
||||
public navParams: NavParams,
|
||||
public profileService: ProfileService,
|
||||
private _sanitizer: DomSanitizer
|
||||
) {
|
||||
this.profile = navParams.get("profile");
|
||||
this.tabNavEl = document.querySelector("#tab-nav .tabbar");
|
||||
}
|
||||
|
||||
ionViewWillEnter() {
|
||||
this.tabNavEl.style.display = "none";
|
||||
}
|
||||
|
||||
closeProfile(event) {
|
||||
this.navCtrl.pop();
|
||||
}
|
||||
|
||||
closeProfileDetails(event) {
|
||||
if (this.detailsOpen) {
|
||||
this.detailsOpen = false;
|
||||
document.querySelector(".profile-toolbar").classList.remove("hidden");
|
||||
document.getElementById("detail-overlay").classList.remove("open");
|
||||
}
|
||||
}
|
||||
|
||||
getBackground(pics) {
|
||||
return this._sanitizer.bypassSecurityTrustStyle(
|
||||
"url(/assets/" + pics.detail + ")"
|
||||
);
|
||||
}
|
||||
|
||||
markFavorite(event, profile) {
|
||||
console.debug("favorite profile", { event: event, profile: profile });
|
||||
}
|
||||
|
||||
nextProfile(event) {
|
||||
this.profile = this.profileService.getNextProfile(this.profile._id);
|
||||
this.navCtrl.setRoot(this.navCtrl.getActive().component);
|
||||
}
|
||||
|
||||
openChat(event, profile) {
|
||||
this.navCtrl.push(ChatPage, {
|
||||
profile: profile,
|
||||
});
|
||||
}
|
||||
|
||||
openProfileDetails(event) {
|
||||
if (!this.detailsOpen) {
|
||||
this.detailsOpen = true;
|
||||
document.querySelector(".profile-toolbar").classList.add("hidden");
|
||||
document.getElementById("detail-overlay").classList.add("open");
|
||||
}
|
||||
}
|
||||
|
||||
previousProfile(event) {
|
||||
this.profile = this.profileService.getPreviousProfile(this.profile._id);
|
||||
this.navCtrl.setRoot(this.navCtrl.getActive().component);
|
||||
}
|
||||
|
||||
showLightbox(event, image) {
|
||||
if (event.target.classList.contains("scroll-content")) {
|
||||
this.navCtrl.push(LightboxPage, {
|
||||
image: image,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
toggleProfileDetails(event) {
|
||||
if (!this.detailsOpen) {
|
||||
this.openProfileDetails(event);
|
||||
} else {
|
||||
this.closeProfileDetails(event);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
<ion-tabs id="tab-nav" selectedIndex="0">
|
||||
<ion-tab [root]="tab1Root" tabIcon="contacts"></ion-tab>
|
||||
<ion-tab [root]="tab2Root" tabIcon="compass"></ion-tab>
|
||||
<ion-tab [root]="tab3Root" tabIcon="chatboxes"></ion-tab>
|
||||
<ion-tab [root]="tab4Root" tabIcon="information-circle"></ion-tab>
|
||||
</ion-tabs>
|
||||
@@ -0,0 +1,21 @@
|
||||
import { Component } from '@angular/core';
|
||||
|
||||
import { GridPage } from '../grid/grid';
|
||||
import { InformationPage } from '../information/information';
|
||||
import { MessagesPage } from '../messages/messages';
|
||||
import { UsersPage } from '../users/users';
|
||||
|
||||
@Component({
|
||||
templateUrl: 'tabs.html'
|
||||
})
|
||||
export class TabsPage {
|
||||
|
||||
tab1Root = GridPage;
|
||||
tab2Root = UsersPage;
|
||||
tab3Root = MessagesPage;
|
||||
tab4Root = InformationPage;
|
||||
|
||||
constructor() {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
<ion-header>
|
||||
<ion-toolbar>
|
||||
<ion-buttons right>
|
||||
<button ion-button icon-only (tap)="close($event)">
|
||||
<ion-icon name="close"></ion-icon>
|
||||
</button>
|
||||
</ion-buttons>
|
||||
</ion-toolbar>
|
||||
</ion-header>
|
||||
|
||||
<ion-content>
|
||||
</ion-content>
|
||||
@@ -0,0 +1,27 @@
|
||||
page-tell-your-story {
|
||||
|
||||
ion-col {
|
||||
|
||||
&.cruise {
|
||||
background-size: cover;
|
||||
border: 1px solid #000000;
|
||||
box-sizing: border-box;
|
||||
padding: 0 0 37.5% !important;
|
||||
position: relative;
|
||||
|
||||
.placename {
|
||||
bottom: 0.25rem;
|
||||
box-sizing: border-box;
|
||||
color: #acacac;
|
||||
display: inline-block;
|
||||
left: 0.5rem;
|
||||
overflow: hidden;
|
||||
position: absolute;
|
||||
right: 0.25rem;
|
||||
text-overflow: ellipsis;
|
||||
text-shadow: rgba(0, 0, 0, 1);
|
||||
white-space: nowrap;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { NavController } from 'ionic-angular';
|
||||
|
||||
import { ProfileService } from '../../services/profiles';
|
||||
|
||||
@Component({
|
||||
selector: 'page-tell-your-story',
|
||||
templateUrl: 'tell.html',
|
||||
providers: [ ProfileService ]
|
||||
})
|
||||
export class TellYourStoryPage {
|
||||
|
||||
tabNavEl: any;
|
||||
|
||||
constructor(public navCtrl: NavController) {
|
||||
this.tabNavEl = document.querySelector('#tab-nav .tabbar');
|
||||
}
|
||||
|
||||
ionViewWillEnter() {
|
||||
this.tabNavEl.style.display = 'none';
|
||||
}
|
||||
|
||||
close(event) {
|
||||
this.navCtrl.pop();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
<ion-header>
|
||||
<ion-toolbar>
|
||||
<ion-title>Urnings</ion-title>
|
||||
</ion-toolbar>
|
||||
</ion-header>
|
||||
|
||||
<ion-content no-padding>
|
||||
<ion-grid no-padding>
|
||||
<ion-row align-items-stretch>
|
||||
<ion-col col-4 class="profile tell-your-story">
|
||||
<button ion-button clear large icon-only (tap)="doTellStory()">
|
||||
<ion-icon name="md-person-add"></ion-icon>
|
||||
</button>
|
||||
</ion-col>
|
||||
<ion-col col-4 class="profile" *ngFor="let current of profiles" (tap)="profileTapped($event, current)" (press)="profilePressed($event, current)" [style.backgroundImage]="getBackgroundThumbnail(current.details.pic)">
|
||||
<span class="username" [ngClass]="{ 'online': (current.messages?.length > 0) }">{{current.details.name}}</span>
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
</ion-grid>
|
||||
</ion-content>
|
||||
@@ -0,0 +1,78 @@
|
||||
page-users {
|
||||
|
||||
ion-toolbar {
|
||||
|
||||
.toolbar-title {
|
||||
color: #ffffff;
|
||||
font-size: 2.42em;
|
||||
font-weight: 700;
|
||||
line-height: 1.29;
|
||||
text-decoration: underline;
|
||||
}
|
||||
}
|
||||
|
||||
.grid {
|
||||
|
||||
.row {
|
||||
|
||||
.col {
|
||||
|
||||
&.profile {
|
||||
background-size: cover;
|
||||
border: 1px solid #000000;
|
||||
box-sizing: border-box;
|
||||
padding: 0 0 33% !important;
|
||||
position: relative;
|
||||
|
||||
&.tell-your-story {
|
||||
position: relative;
|
||||
|
||||
button {
|
||||
color: #acacac;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate3d(-50%, -50%, 0);
|
||||
}
|
||||
}
|
||||
|
||||
.username {
|
||||
background-size: cover;
|
||||
bottom: 0.25rem;
|
||||
box-sizing: border-box;
|
||||
color: #ffffff;
|
||||
display: inline-block;
|
||||
left: 0.5rem;
|
||||
overflow: hidden;
|
||||
position: absolute;
|
||||
right: 0.25rem;
|
||||
text-overflow: ellipsis;
|
||||
text-shadow: 0 0 3px rgba(0, 0, 0, 1);
|
||||
white-space: nowrap;
|
||||
|
||||
&::before {
|
||||
border: 0.125rem solid #acacac;
|
||||
border-radius: 1rem;
|
||||
bottom: 0.125rem;
|
||||
content: '';
|
||||
display: inline-block;
|
||||
height: 0.8rem;
|
||||
margin-right: 0.5rem;
|
||||
position: relative;
|
||||
vertical-align: middle;
|
||||
width: 0.8rem;
|
||||
}
|
||||
|
||||
&.online {
|
||||
|
||||
&::before {
|
||||
background-color: #00ff00;
|
||||
border-color: #00ff00;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { DomSanitizer } from '@angular/platform-browser';
|
||||
import { NavController } from 'ionic-angular';
|
||||
|
||||
import { ChatPage } from '../chat/chat';
|
||||
import { ProfileService } from '../../services/profiles';
|
||||
import { ProfilePage } from '../profile/profile';
|
||||
import { TellYourStoryPage } from '../tell/tell';
|
||||
|
||||
@Component({
|
||||
selector: 'page-users',
|
||||
templateUrl: 'users.html',
|
||||
providers: [ ProfileService ]
|
||||
})
|
||||
export class UsersPage {
|
||||
|
||||
profiles: any;
|
||||
tabNavEl: any;
|
||||
|
||||
constructor(public navCtrl: NavController, public profileService: ProfileService, private _sanitizer: DomSanitizer) {
|
||||
profileService.loadSubmitted().then((data) => {
|
||||
this.profiles = data;
|
||||
});
|
||||
this.tabNavEl = document.querySelector('#tab-nav .tabbar');
|
||||
}
|
||||
|
||||
ionViewWillEnter() {
|
||||
this.tabNavEl.style.display = 'flex';
|
||||
}
|
||||
|
||||
doTellStory() {
|
||||
this.navCtrl.push(TellYourStoryPage);
|
||||
}
|
||||
|
||||
getBackgroundThumbnail(pics) {
|
||||
return this._sanitizer.bypassSecurityTrustStyle('url(https://appsby.fitz.guru/urge/' + pics.thumb + ')');
|
||||
}
|
||||
|
||||
profilePressed(event, profile) {
|
||||
if (profile.messages && profile.messages.length) {
|
||||
this.navCtrl.push(ChatPage, {
|
||||
profile: profile
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
profileTapped(event, profile) {
|
||||
this.navCtrl.push(ProfilePage, {
|
||||
profile: profile,
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
/**
|
||||
* Check out https://googlechromelabs.github.io/sw-toolbox/ for
|
||||
* more info on how to use sw-toolbox to custom configure your service worker.
|
||||
*/
|
||||
|
||||
|
||||
'use strict';
|
||||
importScripts('./build/sw-toolbox.js');
|
||||
|
||||
self.toolbox.options.cache = {
|
||||
name: 'ionic-cache'
|
||||
};
|
||||
|
||||
// pre-cache our key assets
|
||||
self.toolbox.precache(
|
||||
[
|
||||
'./build/main.js',
|
||||
'./build/vendor.js',
|
||||
'./build/main.css',
|
||||
'./build/polyfills.js',
|
||||
'index.html',
|
||||
'manifest.json'
|
||||
]
|
||||
);
|
||||
|
||||
// dynamically cache any other local assets
|
||||
self.toolbox.router.any('/*', self.toolbox.fastest);
|
||||
|
||||
// for any other requests go to the network, cache,
|
||||
// and then only use that cached resource if your user goes offline
|
||||
self.toolbox.router.default = self.toolbox.networkFirst;
|
||||
@@ -0,0 +1,98 @@
|
||||
import { Injectable } from "@angular/core";
|
||||
import { Http } from "@angular/http";
|
||||
import "rxjs/add/operator/map";
|
||||
|
||||
@Injectable()
|
||||
export class ProfileService {
|
||||
endpoint: string = "http://localhost:27017/urnings/profiles";
|
||||
fallback: string = "assets/data/profiles.json";
|
||||
epSubmitted: string = "/submitted";
|
||||
epVerified: string = "/verified";
|
||||
idMap: any = { all: {}, submitted: {}, verified: {} };
|
||||
profiles: any;
|
||||
|
||||
constructor(private http: Http) {
|
||||
this.idMap = { all: {}, submitted: {}, verified: {} };
|
||||
this.profiles = null;
|
||||
}
|
||||
|
||||
load() {
|
||||
if (this.profiles) {
|
||||
return Promise.resolve(this.profiles);
|
||||
}
|
||||
|
||||
return new Promise((resolve) => {
|
||||
this.doGetRequest(this.endpoint, resolve);
|
||||
});
|
||||
}
|
||||
|
||||
loadSubmitted() {
|
||||
if (this.profiles && this.profiles.submitted) {
|
||||
return Promise.resolve(this.profiles.submitted);
|
||||
}
|
||||
|
||||
return new Promise((resolve) => {
|
||||
this.doGetRequest(this.endpoint + this.epSubmitted, resolve, "submitted");
|
||||
});
|
||||
}
|
||||
|
||||
loadVerified() {
|
||||
if (this.profiles && this.profiles.verified) {
|
||||
return Promise.resolve(this.profiles.verified);
|
||||
}
|
||||
|
||||
return new Promise((resolve) => {
|
||||
this.doGetRequest(this.endpoint + this.epVerified, resolve, "verified");
|
||||
});
|
||||
}
|
||||
|
||||
doGetRequest(endpoint, resolve, type = "all") {
|
||||
this.http
|
||||
.get(endpoint)
|
||||
.map((res) => res.json())
|
||||
.subscribe(
|
||||
(data) => {
|
||||
this.profiles = this.profiles || {};
|
||||
this.profiles[type] = data;
|
||||
this.profiles[type].reduce((map, profile, i) => {
|
||||
console.log("profile: ", { map, profile, i });
|
||||
map[profile._id] = i;
|
||||
return map;
|
||||
}, this.idMap[type]);
|
||||
resolve(this.profiles[type]);
|
||||
},
|
||||
(error) => {
|
||||
this.doGetRequest(this.fallback, resolve, type);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
getNextProfile(id, type = "all") {
|
||||
var nextIdIndex = this.idMap[type][id] + 1;
|
||||
nextIdIndex = nextIdIndex >= this.profiles[type].length ? 0 : nextIdIndex;
|
||||
return this.profiles[type][nextIdIndex];
|
||||
}
|
||||
|
||||
getPreviousProfile(id, type = "all") {
|
||||
var prevIdIndex = this.idMap[type][id] - 1;
|
||||
prevIdIndex =
|
||||
prevIdIndex < 0 ? this.profiles[type].length - 1 : prevIdIndex;
|
||||
return this.profiles[type][prevIdIndex];
|
||||
}
|
||||
|
||||
getProfiles() {
|
||||
return this.profiles.all;
|
||||
}
|
||||
|
||||
getProfileById(id) {
|
||||
return this.profiles[this.idMap[id]];
|
||||
}
|
||||
|
||||
getSubmittedProfiles() {
|
||||
return this.profiles.submitted;
|
||||
}
|
||||
|
||||
getVerifiedProfiles() {
|
||||
return this.profiles.verified;
|
||||
}
|
||||
}
|
||||