Code Monkey home page Code Monkey logo

momentum's Issues

Iteration 1: Prototype

  1. Requirements: Description with UI sketch of main use cases (Vidith)

  2. Database design: Description of data entities and relationships, entity-relationship diagram, SQL code to design database, sample date (Nathan)

  3. Architectural design: Description of 3-tier architecture (e.g., UI, Logic, DB) (Nathan)

  4. A runnable prototyping with GUI, database (if needed) (Vidith -> GUI, Nathan -> DB)

  5. Video recordings of user acceptance tests (Vidith)

  • Creating an account
  • Logging out of account
  • Logging into an existing account
  • Creating a community
  • Viewing mock community page

Final iteration

Plans for final iteration:

Frontend:

  • Can keep same web client, just need to add commenting
  • Need to write a new desktop client, can look into using React Native to maximize code reuse from existing HTML/JS/CSS setup

Backend:
Need to split up functionality into multiple microservices. Tentative plan:

  • Users microservice: Backed by a Redis key-value store (Vidith)
  • Posts/comments microservice: Backed by MongoDB (Nathan, Vidith does DB setup)
  • Communities microservice: Backed by current MariaDB setup (Nathan)

The above 3 microservices are simply RESTful interfaces to the respective databases and perform no further business logic
We will have a GraphQL adapter component that accepts GraphQL requests from the client and dispatches requests to each of the above 3 microservices to fulfill the request (Nathan).

Each of these backend components will run as an independent application locally on its own port.

Architecture diagram:
Put here

Project Plan

Objective: create a Reddit/Twitter-like social media app with a HTML/bootstrap CSS + JS frontend and a Python/GraphQL backend. Functionality will include user accounts, communities, posts, and comments.

Application flow: The landing page of the app will allow users to either create an account or log into an existing account. Once signed in, users will have a home page where they can view all of the communities they are in, as well as options to join new communities or create a community. Each community has a page that will load its posts. Each individual post has a page with the full contents of the post as well as all comments associated with the post.

Iteration 2: Client + Server

  1. Requirements: Description with UI sketch of all use cases.
  • Need to improve/further elaborate on this from the prototype submission (Vidith)
  1. Database design: Description of data entities and relationships, entity-relationship diagram, SQL code to design database, sample data.
  • This should be pretty much good to go
  1. Architectural design: Description of client and server components.
  • Will need to update this for new client code (Vidith). Might also want to revise server components (Nathan)
  1. A runnable system with GUI-based or web-based client (frontend) and web-based or socket-based server (including database access if needed).
  • Need to finish this. The goal should be for all basic features (account creation, community creation, posting) to work without issues. Posts should be able to work with text content. I'm not sure what the extent of completion needs to be for this iteration. We can clarify this and adjust our target requirements as necessary.
  1. Video recordings of user acceptance tests.

Database issues

Problems I observed:

  • When querying users, the returned communities include all communities, not just the ones the user is a part of. Example result:
"data": {
    "search_users": {
      "error": null,
      "users": [
        {
          "rid": 1, ------------------> this result is for user 1
          "username": "nmcclaran",
          "name": "Nathan",
          "communities": [
            {
              "rid": 1,
              "description": "A Test Community",
              "users": [
                {
                  "rid": 3  ----------------->  user 1 is not in this community
                }
              ]
            },
            null,
            null
          ]
        }
      ]
    }
  }
  • When there are multiple communities, queries that return communities (such as user queries, community queries) crash with the following error:
{
      "message": "readexactly() called while another coroutine is already waiting for incoming data",
      "locations": [
        {
          "line": 18,
          "column": 17
        }
      ],
      "path": [
        "search_users",
        "users",
        0,
        "communities",
        1,
        "users"
      ],
      "extensions": {
        "exception": {
          "stacktrace": [
            "Traceback (most recent call last):",
            "  File \"/usr/local/lib/python3.11/site-packages/graphql/execution/execute.py\", line 528, in await_result",
            "    return_type, field_nodes, info, path, await result",
            "                                          ^^^^^^^^^^^^",
            "  File \"/Users/vidithm/projects/Momentum/momentum_gql/src/app/resolvers/types/community.py\", line 27, in resolve_users",
            "    rids = await users.search(",
            "           ^^^^^^^^^^^^^^^^^^^",
            "  File \"/Users/vidithm/projects/Momentum/momentum_gql/src/app/database/users.py\", line 185, in search",
            "    await cursor.execute(query, args)",
            "  File \"/usr/local/lib/python3.11/site-packages/aiomysql/cursors.py\", line 239, in execute",
            "    await self._query(query)",
            "  File \"/usr/local/lib/python3.11/site-packages/aiomysql/cursors.py\", line 457, in _query",
            "    await conn.query(q)",
            "  File \"/usr/local/lib/python3.11/site-packages/aiomysql/connection.py\", line 469, in query",
            "    await self._read_query_result(unbuffered=unbuffered)",
            "  File \"/usr/local/lib/python3.11/site-packages/aiomysql/connection.py\", line 683, in _read_query_result",
            "    await result.read()",
            "  File \"/usr/local/lib/python3.11/site-packages/aiomysql/connection.py\", line 1164, in read",
            "    first_packet = await self.connection._read_packet()",
            "                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^",
            "  File \"/usr/local/lib/python3.11/site-packages/aiomysql/connection.py\", line 609, in _read_packet",
            "    packet_header = await self._read_bytes(4)",
            "                    ^^^^^^^^^^^^^^^^^^^^^^^^^",
            "  File \"/usr/local/lib/python3.11/site-packages/aiomysql/connection.py\", line 657, in _read_bytes",
            "    data = await self._reader.readexactly(num_bytes)",
            "           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^",
            "  File \"/usr/local/Cellar/[email protected]/3.11.4_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/streams.py\", line 729, in readexactly",
            "    await self._wait_for_data('readexactly')",
            "  File \"/usr/local/Cellar/[email protected]/3.11.4_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/streams.py\", line 508, in _wait_for_data",
            "    raise RuntimeError(",
            "RuntimeError: readexactly() called while another coroutine is already waiting for incoming data"
          ],
          "context": {
            "self": "<StreamReader..., bufsize=0>>>",
            "func_name": "'readexactly'"
          }
        }
      }
    },

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.