Developing a Photo Sharing App with Elixir

Jul 16, 2024

Elixir Project Setup and Exploration

Getting Started with Elixir

  • Goals: Build a startup project using the latest version of Elixir and Erlang.
  • Challenges: Issues with Google Drive, project setup, and plugins.
  • Approach: Referenced previous setup methods and plugins used.
  • Exploration: Attempted to use the newest features of Elixir, particularly version 1.6.17.

Project Concept: Photo Sharing App

  • Idea: An app for sharing photos specifically with friends and family.
  • Current Practice: Using Google Photos albums which have limitations in organizing and viewing photos.
  • Features: No ads, no social media patterns; focus on simplicity and privacy.
  • Monetization: Users pay to upload and backup photos.
  • Inspired By: Google+ circles for selective sharing.

Setting Up Elixir

  • Toolchain: Using Elixir, Erlang, and Phoenix.
  • Local Setup: Running the app locally without advanced storage setup initially.
  • Phoenix Framework: Installation and creating new Phoenix project.
    • Mix commands provided for setting up Phoenix, including new project creation and database setup.

Exploring Typing in Elixir

  • Focus: Understanding new type system features in Elixir 1.6.17.
  • Typing Issues: Found that fields in structs weren't being correctly typed and validated.
  • Example: Struct with fields not erroring as expected when types mismatched.
  • Tools Investigated: Domo, dialyzer (used for static analysis of types).

Troubleshooting

  • Mix Compilation: Ensured successful mix compilation and local setup.
  • LSP configuration: Issues with Language Server Protocol (LSP) setups like ElixirLS and Lexical.
    • Configured LSP servers to disable conflicting features.
    • Focus on avoiding multiple completions and formatting fights between LSPs.
  • Dialyzer: Effective for finding some typing errors but had limitations.

Linting Tools and Setup

  • Credo: Static code analysis tool, included and tested in the project.
    • Found initial issues in configuration with the latest Elixir but recommended for continued use.
  • TypeStruct: A library to enforce types in structs, used and configured.

Future Steps

  • Continue Type System Exploration: Keep an eye on new Elixir features for better type enforcement.
  • Improve Setup: Ensure stable versions are used to avoid breaking dependencies.
  • Develop Features: Proceed with building core features of the photo app while testing new tools and libraries.