System Requirements
Development
- Node.js 18+
- npm or yarn
- Git
- Code editor (VS Code recommended)
Deployment
- Google Account
- Google Apps Script access
- Google Drive storage
- clasp CLI installed
Architecture Overview
SGD-MCS consists of three main components:- Frontend (React + Vite) - Single-page application
- Backend (Google Apps Script) - Server-side API and web hosting
- Database (Google Sheets) - Data persistence layer
The entire React app is bundled into a single HTML file using
vite-plugin-singlefile, making deployment to Google Apps Script seamless.Frontend Installation
1. Navigate to Frontend Directory
2. Install Dependencies
The project uses the following key dependencies:3. Development Server
Run the dev server for local development:http://localhost:5173.
4. Build Configuration
Thevite.config.js is configured to output a single HTML file:
- Output directory:
../backend/web(inside Backend folder) - All assets are inlined (images, CSS, JS)
- Single bundle with no code splitting
5. Build for Production
~/workspace/source/Backend/web/index.html.
Backend Installation
1. Install clasp CLI
Google’s Command Line Apps Script Projects tool:2. Authenticate with Google
3. Backend Structure
The backend is organized as follows:4. Configure Database
Create Google Sheets Database
- Go to Google Sheets
- Create a new spreadsheet
- Create the following sheets (tabs):
Core Entities
Estudiantes- Student managementDocentes- Faculty/teachersTesis- Thesis projectsEventos- Events and activities
Supporting Tables
Instituciones- Partner institutionsParticipantesExternos- External participantsParticipaciones- Event participation (M:N)
Update config.js
Edit~/workspace/source/Backend/core/config.js:
The
getDB() function in config.js provides centralized access to the spreadsheet across all backend modules.5. Apps Script Manifest
Theappsscript.json defines required OAuth scopes:
spreadsheets- Read/write Google Sheets databasedrive- Manage files and folders in Google Drivescript.external_request- Make external HTTP requests (if needed)
6. Initialize clasp Project
.clasp.json file:
7. Deploy Web App
- Click Deploy > New deployment
- Select type: Web app
- Description:
SGD-MCS Production - Execute as:
Me(orUser accessing the web app) - Who has access:
AnyoneorOnly myself - Click Deploy
If you choose “User accessing the web app”, each user will need to authorize the app with their Google account.
Google Drive Setup
Folder Structure
The system automatically creates folders in Google Drive:DriveManager.js service handles this:
Verification
Test Backend API
In the Apps Script editor, run these functions manually:-
Test Database Connection
-
Test Dashboard Stats
-
Test Drive Access
Test Frontend
Open the Web app URL. Check:- Dashboard loads with statistics
- Navigation sidebar works
- Student/Teacher lists populate from Sheets
- File upload connects to Drive
Development Workflow
Environment-Specific Configuration
Development
- Use mock data in React components
- Test UI changes with
npm run dev - Avoid calling real Google APIs
Staging
- Deploy to a separate Apps Script project
- Use a test Google Sheet database
- Restrict access to internal users
Production
- Use the main Google Sheet database
- Enable proper access controls
- Monitor Apps Script quota usage
Troubleshooting
clasp push fails with 'Manifest file not found'
clasp push fails with 'Manifest file not found'
Ensure
appsscript.json exists in the Backend directory:Build produces multiple files instead of single HTML
Build produces multiple files instead of single HTML
Check that Verify
vite-plugin-singlefile is installed:vite.config.js includes:Apps Script shows permission errors
Apps Script shows permission errors
- Check OAuth scopes in
appsscript.json - Re-authorize the app in the Apps Script editor
- Ensure the deploying account has access to Sheets and Drive
Frontend can't call backend functions
Frontend can't call backend functions
In production, use Ensure proxy functions exist in
google.script.run to call backend functions:Main.js:Next Steps
Architecture
Understand the system design and data flow
API Reference
Explore backend API functions
Frontend Components
Learn about React component structure
Customization
Customize colors, themes, and branding