Schemesv3 is a modern reimagining of Singapore's social support system search, built using Firebase Cloud Functions and Next.js. The system leverages Azure OpenAI's GPT models to provide intelligent scheme recommendations and natural language interactions.
The core functionality is powered by a sophisticated search system that combines:
- Natural Language Search: Users can describe their situation in everyday language and receive relevant scheme recommendations
- Intelligent Chat Interface: Contextual conversations powered by Azure OpenAI to help users understand scheme eligibility and application processes
- Vector-Based Scheme Matching: FAISS similarity search to match user situations with the most relevant support schemes
- Serverless Architecture: Firebase Cloud Functions with Python runtime for scalable, maintainable backend operations
- Modern Web Interface: Responsive Next.js frontend with TypeScript for a seamless user experience
Ensure you have the following installed:
- Node.js (v14 or later): Download Node.js
- npm (v6 or later): Comes with Node.js
- Python (v3.10): Download Python
- Firebase CLI: Install globally using
npm install -g firebase-tools
- Docker: Install Docker
- Docker Compose: Included with Docker Desktop
- main branch contains frontend and backend code - push to Schemes prod
- stg branch contains frontend and backend code - push to Schemes dev
- telegram_bot branch contains telegram bot code - push to GCP
- dataset-workflow branch contains files to update dataset and do webscraping adhoc
- v3-archive-021224 contains mix of old and prototype scheemes code for reference
- Environment Variables and Model Files Download the following required files from Google Drive (contact maintainers for access):
.env
file → place inbackend/functions/
schemesv2-torch-allmpp-model/
→ place inbackend/functions/ml_logic/
schemesv2-torch-allmpp-tokenizer/
→ place inbackend/functions/ml_logic/
- Required
.npy
files → place inbackend/functions/ml_logic/
- Required
.faiss
files → place inbackend/functions/ml_logic/
Alternatively, you can build the model files yourself using model-creation-transformer-faiss.ipynb
Note: The .env
file contains sensitive configuration for Azure OpenAI services and should never be committed to version control.
The project consists of two main components:
-
Frontend: Next.js application with TypeScript
- See
frontend/README.md
for setup instructions - Staging URL: https://schemessg-v3-dev.web.app/
- Staging URL: https://schemes.sg/
- See
-
Backend: Firebase Functions with Python 3.10 runtime
- See
backend/README.md
for setup instructions - Staging URL: https://asia-southeast1-schemessg-v3-dev.cloudfunctions.net/
- Staging URL: https://asia-southeast1-schemessg.cloudfunctions.net/
- See
-
Frontend changes:
- Branch from
stg
- Make changes
- Test locally
- Create PR to
stg
- When PR is merged, github action
.github/workflows/firebase-hosting-staging.yml
will be triggered to deploy to firebase hosting in Schemes dev - Then create PR to merge
stg
intomain
- When PR is merged, github action
.github/workflows/firebase-hosting-production.yml
will be triggered to deploy to firebase hosting in Schemes prod
- Branch from
-
Backend changes:
- Test using Firebase emulator
- When
stg
branch is pushed, the github action.github/workflows/deploy_functions_dev.yml
will be triggered to deploy to Schemes dev - When
main
branch is pushed, the github action.github/workflows/deploy_functions_prod.yml
will be triggered to deploy to Schemes prod
Note: For local frontend development to work, you must have the backend running via Docker. Please refer to backend/README.md
for Docker setup and running instructions.
We welcome contributions from the community! Here's how you can help:
- Report Issues: Create issues for bugs or feature requests
- Submit Pull Requests:
- Fork the repository
- Create a feature branch from
stg
- Make your changes
- Submit a pull request to
stg
- Once approved and merged to
stg
, create another PR to merge intomain
Please ensure your PR:
- Follows the existing code style
- Includes appropriate tests
- Updates documentation as needed
- Describes the changes made
- Website: https://schemes.sg
- Issues: Please report bugs and feature requests through GitHub issues
- Discussions: Feel free to start discussions in the GitHub Discussions tab
- Contact: For other inquiries, reach out to the maintainers through GitHub
This project is licensed under the MIT License - see the LICENSE file for details.
- Built with support from better.sg
- Powered by Azure OpenAI
- Special thanks to all contributors and maintainers