Skip to content

Getting Started

Zhe Nie edited this page Oct 8, 2026 · 4 revisions

Getting Started

This page lists the tools, libraries, SDKs, and APIs DreamLog will rely on directly, with links to their documentation. It follows the course's GitHub Wiki requirements; packages installed automatically as transitive dependencies are omitted. The selected stack and delivery stages come from Project Architecture and Features, especially Sections 2, 4.1, 4.3.1, and 4.3.10.

Front-End — Native iOS

The app targets iOS 26 or later and is built on a Mac with Xcode 26 or later, Swift language mode 6, and SwiftUI. The frameworks below are provided by Apple's SDK; SQLite is available through the system SQLite3 module.

Direct tool, language, or SDK Use in DreamLog
Swift iOS application language.
SwiftUI Journal, recording, dream detail, analysis, discussion, check-in, pattern, and visual screens.
Xcode Build, run, debug, and test the iOS app.
Observation Shared app state through @Observable models.
AVFoundation Record and play dream audio with native iOS APIs.
Foundation, including URLSession Call DreamLog's HTTPS API, upload audio, read streamed replies, download media, and manage private app files.
Security / Keychain Services Keep the app-generated user ID in a device-only, nonsynchronized Keychain item.
UserNotifications Schedule optional weekly local check-in reminders.
SQLite / SQLite3 Keep unsent dream drafts and upload/retry metadata on the device.
Swift Testing Run app unit tests in the DreamLogTests target.

Back-End — Course-Supported Stack

The backend uses Python 3.14, Starlette on Granian, one in-process worker, SQLite, and private files on the server disk. The directly installed runtime packages are those in the architecture document's Section 4.1.

Direct tool or library Use in DreamLog
Python Back-end language and processing jobs.
uv Pin Python, manage packages and the lockfile, and run the server and tests.
Starlette HTTP endpoints for dreams, audio, tasks, analysis, discussions, profile memories, check-ins, and later patterns and visuals.
Granian Serve the Starlette ASGI application with HTTPS and HTTP/2.
httpx with HTTP/2 (httpx[http2]) One shared asynchronous client for calls to Gemini/Veo, streamed text, and media downloads.
msgspec Encode/decode JSON and validate request and provider-response structures.
SQLite and aiosqlite Store records, revisions, outputs, conversations, permissions, and task state with asynchronous direct SQL access and WAL mode.
uvloop Event loop used by the backend server.
sse-starlette (installed as sse_starlette) Send server-sent events for discussion and weekly check-in replies.
tzdata / Python zoneinfo Supply time-zone data and validate users' time zones for dated context and check-ins.
pytest and pytest-asyncio Development dependencies for backend tests, including asynchronous handlers and workers.

External AI APIs — Base Arc A

All provider requests originate on the backend through httpx. The server keeps GEMINI_API_KEY in its environment; the phone sends its own user credential to DreamLog's API. Model identifiers are deployment configuration, chosen and checked before the increment that first uses each adapter.

The endpoint paths below are relative to https://generativelanguage.googleapis.com/v1beta and reflect the selected contracts in Section 4.3.10 of Project Architecture and Features.

Direct API Selected endpoint and authentication Use in DreamLog
Gemini audio understanding through the Interactions API POST /interactions; x-goog-api-key; model configured as SPEECH_MODEL; store: false. Transcribe uploaded speech into editable dream text. Save usable text before cleaning up temporary audio.
Gemini OpenAI-compatible Chat Completions API POST /openai/chat/completions; Authorization: Bearer <key>; model configured as TEXT_MODEL. Generate summaries, descriptive tags, automatic analysis, streamed discussion/check-in replies, and proposed memory summaries. Later stages also use it for pattern matching and scene preparation.

Stretch Dependencies — Arc C, Then Arc D

Arc C is Stretch Goal 1 (pattern discovery and meaning-based history search). Arc D is Stretch Goal 2 (still images first, short video subsequently). These integrations are added at their scheduled increments rather than required for the Arc A base.

Direct library or API Selected endpoint or installation Use in DreamLog
Gemini Embeddings API POST /models/<model>:embedContent; x-goog-api-key; EMBEDDING_MODEL. Arc C, Increment 8: embed dream evidence and search queries for semantic matching.
sqlite-vector Install the Python package with uv add sqliteai-vector. Arc C, Increment 8: store and compare vectors in SQLite using exact per-user full scans. Confirm platform support and the project's license eligibility before this increment.
Gemini image generation through the Interactions API POST /interactions; x-goog-api-key; IMAGE_MODEL; store: false. Arc D, Increment 9: generate still images from dream-derived scene descriptions and save media versions.
Veo video generation in the Gemini API POST /models/<model>:predictLongRunning, then GET /<name> for the returned operation; x-goog-api-key; VIDEO_MODEL. Arc D, Increment 10: generate short videos. The backend tracks the saved operation and downloads the completed media.
FFmpeg / ffprobe Ubuntu system package ffmpeg; installed at initial server deployment and used by Arc D. Read generated media dimensions/durations and create image/video thumbnails.

Server and Deployment Tools

Direct tool or service Use in DreamLog
Ubuntu on Google Cloud Compute Engine or Amazon EC2 One application VM with a reserved/static IP address, a SQLite database file, and private audio/media directories. The team chooses one cloud provider.
systemd Run and restart the backend service on Ubuntu.
OpenSSL Create the self-signed HTTPS certificate that test phones and simulators must trust.
Git, curl and GNU Wget Clone the source repository, make provider trial requests, and fetch the course certificate configuration.

For project creation and build/test commands, see Section 4.1 of Project Architecture and Features. Section 4.3.1 specifies server configuration and deployment; Section 4.4.5 specifies the app's server address and certificate trust. Before each AI integration starts, follow Section 4.1's deployment checks for the selected model, endpoint contract, quota, and applicable provider terms. Provider retention terms must be confirmed before voice processing or real-dream use as specified there. Forum and sleep-data integrations remain later work, with no API selected yet.

Clone this wiki locally