A professional Flask web application for TerraLumen.org - A Private Members Association dedicated to natural healing, advanced plasma technologies, and personal sovereignty.
- Public Pages: Home, About, Services, Membership, Contact, and Blog
- Member System: Registration, authentication, and member dashboard
- Stripe Integration: Payment processing for memberships (Annual, Lifetime, Supporter)
- Blog System: Article management with member-only content support
- Admin Panel: Protected admin interface for managing articles and members
- Professional Design: Responsive design with TerraLumen brand colors
- PDF Membership Cards: Automatic generation of digital membership cards
- Backend: Flask 3.0.0
- Database: SQLite (development) / PostgreSQL (production)
- Authentication: Flask-Login
- Payments: Stripe
- PDF Generation: ReportLab
- Deployment: Gunicorn (for Render)
- Python 3.11+
- pip (Python package manager)
-
Clone the repository
git clone <repository-url> cd terralumen_website
-
Create a virtual environment
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies
pip install -r requirements.txt
-
Set up environment variables
Create a
.envfile in the root directory:SECRET_KEY=your-secret-key-here DATABASE_URL=sqlite:///instance/terralumen.db STRIPE_SECRET_KEY=sk_test_your_stripe_secret_key STRIPE_PUBLISHABLE_KEY=pk_test_your_stripe_publishable_key STRIPE_WEBHOOK_SECRET=whsec_your_webhook_secret
-
Initialize the database
flask db init flask db migrate -m "Initial migration" flask db upgrade -
Create an admin user (optional)
You can create an admin user through the Flask shell:
flask shell
from app import db from app.models import User, MembershipType, MembershipStatus admin = User( name='Admin User', email='admin@terralumen.org', membership_type=MembershipType.ANNUAL, membership_status=MembershipStatus.ACTIVE, is_admin=True ) admin.set_password('your-admin-password') db.session.add(admin) db.session.commit()
-
Run the application
python run.py
The application will be available at
http://localhost:5000
-
Push your code to GitHub
-
Create a new Web Service on Render
- Connect your GitHub repository
- Select the repository
-
Configure the service
- Name: terralumen-website (or your preferred name)
- Environment: Python 3
- Build Command:
pip install -r requirements.txt - Start Command:
gunicorn run:app
-
Set environment variables in Render dashboard
SECRET_KEY: Generate a secure random keyDATABASE_URL: Use Render's PostgreSQL database URL (or keep SQLite for development)STRIPE_SECRET_KEY: Your Stripe secret keySTRIPE_PUBLISHABLE_KEY: Your Stripe publishable keySTRIPE_WEBHOOK_SECRET: Your Stripe webhook secret
-
Configure Stripe Webhook
- In Stripe Dashboard, create a webhook endpoint pointing to:
https://your-app.onrender.com/stripe/webhook - Copy the webhook signing secret to your environment variables
- In Stripe Dashboard, create a webhook endpoint pointing to:
-
Deploy
- Render will automatically deploy your application
terralumen_website/
├── app/
│ ├── __init__.py # Flask app initialization
│ ├── models.py # Database models
│ ├── routes.py # Public routes
│ ├── auth.py # Authentication routes
│ ├── admin.py # Admin panel routes
│ ├── stripe_handler.py # Stripe payment handling
│ ├── config.py # Configuration
│ ├── templates/ # Jinja2 templates
│ │ ├── base.html
│ │ ├── index.html
│ │ ├── about.html
│ │ ├── services.html
│ │ ├── membership.html
│ │ ├── contact.html
│ │ ├── blog.html
│ │ ├── article.html
│ │ ├── login.html
│ │ ├── register.html
│ │ ├── member_dashboard.html
│ │ ├── member_content.html
│ │ ├── admin/ # Admin templates
│ │ └── errors/ # Error pages
│ ├── static/
│ │ ├── css/
│ │ │ └── style.css
│ │ ├── js/
│ │ │ └── main.js
│ │ └── images/
│ └── utils/
│ ├── email_handler.py
│ └── membership_card.py
├── migrations/ # Database migrations
├── instance/ # Database files (gitignored)
├── requirements.txt
├── Procfile # Render deployment config
├── runtime.txt # Python version
├── .env.example # Environment variables example
├── .gitignore
├── README.md
└── run.py # Application entry point
| Variable | Description | Required |
|---|---|---|
SECRET_KEY |
Flask secret key for sessions | Yes |
DATABASE_URL |
Database connection string | Yes |
STRIPE_SECRET_KEY |
Stripe API secret key | Yes |
STRIPE_PUBLISHABLE_KEY |
Stripe publishable key | Yes |
STRIPE_WEBHOOK_SECRET |
Stripe webhook signing secret | Yes |
MAIL_SERVER |
SMTP server for emails | No |
MAIL_PORT |
SMTP port | No |
MAIL_USE_TLS |
Use TLS for email | No |
MAIL_USERNAME |
Email username | No |
MAIL_PASSWORD |
Email password | No |
MAIL_DEFAULT_SENDER |
Default sender email | No |
- Homepage with hero section and service overview
- About page with mission and founders information
- Services page detailing healing modalities
- Membership page with pricing options
- Contact form with validation
- Blog with pagination and article reading
- User registration and authentication
- Member dashboard with status and quick actions
- Exclusive member-only content access
- PDF membership card download
- Priority booking access
- Protected admin dashboard
- Article management (create, edit, delete, publish)
- Member management and viewing
- Transaction history
- Statistics overview
- Stripe checkout for memberships
- Webhook handling for payment events
- Automatic membership status updates
- Support for subscriptions and one-time payments
- Password hashing with Werkzeug
- CSRF protection with Flask-WTF
- SQL injection prevention via SQLAlchemy ORM
- XSS protection via template escaping
- Secure session management
- Admin route protection
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is proprietary and confidential.
For support, email contact@terralumen.org or visit the contact page on the website.
- TerraLumen founders: Nicole Chiplin and Jonathan King
- Built with Flask and modern web technologies