Build a RESTful API endpoint to handle job applications for software developer candidates.
- Create a POST endpoint to accept job application submissions with the following fields:
- Full Name (required)
- Email Address (required)
- Phone Number (required)
- Additional fields dynamically specified in the request payload (e.g., LinkedIn profile, portfolio links).
- Accept file attachments (e.g., CV and cover letter in PDF format).
- Validate input for:
- Required fields.
- Proper email and phone number formats.
- File type and size limits (only PDFs, max 5 MB per file).
- Save all received data and attachments in a relational database or suitable storage system.
- Generate a unique job application token for each submission.
- Store the generated token alongside the application data.
- Send an email to a specified address with:
- Application details.
- Attached files.
- The job application token for tracking purposes.
- Return a confirmation message to the applicant upon successful submission, including the job application token.
- Provide meaningful error messages for invalid inputs or missing data.
- Create a GET endpoint that accepts the job application token as a parameter.
- Respond with the details of the submitted application (fields only, no attachments).
- Encrypt sensitive data in the database.
- Validate all inputs to prevent security vulnerabilities (e.g., SQL injection, XSS).
- Ensure file uploads are securely handled and scanned for potential threats.
- A functional API with:
- POST endpoint for job application submissions.
- GET endpoint for confirming submitted applications via token.
- Database schema for storing application details and tokens.
- Email integration for sending application details and tokens.
- Unit and integration tests for all endpoints.
- Documentation, including API specs and setup instructions.
- Use a modern web framework (e.g., Node.js with Express, Python with Flask/Django, etc.).
- Database options: PostgreSQL, MySQL, or MongoDB.
- Email services: SendGrid, Mailgun, or SMTP.
- Support JSON input and multi-part form data for file uploads.
- Use HTTPS for API communication and follow secure coding practices.
- Adherence to requirements.
- Code quality, readability, and modularity.
- Documentation and test coverage.
December 20, 2024