Fix: Better error handling for missing Google OAuth credentials
- Add .env.example with required environment variables - Add helpful warning message when google_client_id/secret are missing - Update steps_to_run.md with detailed setup instructions - Include instructions for creating Google OAuth credentials Addresses #9
This commit is contained in:
@@ -2,17 +2,36 @@
|
||||
|
||||
1. To run server, install virtualenv first https://virtualenv.pypa.io/en/latest/ and create a new virtual environment to load all necessary python packages
|
||||
|
||||
2. Go to server folder and install all necessary packages using command "pip install -r requirements.txt"
|
||||
2. Go to server folder and install all necessary packages using command `pip install -r requirements.txt`
|
||||
|
||||
3. Set environment variables FLASK_ENV=dev and FLASK_APP=webserver.py
|
||||
3. Set up environment variables:
|
||||
- Copy `.env.example` to `.env`: `cp .env.example .env`
|
||||
- Edit `.env` and add your credentials:
|
||||
- `FLASK_ENV=dev`
|
||||
- `FLASK_APP=webserver.py`
|
||||
- `google_client_id` - Get from [Google Cloud Console](https://console.cloud.google.com/apis/credentials)
|
||||
- `google_client_secret` - Get from Google Cloud Console
|
||||
|
||||
4. Create a db for storing all the info using commands i) flask db init ii) flask db migrate iii) flask db upgrade
|
||||
**To create Google OAuth credentials:**
|
||||
1. Go to Google Cloud Console > APIs & Services > Credentials
|
||||
2. Click "Create Credentials" > "OAuth client ID"
|
||||
3. Select "Web application"
|
||||
4. Add authorized redirect URIs:
|
||||
- `http://localhost:5000/rp/google_callback` (for development)
|
||||
5. Copy the Client ID and Client Secret to your `.env` file
|
||||
|
||||
5. Run the server using python webserver.py
|
||||
4. Create a db for storing all the info using commands:
|
||||
```bash
|
||||
flask db init
|
||||
flask db migrate
|
||||
flask db upgrade
|
||||
```
|
||||
|
||||
5. Run the server using `python webserver.py`
|
||||
|
||||
|
||||
# Client
|
||||
|
||||
1. To run client, go to client folder and do npm install
|
||||
1. To run client, go to client folder and do `npm install`
|
||||
|
||||
2. Now run "npm start" and this should start the client
|
||||
2. Now run `npm start` and this should start the client
|
||||
|
||||
Reference in New Issue
Block a user