Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
154 changes: 38 additions & 116 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,76 +1,39 @@
# compiled output
/dist
/node_modules
/build

# Logs
logs
*.log
npm-debug.log*
pnpm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# Snowpack dependency directory (https://snowpack.dev/)
web_modules/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional stylelint cache
.stylelintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity
# OS
.DS_Store

# Tests
/coverage
/.nyc_output

# IDEs and editors
/.idea
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace

# IDE - VSCode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json

# dotenv environment variable files
.env
Expand All @@ -79,58 +42,17 @@ web_modules/
.env.production.local
.env.local

# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache

# Next.js build output
.next
out

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# vuepress v2.x temp and cache directory
# temp directory
.temp
.cache

# vitepress build output
**/.vitepress/dist

# vitepress cache directory
**/.vitepress/cache
.tmp

# Docusaurus cache and generated files
.docusaurus

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port
# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Stores VSCode versions used for testing VSCode extensions
.vscode-test
# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*
dynamodb-data
6 changes: 6 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"singleQuote": false,
"trailingComma": "all",
"endOfLine": "lf",
"printWidth": 120
}
86 changes: 44 additions & 42 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,42 +1,44 @@
# Backend Developer Technical Take-Home Challenge: Movie API Service
In this challenge, you'll build a JavaScript backend service that provides movie data via GraphQL, storing data in DynamoDB.

# Submission Deadline
Please send back by the emailed submission deadline.

# Time Allocation
Please do not spend more than 4 hours on this challenge. We value your time and understand this constraint will result in a focused implementation.

# Challenge Requirements
Create a JavaScript backend service that:
- Provides a GraphQL API for querying popular movies
- Provides GraphQL functionality to fetch detailed movie information
- Stores and retrieves data from DynamoDB

# Technical Guidelines
- Implement using Node.js
- Create a local DynamoDB instance
- Design appropriate table schema for movie data
- Design a clear and effective GraphQL Schema
- Query for fetching a list of popular movies
- Query for fetching a specific movie by ID
- Request for creating a new movie
- Request for updating/editing a movie

# Additional Notes
- Feel free to use any packages that you find helpful
- Given the time constraint, focus on implementing the core features with clean code rather than adding extra functionality
- Include documentation for running locally

# Evaluation Criteria
Your submission will be evaluated based on:
- Functionality: Does the GraphQL API meet the core requirements?
- Code Quality: Is the code clean, well-organized, and maintainable?
- Architecture: Is there a clear architectural approach?
- Performance: Is the API efficient and well-optimized?


# Other interesting things to look into
- What is a Global Secondary Index and how might you use it with this API?
- What happens if someone wants to make multiple updates at once?
- What is a scan vs a query?
# Movies API - Spill Take Home Test

A GraphQL API for managing movies built with NestJS and DynamoDB.

## Prerequisites

- Node.js (v22 preferentially)
- Docker (for running DynamoDB Local)

## Getting Started

1. Clone the repository:
```bash
git clone [email protected]:arthurbz/spill-take-home-test.git
cd spill-take-home-test
```

2. Install dependencies:
```bash
npm install
```

3. Start DynamoDB Local using Docker:
```bash
docker-compose up -d
```

4. Start the development server:
```bash
npm run start:dev
```

The API will be available at `http://localhost:3000/graphql`

## GraphQL Playground

Once the server is running, you can access the GraphQL Playground at `http://localhost:3000/graphql` to test the API.

# Demo

This is a video showcasing the project working locally.

https://github.com/user-attachments/assets/9d36f1f4-2d30-4f9c-a81f-acb5ee46d140

17 changes: 17 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
version: "3.8"

services:
dynamodb-local:
image: amazon/dynamodb-local
container_name: dynamodb-local
ports:
- "8000:8000"
volumes:
- ./dynamodb-data:/home/dynamodblocal/data
command: -jar DynamoDBLocal.jar -sharedDb -dbPath /home/dynamodblocal/data
environment:
- JAVA_OPTS=-Djava.library.path=/DynamoDBLocal_lib -Dsqlite4java.library.path=/DynamoDBLocal_lib

volumes:
dynamodb_data:
driver: local
40 changes: 40 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
// @ts-check
import eslint from "@eslint/js";
import eslintPluginPrettierRecommended from "eslint-plugin-prettier/recommended";
import globals from "globals";
import tseslint from "typescript-eslint";

export default tseslint.config(
{
ignores: ["eslint.config.mjs"],
},
eslint.configs.recommended,
...tseslint.configs.recommendedTypeChecked,
eslintPluginPrettierRecommended,
{
languageOptions: {
globals: {
...globals.node,
...globals.jest,
},
sourceType: "commonjs",
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
},
{
rules: {
quotes: ["error", "double"],
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-floating-promises": "warn",
"@typescript-eslint/no-unsafe-argument": "warn",
"@typescript-eslint/no-unsafe-call": "off",
"@typescript-eslint/no-unsafe-member-access": "off",
"@typescript-eslint/no-unsafe-return": "off",
"@typescript-eslint/no-unsafe-assignment": "off",
"max-len": ["error", { code: 120 }],
},
},
);
8 changes: 8 additions & 0 deletions nest-cli.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"$schema": "https://json.schemastore.org/nest-cli",
"collection": "@nestjs/schematics",
"sourceRoot": "src",
"compilerOptions": {
"deleteOutDir": true
}
}
Loading