{"id":31073557,"url":"https://github.com/mikebionic/landing_admin","last_synced_at":"2026-06-22T02:31:31.109Z","repository":{"id":313051098,"uuid":"484836495","full_name":"mikebionic/landing_admin","owner":"mikebionic","description":"Landing Page management \u0026 render with Admin Panel on Python Flask (2021)","archived":false,"fork":false,"pushed_at":"2025-09-05T15:12:51.000Z","size":14507,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-09-16T01:48:13.247Z","etag":null,"topics":["admin-panel","flask","landing","landing-page","migration","postgresql","postgresql-database"],"latest_commit_sha":null,"homepage":"","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mikebionic.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-04-23T19:17:23.000Z","updated_at":"2025-09-06T11:28:06.000Z","dependencies_parsed_at":"2025-09-03T17:35:30.897Z","dependency_job_id":null,"html_url":"https://github.com/mikebionic/landing_admin","commit_stats":null,"previous_names":["mikebionic/landing_admin"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/mikebionic/landing_admin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikebionic%2Flanding_admin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikebionic%2Flanding_admin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikebionic%2Flanding_admin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikebionic%2Flanding_admin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mikebionic","download_url":"https://codeload.github.com/mikebionic/landing_admin/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikebionic%2Flanding_admin/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34632515,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-22T02:00:06.391Z","response_time":106,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["admin-panel","flask","landing","landing-page","migration","postgresql","postgresql-database"],"created_at":"2025-09-16T01:48:03.638Z","updated_at":"2026-06-22T02:31:31.084Z","avatar_url":"https://github.com/mikebionic.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Landing Admin\n\nA Python Flask web application with admin panel, REST API, and multi-language support for managing landing pages.\n \n![](docs/admin2.png)\n| | |\n|----|---|\n|![](docs/admin1.png)|![](docs/admin3.png)|\n|![](docs/home1.png)|![](docs/home2.png)|\n|![](docs/home3.png)|![](docs/home4.png)|\n|![](docs/home5.png)|![](docs/home_v1.png)|\n\n\n\n## Features\n\n- **Admin Panel**: Web-based administration interface\n- **REST API**: Full API endpoints for frontend integration\n- **Multi-language Support**: Supports Turkmen (tk), English (en), and Russian (ru)\n- **Caching**: Redis-based caching for improved performance\n- **Session Management**: Redis session storage\n- **Database Support**: PostgreSQL and MSSQL support\n- **Security**: CSRF protection, user authentication\n- **Performance**: HTML minification, compression, CORS support\n\n---\n\n```\n! If images are local, change url to:\n\"file_path\": \"/static/web/assets/img/ugurly_yol/worker1.png\"\n```\n\n## Quick Start with Docker\n\nThe fastest way to get started:\n\n```bash\n# Clone the repository\ngit clone git@github.com:mikebionic/landing_admin.git\ncd landing-admin\n\n# Copy environment file\ncp .env.example .env\n\n# Edit .env with your settings (optional - defaults work for development)\nnano .env\n\n# Start the application\nmake docker-up\n```\n\nThe application will be available at `http://localhost:8000`\n\n---\n\n## Manual Setup\n\n### Prerequisites\n\n- Python 3.8+\n- PostgreSQL 12+\n- Redis (optional, but recommended)\n\n### Installation Steps\n\n1. **Clone and setup**\n   ```bash\n   git clone \u003cyour-repo-url\u003e\n   cd landing-admin\n   python -m venv venv\n   source venv/bin/activate  # On Windows: venv\\Scripts\\activate\n   pip install -r requirements.txt\n   ```\n\n2. **Database Setup**\n   ```bash\n   # Create PostgreSQL database\n   createdb landing_admin\n   \n   # Or connect to PostgreSQL and run:\n   # CREATE DATABASE landing_admin;\n   ```\n\n3. **Configuration**\n   ```bash\n   cp .env.example .env\n   # Edit .env with your database credentials and other settings\n   ```\n\n4. **Create required directories**\n   ```bash\n   mkdir -p static/uploads\n   ```\n\n5. **Database Migration**\n   ```bash\n   # Copy migration config\n   cp example.migration.json app.migration.json\n   # Edit app.migration.json as needed\n   \n   # Run migrations (if available)\n   flask db upgrade\n   ```\n\n6. **Run the application**\n   ```bash\n   python app.py\n   ```\n\n---\n\n## Environment Configuration\n\nKey environment variables in `.env`:\n\n### Application Settings\n- `APP_PORT`: Port to run the application (default: 8000)\n- `APP_HOST`: Host address (default: 0.0.0.0)\n- `SECRET_KEY`: Flask secret key for sessions\n- `DEBUG`: Enable debug mode (1/0)\n\n### Database Configuration\n- `DB_TYPE`: Database type (postgres/mssql)\n- `DB_USERNAME`: Database username\n- `DB_PASSWORD`: Database password\n- `DB_DATABASE`: Database name\n- `DB_HOST`: Database host\n- `DB_PORT`: Database port\n\n### Redis Configuration (Optional)\n- `SESSION_REDIS`: Redis URL for sessions\n- `CACHE_REDIS_URL`: Redis URL for caching\n- `CACHE_TYPE`: Cache type (simple/redis)\n\n### Features\n- `USE_FLASK_CORS`: Enable CORS (1/0)\n- `USE_FLASK_COMPRESS`: Enable compression (1/0)\n- `BABEL_DEFAULT_LOCALE`: Default language (tk/en/ru)\n\n---\n\n## Available Commands (Makefile)\n\n```bash\n# Development\nmake install          # Install dependencies\nmake run             # Run development server\nmake test            # Run tests (if available)\n\n# Docker operations\nmake docker-build    # Build Docker image\nmake docker-up       # Start with docker-compose\nmake docker-down     # Stop docker-compose\nmake docker-logs     # View logs\nmake docker-shell    # Access container shell\n\n# Database operations\nmake db-init         # Initialize database\nmake db-migrate      # Run migrations\nmake db-reset        # Reset database\n\n# Utilities\nmake clean           # Clean temporary files\nmake lint            # Run code linting\nmake format          # Format code\n```\n\n---\n\n## API Endpoints\n\nThe application provides REST API endpoints under `/api` prefix:\n- `GET /api/auth/get-images/` - Get Images'\n- `GET /api/auth/get-pages/` - Get Pages'\n\n\n### Admin Routes\n- Admin panel available at `/admin/login`\n- Web interface at `/`\n\n### Language Support\n- Switch language: `GET /set_language/\u003ccode\u003e`\n- Supported codes: `tk`, `en`, `ru`\n\n---\n\n## Project Structure\n\n```\nlanding-admin/\n├── app.py                 # Application entry point\n├── main/\n│   ├── __init__.py       # App factory and configuration\n│   ├── config.py         # Configuration settings\n│   ├── models.py         # Database models\n│   ├── languageMethods.py # Language utilities\n│   ├── admin/            # Admin blueprint\n│   ├── web/              # Web blueprint  \n│   ├── api/              # API blueprint\n│   ├── static/           # Static files\n│   └── templates/        # Jinja2 templates\n├── static/\n│   └── uploads/          # Upload directory\n├── requirements.txt      # Python dependencies\n├── Dockerfile           # Docker configuration\n├── docker-compose.yml   # Docker Compose setup\n├── Makefile            # Development commands\n└── .env                # Environment variables\n```\n\n---\n\n## Development\n\n### Adding New Features\n\n1. **Models**: Add database models in `main/models.py`\n2. **Routes**: Create routes in appropriate blueprint (`admin`, `web`, `api`)\n3. **Templates**: Add Jinja2 templates in `main/templates`\n4. **Static Files**: Add CSS/JS/images in `main/static`\n\n### Multi-language Support\n\nThe application uses Flask-Babel for internationalization:\n\n1. **Mark strings for translation**:\n   ```python\n   from flask_babel import gettext, lazy_gettext\n   message = gettext('Hello World')\n   ```\n\n2. **Extract messages**:\n   ```bash\n   pybabel extract -F babel.cfg -k _l -o messages.pot .\n   ```\n\n3. **Update translations**:\n   ```bash\n   pybabel update -i messages.pot -d translations\n   ```\n\n### Database Operations\n\nUse SQLAlchemy for database operations:\n\n```python\nfrom main import db\nfrom main.models import YourModel\n\n# Create\nitem = YourModel(name='example')\ndb.session.add(item)\ndb.session.commit()\n\n# Query\nitems = YourModel.query.all()\n```\n\n---\n\n## Deployment\n\n### Production Deployment\n\n1. **Using Docker** (Recommended):\n   ```bash\n   # Production build\n   docker-compose -f docker-compose.prod.yml up -d\n   ```\n\n2. **Manual Deployment**:\n   ```bash\n   # Use a production WSGI server\n   pip install gunicorn\n   gunicorn -w 4 -b 0.0.0.0:8000 app:app\n   ```\n\n### Environment Variables for Production\n\nSet these additional variables for production:\n\n```bash\nDEBUG=0\nTESTING=0\nSECRET_KEY=your-super-secret-key\nFLASK_ENV=production\n```\n\n---\n\n## Troubleshooting\n\n### Common Issues\n\n1. **Database Connection Error**:\n   - Check database credentials in `.env`\n   - Ensure PostgreSQL is running\n   - Verify database exists\n\n2. **Redis Connection Error**:\n   - Install and start Redis server\n   - Or set `SESSION_TYPE=filesystem` in `.env`\n\n3. **Permission Errors**:\n   - Ensure `static/uploads` directory exists\n   - Check file permissions\n\n4. **Import Errors**:\n   - Activate virtual environment\n   - Install requirements: `pip install -r requirements.txt`\n\n### Logs\n\nView application logs:\n```bash\n# Docker\nmake docker-logs\n\n# Manual\ntail -f app.log\n```\n\n---\n\n## Contributing\n\n1. Fork the repository\n2. Create a feature branch: `git checkout -b feature-name`\n3. Make changes and test\n4. Commit: `git commit -am 'Add feature'`\n5. Push: `git push origin feature-name`\n6. Create Pull Request\n\n---\n\n## License\n\nThis project is licensed under the MIT License - see the LICENSE file for details.\n\n## Use Cases\n\nThis project is perfect for:\n\n- **Landing Pages**: Create database-driven landing pages with admin control\n- **Multi-language Websites**: Built-in support for Turkmen, English, and Russian\n- **Content Management**: Administrators can update content without code changes\n- **API-driven Frontends**: REST API for modern frontend frameworks\n- **Small Business Websites**: Simple admin panel for non-technical users\n\n**Legacy Notice**: This project was created in 2021 and uses some older dependencies. While fully functional, consider upgrading packages for production use. It serves as an excellent reference or starting point for similar projects.\n\n---\n\n## Support\n\nFor support and questions:\n- Create an issue on GitHub\n- Check the troubleshooting section\n- Review environment configuration\n\n**Good luck in development!** 🚀\n\n---","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmikebionic%2Flanding_admin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmikebionic%2Flanding_admin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmikebionic%2Flanding_admin/lists"}