Link to Web App: https://hlpractice.pythonanywhere.com/
HL Solar
is a web application for requesting solar panel evaluations with admin dashboard interface.
/form
- Submit a request for solar panel evaluation with the following fields: Name, Email, Phone Number, Address and Preferred timeslot
/status/<requestId>
- Request Status- After form submission, residents are provided with a confirmation status link
- View request status or Cancel Appointment
- Confirmation Timeslot
- Email sent with timeslot information to residents, at around midnight of the day of appointment
- Python script with
pythonanywhere
scheduled task to automate email sending process
-
/login
- Admins can log in with either GitHub or Google Accounts
- Authorisation with Security Rules
- Admins can log in with either GitHub or Google Accounts
-
/dashboard
- protected page- Algorithmic Planning (with RouteXL API)
- Generated at the start of each working day
- List View (with datatables)
- Relevant information displayed into respective columns
- Table format with paginated controls, search functionality
- View all created listings or today's listings
- Button to update status to
Mark as Visited
- Button to print table as a
.pdf
- Map View (with leaflet.js)
- Numbered Markers to indicate sequence
- Button to print map
- Algorithmic Planning (with RouteXL API)
-
GitHub and Google Authentication with
firebase
-
Form Address Autocomplete with
Geoapify
Firebase's Cloud Firestore
Python>=3.11
- Flask Appgithub OAuth App
- For GitHub Based Authenticationfirebase account
- Authentication and Databasepythonanywhere account
- Deployment to CloudRouteXL account
- Route Optimisation APIGeoapify account
- Autocomplete Address API
Create and store secrets in
.env
file Refactor URL links and other information, as accordingly
- Clone Repo
git clone https://github.com/chingu-voyages/v52-tier3-team-30.git
- Create Virtual Environment
python -m venv venv
- Install Python Libraries
pip install -r requirements.txt
- Setup Firebase Project
Reference: https://www.youtube.com/watch?v=HoRutj1z3fQ
- Add a Web App
- Copy & Paste Config into
firebase_config.py
andfirebase-config.js
- Copy & Paste Config into
- Generate Private Key
- Project Settings
- Generate (Save
.json
asfirebase-auth.json
)
- Authentication (Enable for Both Google and GitHub Logins)
- Cloud Firestore
- Schema
- appointments (Collection)
- Date in format: YYYY-MM-DD (Document)
- isCreated = False (Field)
- Date in format: YYYY-MM-DD (Document)
- residents (Collection)
- (Document ID is Autogenerated)
- Field:
- address (type: geopoint)
- email (type: string)
- name (type: string)
- phone (type: string)
- queue (type: string)
- status (type: string)
- timeslot (type: timestamp)
- Field:
- (Document ID is Autogenerated)
- appointments (Collection)
- Schema
- Change URL
autocomplete.js
, change to your own domaindatabase.py
, line 15 - change to your own user agent
- Run Flask App and visit link
python app.py
- Deploy to PythonAnywhere [Optional]
- DataTables
- Firebase
- Geoapify Autocomplete
- leaflet.js
- Leaflet Browser Print
- Mock Email Sending with SMTP Bucket
Everyone on your team should add their name along with a link to their GitHub & optionally their LinkedIn profiles below. Do this in Sprint #1 to validate your repo access and to practice PR'ing with your team before you start coding!