Establish baseline: core documentation and memory system
Adds foundational workspace documentation: - Core identity and operating principles (SOUL.md, IDENTITY.md, AGENTS.md, USER.md) - Memory management system specification (MEMORY.md) - Development team context and workflow (CONTEXT.md, PROJECTS.md) - Environment notes template (TOOLS.md) - Heartbeat task template (HEARTBEAT.md) Includes super-enhanced memory system: - JavaScript memory engine implementation - Memory initialization and test scripts - Daily memory logs for 2026-07-03, 2026-07-04 - Project-level memory structure for site-survey-ai Adds project templates: - Standard Python Flask application template
This commit is contained in:
@@ -0,0 +1,62 @@
|
||||
# Makefile for standard Python Flask application
|
||||
|
||||
# Variables
|
||||
PYTHON := python3
|
||||
PIP := pip3
|
||||
FLASK_APP := src/app.py
|
||||
TESTS := tests/
|
||||
|
||||
# Default target
|
||||
.PHONY: help
|
||||
help:
|
||||
@echo "Available targets:"
|
||||
@echo " setup - Set up development environment"
|
||||
@echo " install - Install dependencies"
|
||||
@echo " run - Run development server"
|
||||
@echo " test - Run tests"
|
||||
@echo " lint - Run code linting"
|
||||
@echo " format - Format code with Black"
|
||||
@echo " clean - Clean up temporary files"
|
||||
|
||||
# Set up development environment
|
||||
.PHONY: setup
|
||||
setup:
|
||||
$(PYTHON) -m venv venv
|
||||
. venv/bin/activate && $(PIP) install -r requirements/development.txt
|
||||
|
||||
# Install dependencies
|
||||
.PHONY: install
|
||||
install:
|
||||
$(PIP) install -r requirements/development.txt
|
||||
|
||||
# Run development server
|
||||
.PHONY: run
|
||||
run:
|
||||
FLASK_APP=$(FLASK_APP) flask run --host=0.0.0.0 --port=5000 --debug
|
||||
|
||||
# Run tests
|
||||
.PHONY: test
|
||||
test:
|
||||
$(PYTHON) -m pytest $(TESTS) -v
|
||||
|
||||
# Run code linting
|
||||
.PHONY: lint
|
||||
lint:
|
||||
flake8 src/ tests/
|
||||
|
||||
# Format code with Black
|
||||
.PHONY: format
|
||||
format:
|
||||
black src/ tests/
|
||||
|
||||
# Clean up temporary files
|
||||
.PHONY: clean
|
||||
clean:
|
||||
find . -type f -name "*.pyc" -delete
|
||||
find . -type d -name "__pycache__" -delete
|
||||
rm -rf .pytest_cache/
|
||||
rm -rf .coverage
|
||||
rm -rf htmlcov/
|
||||
rm -rf *.egg-info/
|
||||
rm -rf dist/
|
||||
rm -rf build/
|
||||
@@ -0,0 +1,90 @@
|
||||
# Standard Python Flask Application Template
|
||||
|
||||
## Overview
|
||||
This is a standardized template for Python Flask applications following professional best practices.
|
||||
|
||||
## Directory Structure
|
||||
```
|
||||
{project-name}/
|
||||
├── src/ # Source code root
|
||||
│ ├── __init__.py
|
||||
│ ├── app.py # Application entry point
|
||||
│ ├── config.py # Configuration management
|
||||
│ ├── models/ # Data models and database schemas
|
||||
│ │ ├── __init__.py
|
||||
│ │ └── *.py # Model files
|
||||
│ ├── api/ # API endpoints
|
||||
│ │ ├── __init__.py
|
||||
│ │ └── *.py # API route files
|
||||
│ ├── services/ # Business logic
|
||||
│ │ ├── __init__.py
|
||||
│ │ └── *.py # Service files
|
||||
│ ├── utils/ # Utility functions
|
||||
│ │ ├── __init__.py
|
||||
│ │ └── *.py # Utility files
|
||||
│ └── templates/ # HTML templates (if using server-side rendering)
|
||||
├── frontend/ # Frontend assets (if separate)
|
||||
│ ├── static/ # Static assets (CSS, JS, images)
|
||||
│ │ ├── css/
|
||||
│ │ ├── js/
|
||||
│ │ └── images/
|
||||
│ └── templates/ # HTML templates
|
||||
├── tests/ # Test files
|
||||
│ ├── __init__.py
|
||||
│ ├── conftest.py # Test configuration
|
||||
│ └── test_*.py # Test files
|
||||
├── docs/ # Documentation
|
||||
│ ├── api.md
|
||||
│ ├── architecture.md
|
||||
│ └── deployment.md
|
||||
├── migrations/ # Database migrations (if using alembic)
|
||||
├── requirements/ # Dependency management
|
||||
│ ├── base.txt
|
||||
│ ├── development.txt
|
||||
│ └── production.txt
|
||||
├── scripts/ # Utility scripts
|
||||
│ ├── setup.py
|
||||
│ ├── deploy.py
|
||||
│ └── backup.py
|
||||
├── .env.example # Environment variable examples
|
||||
├── .gitignore
|
||||
├── Dockerfile # Container definition
|
||||
├── docker-compose.yml # Multi-container setup
|
||||
├── CHANGELOG.md
|
||||
└── Makefile # Common commands
|
||||
```
|
||||
|
||||
## Usage
|
||||
1. Copy this template to create a new project
|
||||
2. Replace `{project-name}` with your actual project name
|
||||
3. Customize the structure based on project requirements
|
||||
4. Update README.md with project-specific information
|
||||
|
||||
## Best Practices Implemented
|
||||
- Clear separation of concerns
|
||||
- Modular design
|
||||
- Comprehensive testing structure
|
||||
- Professional documentation
|
||||
- Standardized configuration management
|
||||
- Environment variable support
|
||||
- Containerization support
|
||||
- CI/CD ready structure
|
||||
|
||||
## Development Setup
|
||||
```bash
|
||||
# Create virtual environment
|
||||
python -m venv venv
|
||||
source venv/bin/activate
|
||||
|
||||
# Install dependencies
|
||||
pip install -r requirements/development.txt
|
||||
|
||||
# Run tests
|
||||
make test
|
||||
|
||||
# Start development server
|
||||
make run
|
||||
```
|
||||
|
||||
## Deployment
|
||||
The template includes Docker support for consistent deployment across environments.
|
||||
@@ -0,0 +1,4 @@
|
||||
# Base requirements for all environments
|
||||
Flask==2.3.2
|
||||
Flask-CORS==4.0.0
|
||||
python-dotenv==1.0.0
|
||||
@@ -0,0 +1,6 @@
|
||||
# Development requirements
|
||||
-r base.txt
|
||||
pytest==7.4.0
|
||||
pytest-cov==4.1.0
|
||||
flake8==6.0.0
|
||||
black==23.3.0
|
||||
Reference in New Issue
Block a user