Skip to content

A simple PHP REST API example that uses JWT tokens for authentication against an AWS Cognito user pool.

Notifications You must be signed in to change notification settings

cklewin/movie-api-php

Repository files navigation

Simple PHP REST API example

Uses JWT tokens for authentication against an AWS Cognito user pool

Requirements

  • 1 AWS instance for the frontend API
    • will run an Apache/PHP docker container for the front-end
  • 1 AWS instance for Jenkins deployment
    • to test and deploy from GitHub with a webhook trigger
  • 1 AWS RDS MySQL database
    • for persistent storage
  • 1 AWS Cognito user pool
    • for testing JWT authentication

Progress

See TODO.md

Running in development

Install PHP requirements with composer ./composer-install.sh

Start the Docker services docker-compose up

This will start a MySQL server for development and a web server at http://localhost/

API usage

See USAGE.md

Exercise overview

  • Start by briefly documenting the technology stack of your choosing. Let us know what component you’ve chosen for each layer and why.
  • Setup a source code repository where we can watch your progress. GitHub or Bitbucket are fine.
  • You’ll need to deploy your application to a hosting service of your choosing (AWS, DigitalOcean, Azure, etc). Free tiers should be sufficient.

Requirements

  • The service must be accessible over http using a command line interface (curl, node, etc.); a GUI is not necessary.
  • Add an authentication method to restrict access to the repository. Only users that need access to the service should be able to access it.
  • The service must create, read, update, delete, and list movies in the collection.
  • Each movie in the collection needs the following attributes:
    • Title [text; length between 1 and 50 characters]
    • Format [text; allowable values “VHS”, “DVD”, “Streaming”]
    • Length [time; value between 0 and 500 minutes]
    • Release Year [integer; value between 1800 and 2100]
    • Rating [integer; value between 1 and 5]
  • On the collection list request, the items in the list must be sortable by movie attributes.
  • Integrate a third-party web service relevant to the project.

Optional

  • Implement a build tool of your choosing (CloudFormation in AWS, etc)
  • Integrate a testing suite of some sort

About

A simple PHP REST API example that uses JWT tokens for authentication against an AWS Cognito user pool.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published