Skip to content

Commit 3699d54

Browse files
committed
Update README.md
1 parent 1678cab commit 3699d54

File tree

1 file changed

+46
-41
lines changed

1 file changed

+46
-41
lines changed

README.md

Lines changed: 46 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -102,16 +102,17 @@ lafs/
102102
For those who want to get up and running quickly with default settings:
103103

104104
```bash
105-
# Clone the repo
105+
# Clone repository
106106
git clone https://github.com/ggeerraarrdd/lafs.git
107107
cd lafs
108108

109-
# Set up environment and install dependencies
109+
# Set up environment
110110
python3 -m venv venv
111-
source venv/bin/activate # On Windows use `venv\\Scripts\\activate`
111+
source venv/bin/activate # Windows: venv\Scripts\activate
112112
pip install -r requirements.txt
113113

114-
# Run the application
114+
# Run app
115+
cd app
115116
flask run
116117

117118
# Navigate to the URL specified in the terminal output
@@ -121,7 +122,20 @@ flask run
121122

122123
### Prerequisites
123124

124-
* TBD
125+
Before you begin, ensure you have met the following requirements:
126+
127+
1. **Development Tools**
128+
129+
* Python 3.12 (not tested on other versions)
130+
* [git](https://git-scm.com/) (for cloning the repository)
131+
132+
2. **Google Maps API Key**
133+
134+
For the embedded maps to work, you need to set up a Google Maps API Key. Before you can create one, you will need to create a Google Cloud project, for which you need a Google Cloud account.
135+
136+
* [Set up a Google Cloud account](https://cloud.google.com)
137+
* [Set up your Google Cloud project](https://developers.google.com/maps/documentation/javascript/cloud-setup)
138+
* [Create and configure your API Key](https://developers.google.com/maps/documentation/javascript/get-api-key)
125139

126140
### Dependencies
127141

@@ -136,7 +150,7 @@ flask run
136150
cd lafs
137151
```
138152

139-
2. **Create and activate a Python virtual environment**
153+
2. **Set up a Python virtual environment**
140154

141155
```bash
142156
python3 -m venv venv
@@ -146,9 +160,8 @@ flask run
146160
3. **Install the dependencies**
147161

148162
```bash
149-
python -m pip install --upgrade pip
163+
pip install --upgrade pip
150164
pip install -r requirements.txt
151-
```
152165
153166
### Configuration
154167
@@ -173,50 +186,38 @@ flask run
173186
MAX_DELAY=10
174187

175188
# Flask Secret Key
176-
SECRET_KEY='your_flask_secret_key'
189+
SECRET_KEY='192b9bdd22ab9ed4d12e236c78afcb9a393ec15f71bbf5dc987d54727823bcbf'
177190

178191
# Google Maps API Key
179192
MAP_API_KEY='your_map_api_key'
180193
```
181194

182-
2. **Database**
195+
2. **Database Options Explained**
183196

184-
```python
185-
# Database Path
186-
DATABASE_NAME='data/lafs.db' # Path to SQLite database file
197+
`DATABASE_NAME` - path to SQLite database file
187198

188-
# Database Connection Pool
189-
POOL_SIZE=15 # Max number of persistent connections
190-
MAX_OVERFLOW=5 # Max number of connections above POOL_SIZE
191-
POOL_TIMEOUT=30 # Seconds to wait for available connection
192-
POOL_RECYCLE=1800 # Seconds before connection is recycled
193-
ECHO=False # Enable SQLAlchemy engine logging
194-
195-
# Database Retry Settings
196-
MAX_RETRIES=3 # Max retry attempts for failed operations
197-
BASE_DELAY=1 # Initial delay between retries in seconds
198-
MAX_DELAY=10 # Max delay between retries in seconds
199-
```
199+
SQLAlchemy [Engine/Connection Pool](https://docs.sqlalchemy.org/en/20/core/engines_connections.html) Parameters:
200+
* `POOL_SIZE` - max number of persistent connections
201+
* `MAX_OVERFLOW` - max number of connections above POOL_SIZE
202+
* `POOL_TIMEOUT` - seconds to wait for available connection
203+
* `POOL_RECYCLE` - seconds before connection is recycled
204+
* `ECHO` - enable SQLAlchemy engine logging
200205

201-
3. **Flask Secret Key**
206+
Custom Retry Mechanism Parameters:
207+
* `MAX_RETRIES` - max retry attempts for failed operations
208+
* `BASE_DELAY` - initial delay between retries in seconds
209+
* `MAX_DELAY` - max delay between retries in seconds
202210

203-
```python
204-
# Flask Secret Key
205-
SECRET_KEY='your_flask_secret_key'
206-
```
211+
3. **Flask Secret Key Options Explained**
207212

208-
4. **Google Maps API Key**
213+
From Flask's [official documentation](https://flask.palletsprojects.com/en/stable/config/): _A secret key that will be used for securely signing the session cookie and can be used for any other security related needs by extensions or your application. It should be a long random bytes or str. For example, copy the output of this to your config:_
209214
210-
```python
211-
# Google Maps API Key
212-
MAP_API_KEY='your_map_api_key'
215+
```bash
216+
$ python -c 'import secrets; print(secrets.token_hex())'
217+
'192b9bdd22ab9ed4d12e236c78afcb9a393ec15f71bbf5dc987d54727823bcbf'
213218
```
214219
215-
An API Key is needed for the embedded map to work. Before you can create one, you will need to create a Google Cloud project, for which you need a Google Cloud account.
216-
217-
* [Set up a Google Cloud account](https://cloud.google.com)
218-
* [Set up your Google Cloud project](https://developers.google.com/maps/documentation/javascript/cloud-setup)
219-
* [Using API Keys](https://developers.google.com/maps/documentation/javascript/get-api-key)
220+
The above is used as system default for local development. You can generate a new one using the `secrets` module fro Python standard library or using your preferred method.
220221
221222
## Usage
222223
@@ -228,7 +229,11 @@ flask run
228229
229230
2. **Open the film series website**
230231
231-
Copy and open the URL displayed after 'Running on' in the terminal.
232+
Navigate to the URL specified in the terminal output. For example:
233+
234+
```bash
235+
* Running on http://127.0.0.1:5000
236+
```
232237
233238
## Production Setup
234239
@@ -270,7 +275,7 @@ This project is not accepting contributions at this time. It is intended solely
270275

271276
## Screenshots
272277

273-
![LAFS](/docs/images/film-series0_2.png "Landscape Architecture Film Series")
278+
![LAFS](/assets/images/film-series0_2.png "Landscape Architecture Film Series")
274279
_(Image created using [Portfoliofy](https://github.com/ggeerraarrdd/portfoliofy).)_
275280

276281
![LAFS](/assets/images/film-series2_2.jpg "Landscape Architecture Film Series")

0 commit comments

Comments
 (0)