This mono-repository contains 3 components for the assignment. Task 1 includes a script to migrate data from MongoDB to SQL Server Express. Task 2 includes a backend API and a frontend website to display the migrated data.
A script to export CE progress data from MongoDB, and patch the data into SQL Server Express.
cd /backend/scripts
go run migrate_data.goThe backend API is implemented in /backend/main.go and provides endpoints to interact with participant-course data stored in SQL Server Express. The API uses:
- Huma framework for OpenAPI documentation
- Chi router for HTTP routing
- SQLx for database operations against SQL Server Express
The frontend application is located in the /frontend directory and provides a user interface to view participant progress data from SQL Server.
-
Cross-tab format display
- Participant IDs displayed as rows
- Courses displayed as columns
- Each course column shows:
- Completion percentage
- Last accessed date
-
Sortable table
- Users can sort by participant ID
- Users can sort by course-related columns
-
Data handling
- Reads data from backend API endpoint
- Handles missing data gracefully
- Framework: Vue.js
- Components: Vue Single File Components
- State Management: Vue Composition API
- Styling: Vuetify Framework
- ✅ UI reads data from backend API endpoint
- ✅ Participant IDs displayed vertically as rows
- ✅ Courses displayed horizontally as columns
- ✅ Each participant/course intersection shows:
- Completion percentage
- Last accessed date
- ✅ Table is sortable by participant ID
- ✅ Table is sortable by course-related columns
- ✅ Missing data handled gracefully with appropriate UI feedback
cd frontend
npm install
npm run devcd frontend
npm run buildThe frontend connects to the backend API at GET /participant-courses endpoint to fetch participant progress data. This endpoint is implemented in backend/database/mssql/participant_course_controller.go and returns all participant-course mappings with completion and access date information.
The table supports sorting by:
- Participant ID (ascending/descending)
- Course completion percentage
- Last accessed date
- Go v1.26
- Docker
- Optionally MongoDB and Sql Server Express
- For local development, a docker-file script is provided which will launch Mongo and SQL Server Express.
- Write all variables in
.env, use.env.exampleas a template. - Running the script by running:
go run main.goIn your CLI or IDE of choice. - Optionally, you may add the flag
-courses=1,2,3to specify which courses to migrate. This flag overwrites.env.
To run the API with Docker:
cd backend
docker-compose up apiThis will start the API service along with all dependencies (MongoDB, SQL Server, and migrations). The API will be available on the port specified in your .env file (default: 8080).
GET /participant-courses- Retrieves all participant-course mappings with completion and access date information
The API provides OpenAPI documentation at the following endpoint:
GET /docs- OpenAPI documentationGET /openapi.json- OpenAPI specification in JSON format
When you run the API, migrations are automatically ran to update the database to the latest state. You may optionally migrate the database using the following commands.
Up Migration(s):
docker-compose run --rm goose up
Rollback (Once):
docker-compose run --rm goose down
Create New Migration:
docker-compose run --rm goose create add_some_table sql