Challenge Overview
As part of the serenity project, we want to separate out the challenge API from the main challenge App. This challenge is to create that API layer which will be used by other apps.
This challenge is as much about creating a strong, reusable base as it is providing the challenge endpoints.
Functional Requirements
- API should return JSON
- API be should RESTful
- The following Endpoints should be specified
- GET /challenges: Get all challenge
- Accept url param filters:
- field=value
- Listing should return the same challenge object which is obtained by the single challenge API endpoint.
- Accept url param filters:
- GET /challenges/<ID>: Get a specific challenge
- Include challenge detail, submissions and registrants.
- POST /challenges
- POST /challenges/<ID>/register: Register for a challenge
- body params:
- user_id
- body params:
- POST /challenges/<ID>/submit
- body params
- user_id
- file
- body params
- GET /challenges: Get all challenge
- Do not worry about authentication. Just note it will be coming in a future version
- See attached for Challenge table. The challenge submissions and registrants tables should be added also but are not supplied in the attachment.
- API should have logical error handling. The error handling should be documented
- API should have a consistent return structure
- apiary.io documentation
- There is no front end, only JSON
- File storage should be plugable and able to be defined in configuration.
- For example, locally we would use the file system but in production we would use S3
- App should be configurable per environment which should read form the NODE_ENV environment variable
- Challenge Requirements and Scoring is out of scope.
Technical Requirements
- PostgreSQL
- NodeJS
- ExpressJS
- Sequalize
- Heroku
- Tests for the functional requirements using Karma and Mocha
- Grunt
Final Submission Guidelines
Please delivery following
- Code in zip file
- Provide clear concise documentation.
- Mocha Tests
- apiary.io ready documentation