{"id":38230476,"url":"https://github.com/acmutd/officer-database-backend","last_synced_at":"2026-01-17T01:00:03.524Z","repository":{"id":318270456,"uuid":"1065494099","full_name":"acmutd/officer-database-backend","owner":"acmutd","description":"This is the backend repository for the ACM Officer Database","archived":false,"fork":false,"pushed_at":"2026-01-05T09:39:13.000Z","size":259,"stargazers_count":1,"open_issues_count":5,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-05T10:48:14.652Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/acmutd.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-27T20:59:39.000Z","updated_at":"2026-01-05T09:39:17.000Z","dependencies_parsed_at":"2025-11-22T07:02:35.883Z","dependency_job_id":null,"html_url":"https://github.com/acmutd/officer-database-backend","commit_stats":null,"previous_names":["acmutd/officer-database-backend"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/acmutd/officer-database-backend","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acmutd%2Fofficer-database-backend","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acmutd%2Fofficer-database-backend/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acmutd%2Fofficer-database-backend/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acmutd%2Fofficer-database-backend/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/acmutd","download_url":"https://codeload.github.com/acmutd/officer-database-backend/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acmutd%2Fofficer-database-backend/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28490894,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T00:50:05.742Z","status":"ssl_error","status_checked_at":"2026-01-17T00:43:11.982Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-01-17T01:00:02.611Z","updated_at":"2026-01-17T01:00:03.487Z","avatar_url":"https://github.com/acmutd.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ACM Officer Database - Backend\nThis is the backend repository for the ACM Officer Database\n\n## Local Development\n\n### Prerequisites\n- Node.js (v18 or higher)\n- npm or yarn\n- Firebase Admin SDK credentials\n- Google Cloud SDK (for deployment)\n\n### Setup\n\n1. **Clone the repository**\n   ```bash\n   git clone https://github.com/acmutd/officer-database-backend.git\n   cd officer-database-backend\n   ```\n\n2. **Install dependencies**\n   ```bash\n   npm install\n   ```\n\n3. **Configure Firebase credentials**\n\n \u003e [!CAUTION]\n \u003e Never commit `firebase-creds.json` to version control!\n\n   - Go to [Firebase Console](https://console.firebase.google.com/)\n   - Select your project\n   - Navigate to **Project Settings** → **Service Accounts**\n   - Click **Generate New Private Key**\n   - Save the downloaded file as `firebase-creds.json` in the project root\n\n4. **Build the TypeScript code**\n   ```bash\n   npm run build\n   ```\n\n5. **Start the development server**\n\n```bash\nnpm run dev\n```\n\nThis starts a local Express server on `http://localhost:8080` that runs all endpoints simultaneously. No need to select or run individual functions—just start the server and call any endpoint.\n\n**Available endpoints:**\n- `GET /getOfficers` - Retrieve all officers\n- `GET /getOfficer?id={id}` - Get a single officer by ID\n- `POST /createOfficer` - Create a new officer\n- `PATCH /updateOfficer?id={id}` - Update an officer\n- `DELETE /deleteOfficer?id={id}` - Delete an officer\n- `POST /archiveOfficer?id={id}` - Archive an officer (sets `isActive` to false)\n- `POST /unarchiveOfficer?id={id}` - Unarchive an officer (sets `isActive` to true)\n- `POST /uploadOfficerPhoto` - Upload officer photo (multipart/form-data)\n- `POST /uploadOfficerResume` - Upload officer resume (multipart/form-data)\n- `GET /getOfficerResume?id={id}` - Get signed URL for officer resume\n\n### Project Structure\n\n```\nofficer-database-backend/\n├── src/\n│   ├── functions/          # Cloud Functions (CRUD operations)\n│   │   ├── archiveOfficer.ts\n│   │   ├── createOfficer.ts\n│   │   ├── deleteOfficer.ts\n│   │   ├── getOfficer.ts\n│   │   ├── getOfficerResume.ts\n│   │   ├── getOfficers.ts\n│   │   ├── index.ts\n│   │   ├── unarchiveOfficer.ts\n│   │   ├── updateOfficer.ts\n│   │   ├── uploadOfficerPhoto.ts\n│   │   └── uploadOfficerResume.ts\n│   ├── helpers/            # Validation utilities\n│   │   └── validators.ts\n│   ├── types/              # TypeScript types and Zod schemas\n│   │   └── officer.ts\n│   ├── middleware.ts       # Request validation middleware\n│   ├── firebase.ts         # Firebase Admin SDK initialization\n│   └── index.ts            # Function exports\n├── tests/                  # Test scripts\n│   └── deploy.ts\n├── dist/                   # Compiled JavaScript (generated)\n├── firebase-creds.json     # Firebase credentials (not in git)\n├── cloudbuild.yaml\n├── package.json\n├── tsconfig.json\n├── API_DOCUMENTATION.md\n└── README.md\n```\n\n### Environment Notes\n\n- **Local:** Uses an Express server to run all functions simultaneously on a single port (8080 by default). Start the server with `npm run dev` to access all endpoints.\n- **Production:** Serverless Cloud Functions deployed on Google Cloud Platform (GCP). Each function has its own endpoint URL.\n- **Database:** Firestore database on Firebase with two collections: `officer` (current officers) and `archived` (archived officers)\n\n### Local vs Production\n\n| Environment | Server | URL Structure |\n|-------------|--------|---------------|\n| **Local** | Express server running all functions | `http://localhost:8080/ENDPOINT_NAME` |\n| **Production** | Serverless Cloud Functions on GCP | `https://REGION-PROJECT.cloudfunctions.net/FUNCTION_NAME` |\n\n### Troubleshooting\n\n**\"Cannot find module\" errors:**\n- Run `npm run build` to compile TypeScript\n\n**Firebase authentication errors:**\n- Verify `firebase-creds.json` exists in project root\n- Check that the service account has Firestore permissions\n\n**Port already in use:**\n- Change the port in `package.json` dev script or kill the process using port 8080\n\n**Type errors:**\n- Run `npm install` to ensure all `@types/*` packages are installed","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Facmutd%2Fofficer-database-backend","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Facmutd%2Fofficer-database-backend","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Facmutd%2Fofficer-database-backend/lists"}