Skip to content

PassiveLogic/cloud-homework

Repository files navigation

PassiveLogic Cloud Take Home Assignment

This assignment involves creating the backend for a Todo list application. The provided repository serves as a starting point, and your task is to add several new features. It includes a Vapor server and a small GraphQL API for managing todo list items, all supported by a PostgreSQL database.

You will be invited to a private fork of this repo. Please create a branch, complete the objectives below, and add a document at the repo root explaining what you've done. Feel free to list any assumptions, reasoning, or architecture in that document. When you're finished, create a pull request.

If you would like to avoid showing this work publicly, disable "Include private contributions on my profile" under "Contributions" in your profile settings.

Getting Started

It is recommended that you complete this using a Linux or MacOS environment. While you can use any development environment you like, XCode (MacOS only) or VSCode using the Swift extension generally have the best Swift support.

If you only have access to a Windows environment, you can use a VSCode Dev Container to complete the assignment. To get set up, install the Dev Containers VSCode Extension, go to the Remote Explorer menu, and click Start in Dev Container. This will start up a Docker image with the Swift toolchain and a running database.

  1. Ensure you have Docker installed
  2. Clone this repository
  3. Install a Swift toolchain (skip if using VSCode Dev Container)
  4. Start the database (skip if using VSCode Dev Container): docker compose up db -d
  5. Build the package: swift build
  6. Set up the database: swift run App migrate
  7. Run the server: swift run App serve --hostname 0.0.0.0 --port 8080
  8. Visit the GraphiQL page: http://localhost:8080/graphql

Objectives

  1. Allow Todo items to be completed
    • Completion and uncompletion state should be controlled by separate mutations (not updateTodo)
    • Newly created items should always be uncompleted
    • The todos query should allow filtering for completed or uncompleted items
  2. Add pagination to the todos query
    • Include a "page number" and a "number of items per page" arguments
    • Add a query that returns the total number of todo items
  3. Add a TodoList type that collects multiple Todo items
    • Todo lists should be able to be created, queried, updated, and deleted
    • All Todo items should belong to a list
    • Todo items should only belong to one list at a time, but may be moved from list to list
    • Add the ability to get all todo items for a given list through a GraphQL object traversal

Resources

About

Take-home project for PassiveLogic's Cloud Team

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published