from flask import Flask, render_template, request from flask_sqlalchemy import SQLAlchemy import os # Initialize the Flask application app = Flask(__name__) # Configure database app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///local.db' app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False db = SQLAlchemy(app) # Define a simple User model class User(db.Model): id = db.Column(db.Integer, primary_key=True) username = db.Column(db.String(80), unique=True, nullable=False) email = db.Column(db.String(120), unique=True, nullable=False) def __repr__(self): return f'<User {self.username}>' # Create database tables with app.app_context(): db.create_all() # Main route @app.route('/') def index(): return render_template('index.html') # Run the application if __name__ == '__main__': app.run(debug=True)
Your privacy-first, self-hostable coding platform
Your code never leaves your infrastructure. No telemetry, no tracking.
Run on your own server with Docker. Full control over your environment.
Flask backend, React frontend, SQLite/Postgres support out of the box.