8000 GitHub - andres-tellez/railway-pg-test
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

andres-tellez/railway-pg-test

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
< 8000 /div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

8000

🏃 Smart Marathon Coach API

This is a Flask-based API for syncing Strava activity data, enriching runs, and generating training insights. This repo is part of a multi-phase project — currently in Milestone 1: Setup & Plumbing.


🚀 Getting Started

1. Clone the repo

git clone https://github.com/your-username/railway-pg-test.git
cd railway-pg-test


### 2. Set up your virtual environment

```bash
python -m venv venv
venv\Scripts\activate  # On Windows
# or
source venv/bin/activate  # On Mac/Linux

3. Install dependencies

pip install -r requirements.txt

🛠️ Environment Configuration

Copy the example .env file and fill in your secrets:

cp .env.example .env

Or manually create .env with values like:

DATABASE_URL=postgresql://smartcoach:devpass@postgres:5432/smartcoach

# NOTE: For local dev without Docker, change "postgres" → "localhost"
# DATABASE_URL=postgresql://smartcoach:devpass@localhost:5432/smartcoach

STRAVA_CLIENT_ID=your_client_id
STRAVA_CLIENT_SECRET=your_client_secret
REDIRECT_URI=http://127.0.0.1:5000/oauth/callback
ADMIN_USER=admin
ADMIN_PASS=secret
SECRET_KEY=supersecretkey
CRON_SECRET_KEY=your_cron_key
INTERNAL_API_KEY=your_internal_key

💻 Running Locally

python run.py

Then open http://127.0.0.1:5000/ping
You should see: pong


🧪 Endpoints (Milestone 1)

Route Description
/ping Health check
/init-db Creates DB tables
/auth/login Basic credential-based login
/auth/logout Clear session
/enrich/status Returns enrichment status (stub)

More functionality is coming in Milestone 2


🧬 GitHub Actions

We’ve added a skeleton workflow in .github/workflows/cron-sync.yml that:

  • Runs every 6 hours
  • Supports manual trigger
  • Runs placeholder logic (future expansion)

🧩 Project Structure

railway-pg-test/
├── src/
│   ├── app.py               → Flask app entrypoint
│   ├── routes/              → Route blueprints
│   ├── services/            → Business logic
│   ├── db/                  → Database models + sessions
│   └── utils/               → Utility functions
├── schema.sql               → Creates core DB tables
├── run.py                   → Runs the app
├── requirements.txt
└── .env                     → Environment variables

📦 Requirements

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

0