Online trips diary
To set up the application, you need to provide certain configuration details. We use a YAML file for this purpose.
Install python dependencies:
pip install -r requirements.txtIf you want to use pyenv to manage your Python virtual environment, you can automatically enable it for the trainlog folder with:
pyenv install 3.13
pyenv virtualenv 3.13 trainlog
pyenv local trainlog
pip install -r requirements.txtInstall pre-commit hooks, to automatically format and lint your code:
pre-commit installCopy the provided config-example.yaml and .env.example:
cp config-example.yaml config.yaml
cp .env.example .envEdit the .env file with appropriate values.
Edit the config.yaml in your preferred text editor to fill in your details:
You'll also need to setup Git LFS.
git lfs install
git lfs pullThis is for sending emails. You can ignore it for running the app locally. Please provide the SMTP server details:
server: The address of your SMTP server. Example:smtp.gmail.comport: The port used by the SMTP server. Common ports include587(with STARTTLS) or465(for SSL/TLS).user: The email address you'll be sending emails from.password: The password for the email account.
smtp:
server: smtp.example.com
port: 587
user: [email protected]
password: YOUR_PASSWORD_HEREThis section is for the application owner's details:
username: Your preferred username.email: Your email address.password: Your password (will be securely hashed before storing).
owner:
username: your_username
email: [email protected]
password: your_passwordOpenAI is used for bootstrapping translations. If you won't be doing that, you don't need to configure that part.
openai:
openai_key: OPENAI_API_KEYThis is used to fetch photos of ships.
google:
key: GOOGLE_API_KEY
cx: GOOGLE_CXThis is used for donations to the project. You can ignore this when running the app locally.
bmc:
key: BMC_API_KEYmake startOr if you prefer to run Flask outside of docker:
make start-local- Security: Ensure that the
config.yamlfile is secured with the right file permissions and is not publicly accessible. Keep it out of version control to prevent accidentally exposing sensitive details. - Placeholder Configuration: Do not use the
config-example.yamlas is for the application. Always create a copy and provide real values. - Supported Python version: Currently Python 3.13.x