Skip to content

Stoick643/pd-triglav

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

92 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PD Triglav - Mountaineering Club Web Application

Web application for PD Triglav mountaineering club built with Python Flask. Features member management, trip announcements, trip reports with photo galleries, and AI-powered historical content.

Features

  • Multi-role Authentication: Classical registration + Google OAuth with admin approval
  • Trip Management: Announcements, signup system, calendar view
  • Rich Content: Trip reports with photo galleries and comments
  • AI-Powered Content: Daily historical events and mountaineering news
  • Responsive Design: Mobile-friendly web interface
  • Slovenian Language: Built for Slovenian mountaineering community

Quick Start

Prerequisites

  • Python 3.8+
  • PostgreSQL (or SQLite for development)
  • AWS S3 account (for photo storage)
  • Google OAuth credentials

Installation

  1. Clone the repository
git clone https://github.com/Stoick643/pd-triglav.git
cd pd-triglav
  1. Create virtual environment
python3 -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
  1. Install pip-tools and dependencies
pip install pip-tools
pip-sync requirements.txt
  1. Environment setup
cp .env.example .env
# Edit .env with your configuration
  1. Database setup
flask db upgrade
python3 scripts/seed_db.py  # Creates test users
  1. Run the application
python3 app.py
# Or alternatively: flask run

Visit http://localhost:5000 to access the application.

Test Users (Development)

Environment Variables

Create a .env file with the following variables:

# Flask Configuration
SECRET_KEY=your-secret-key-here
FLASK_ENV=development
DATABASE_URL=postgresql://user:pass@localhost/pd_triglav

# Google OAuth
GOOGLE_CLIENT_ID=your-google-client-id
GOOGLE_CLIENT_SECRET=your-google-client-secret

# AWS S3
AWS_ACCESS_KEY_ID=your-aws-key
AWS_SECRET_ACCESS_KEY=your-aws-secret
AWS_REGION=eu-north-1
AWS_S3_BUCKET=pd-triglav-photos

# Email Configuration
MAIL_SERVER=smtp.render.com
MAIL_PORT=587
MAIL_USE_TLS=True
MAIL_USERNAME=your-email
MAIL_PASSWORD=your-password

# LLM API (for historical content)
LLM_API_KEY=your-llm-api-key
LLM_API_URL=your-llm-endpoint

Project Structure

pd-triglav/
├── app.py                 # Flask application factory
├── config.py             # Configuration classes
├── requirements.txt      # Python dependencies
├── models/               # Database models
├── routes/               # Application routes
├── templates/            # Jinja2 templates
├── static/               # CSS, JavaScript, images
├── migrations/           # Database migrations
├── tests/                # Test files
├── scripts/              # Utility scripts
└── docs/                 # Documentation

Development

Dependency Management

This project uses pip-tools for deterministic dependency management:

# Add new dependency
echo "new-package" >> requirements.in
pip-compile requirements.in

# Update all dependencies
pip-compile --upgrade requirements.in

# Sync your environment with exact versions
pip-sync requirements.txt

# Install pip-tools (if not installed)
pip install pip-tools

Important: Always edit requirements.in for dependencies, never requirements.txt directly.

Running Tests

# Run all tests
pytest tests/

# Run with coverage
pytest --cov=. tests/

# Run specific test file
pytest tests/test_trip_model.py

Database Migrations

This project uses Flask-Migrate for database schema management:

# Initialize migrations (first time only)
flask db init

# Create migration after model changes
flask db migrate -m "Description of changes"

# Apply migrations to database
flask db upgrade

# Downgrade to previous migration
flask db downgrade

Code Quality

# Run linting
flake8 .

# Format code
black .

Deployment

Render Deployment

  1. Connect your GitHub repository to Render
  2. Configure environment variables in Render dashboard
  3. Deploy using the provided render.yaml configuration

Manual Deployment

See docs/deployment.md for detailed deployment instructions.

Documentation

Technology Stack

  • Backend: Python Flask, SQLAlchemy, PostgreSQL
  • Frontend: Jinja2, Bootstrap 5, HTMX
  • Authentication: Flask-Login, Authlib (Google OAuth)
  • File Storage: AWS S3
  • Deployment: Render
  • Testing: pytest, coverage

Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support

For questions or issues, please:

  1. Check the documentation
  2. Search existing GitHub issues
  3. Create a new issue if needed

Acknowledgments

  • PD Triglav mountaineering club for project requirements
  • Flask community for excellent documentation
  • Contributors and testers

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors