This API allows users to apply for the Data Science for Sustainable Development (DSSD) program at UW Madison. It handles application submissions, email notifications, and application deletion requests.
Description: A simple health check to ensure the API is running. Response:
{
"status": "healthy",
"timestamp": "2025-09-20T12:00:00.000Z",
"environment": "production",
"emailEnabled": true
}Description: Serves the index.html file located in the public directory.
Response: A static HTML page.
Description: Submits a new application to the program. Request Body (JSON):
{
"firstName": "John",
"lastName": "Doe",
"email": "johndoe@example.com",
"year": 2025
}Response:
-
Success (201):
{ "message": "Application submitted successfully", "applicationId": "app_1234567890", "email_sent": "Confirmation email sent to johndoe@example.com" } -
Error (400/500):
{ "error": "Invalid request data", "details": ["email is required", "year must be between 2025 and 2030"], "errorType": "INVALID_REQUEST" }
Description: Deletes an existing application using the applicationId.
Query Parameters:
applicationId(e.g.,app_1234567890)
Response:
-
Success (200):
{ "message": "Application deleted successfully", "applicationId": "app_1234567890", "email_sent": "Confirmation email sent to johndoe@example.com" } -
Error (400/404/500):
{ "error": "Invalid or missing application ID", "errorType": "INVALID_APPLICATION_ID" }
-
Application Submission (
/apply):- Users send their first name, last name, email, and desired year.
- The API validates the input using Yup and stores the application in Firestore.
- If the application is successfully submitted, a confirmation email is sent to the user, including their application details.
-
Application Deletion (
/apply):- Users can delete their application by providing the
applicationId. - Upon successful deletion, a confirmation email is sent, and the application is removed from Firestore.
- Users can delete their application by providing the
-
Rate Limiting:
- The
POST /applyendpoint is rate-limited to 10 requests per IP within 5 minutes to prevent abuse.
- The
-
Email Notifications:
- After application submission, a application confirmation email is sent with application details.
- After application deletion, a deletion confirmation email is sent.
- Express: Web framework for routing.
- Firebase Admin SDK: To interact with Firestore for data storage.
- Sendgrid: For sending email notifications.
- Yup: For validating incoming application data.
- dotenv: For managing environment variables.