SGD-MCS (Sistema de Gestión Documental para Maestrías en Ciencias de la Salud) is a document management system for Master’s programs built with React and Google Apps Script.
Overview
This guide will help you deploy SGD-MCS from scratch. You’ll set up:- Google Apps Script backend with Google Drive integration
- React frontend bundled as a single HTML file
- Google Sheets database for storing entities
Prerequisites
Ensure you have the following installed:
- Node.js (v18 or higher) and npm
- Google Account with access to Google Drive, Sheets, and Apps Script
- clasp CLI for deploying Google Apps Script
Clone and Install
Navigate to the project source and install dependencies:
The frontend uses Vite with React 19 and includes visualization libraries like ApexCharts, Recharts, and Leaflet for geospatial mapping.
Configure Google Sheets Database
Create a new Google Sheet to serve as your database with the following sheets (tabs):
Estudiantes- Student recordsDocentes- Faculty/teacher recordsTesis- Thesis projectsEventos- Events and activitiesInstituciones- Partner institutionsParticipantesExternos- External participantsParticipaciones- Event participation records (M:N relationship)Historial_Documentos- Document history/audit trailConfiguracion- System configuration
Build Frontend
Build the React app into a single HTML file:This creates
workspace/source/Backend/web/index.html with all assets inlined. The Vite config is set up to:Deploy to Google Apps Script
Initialize clasp in the backend directory (first time only):Or if Deploy as a web app:
.clasp.json already exists, just push:Configure Web App Permissions
After deployment:
- Run
clasp opento open the Apps Script editor - Click Deploy > Manage deployments
- Select your deployment and click Edit
- Set:
- Execute as: User accessing the web app (or “Me” for service account mode)
- Who has access: Anyone (for public access) or specific domain
- Copy the Web app URL
The
appsscript.json manifest includes required OAuth scopes:https://www.googleapis.com/auth/spreadsheetshttps://www.googleapis.com/auth/drivehttps://www.googleapis.com/auth/script.external_request
Test the Application
Open the Web app URL in your browser. You should see:
-
Dashboard with statistics cards showing:
- Total students (active, graduated, alumni)
- Thesis projects (in progress, completed)
- Recent events
-
Navigation with modules:
- Students, Teachers, Thesis, Events
- Document Hub for file management
- Repository for uploaded documents
doGet() to serve the React SPA:Next Steps
Installation Guide
Detailed setup instructions and configuration options
Architecture
Learn how the system is structured
API Reference
Explore backend API functions
Customization
Customize themes, colors, and branding
Common Issues
Build fails with 'outDir' error
Build fails with 'outDir' error
Make sure the
Backend/web directory exists:Apps Script shows 'Exception: Spreadsheet not found'
Apps Script shows 'Exception: Spreadsheet not found'
Verify that:
- Your
SPREADSHEET_IDinconfig.jsis correct - The Google account deploying has access to the spreadsheet
- All required sheet tabs exist
Web app shows blank page
Web app shows blank page
Check the browser console for errors. Common causes:
index.htmlwasn’t generated inBackend/web/- Apps Script deployment is outdated (run
clasp pushagain)