Skip to content

Commit

Permalink
first
Browse files Browse the repository at this point in the history
  • Loading branch information
Kishoraditya committed Jan 25, 2025
0 parents commit 2d1c4ac
Show file tree
Hide file tree
Showing 92 changed files with 2,814 additions and 0 deletions.
19 changes: 19 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Application
FLASK_APP=app.backend
FLASK_ENV=production
SECRET_KEY=replace_with_random_string
DOMAIN_NAME=coldplaymeetup.tk

# Security
JWT_SECRET_KEY=replace_with_random_string
RATE_LIMIT=100/minute

# Redis
REDIS_URL=redis://redis:6379/0

# Database
DATABASE_URL=sqlite:///db.sqlite3

# Monitoring
SENTRY_DSN=your_sentry_dsn
PROMETHEUS_TOKEN=your_token
21 changes: 21 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Deploy

on:
push:
branches: [ main ]

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Deploy to Oracle Cloud
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.SSH_KEY }}
script: |
cd /opt/coldplay-meetup
./scripts/deploy.sh
53 changes: 53 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: CI/CD Pipeline

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.9'

- name: Run Tests
run: |
pip install -r requirements.txt
pytest tests/ --cov=app
- name: Upload Coverage
uses: codecov/codecov-action@v2

security-scan:
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Run Security Scan
uses: snyk/actions/python@master
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}

deploy:
needs: [test, security-scan]
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- name: Deploy to Production
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.PROD_HOST }}
username: ${{ secrets.PROD_USERNAME }}
key: ${{ secrets.PROD_SSH_KEY }}
script: |
cd /opt/coldplay-meetup
git pull
docker-compose up -d --build
180 changes: 180 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,180 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# UV
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
#uv.lock

# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock

# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
#pdm.lock
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
# in version control.
# https://pdm.fming.dev/latest/usage/project/#working-with-version-control
.pdm.toml
.pdm-python
.pdm-build/

# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/

# PyCharm
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/

# Ruff stuff:
.ruff_cache/

# PyPI configuration file
.pypirc

temp/
awscliv2.zip
aws/
coldplay/
.env.free
117 changes: 117 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@

# Frontend

Tailwind CSS (styling)
Alpine.js (reactivity)
DaisyUI (UI components)
PWA capabilities
Backend:

Flask (web framework)
SQLite (database)
Redis (caching)
Gunicorn (WSGI server)
Nginx (reverse proxy)
Infrastructure:

Oracle Cloud Free Tier (VM)
Cloudflare (CDN & SSL)
Freenom (domain)
GitHub Actions (CI/CD)
Docker & Docker Compose
Certbot (SSL certificates)
Monitoring:

Prometheus (metrics)
Grafana (dashboards)
Sentry (error tracking)
Security:

JWT (authentication)
bcrypt (password hashing)
rate-limiter (DDoS protection)
CSP headers
ARCHITECTURE:
Client Request → Cloudflare → Nginx → Gunicorn → Flask App ↔ Redis Cache
↔ SQLite DB
↔ File Storage

coldplay-meetup/
├── .github/
│ └── workflows/
│ └── deploy.yml
├── app/
│ ├── backend/
│ │ ├── __init__.py
│ │ ├── auth/
│ │ ├── profiles/
│ │ ├── matches/
│ │ └── utils/
│ ├── frontend/
│ │ ├── static/
│ │ └── templates/
│ └── tests/
├── config/
│ ├── nginx.conf
│ ├── gunicorn.conf.py
│ └── prometheus.yml
├── docker/
│ ├── Dockerfile
│ └── docker-compose.yml
├── scripts/
│ ├── setup.sh
│ ├── deploy.sh
│ └── backup.sh
├── .env.example
├── requirements.txt
└── README.md

coldplay-meetup/
├── app/
│ ├── backend/
│ │ ├── __init__.py
│ │ ├── auth/
│ │ ├── profiles/
│ │ ├── matches/
│ │ └── utils/
│ ├── frontend/
│ │ ├── static/
│ │ │ ├── css/
│ │ │ ├── js/
│ │ │ └── images/
│ │ └── templates/
│ └── tests/
│ ├── conftest.py
│ ├── test_auth.py
│ ├── test_matches.py
│ ├── test_profiles.py
│ ├── test_security.py
│ └── performance/
│ ├── locustfile.py
│ └── benchmark.py
├── config/
│ ├── nginx.free.conf
│ ├── gunicorn_free.py
│ ├── prometheus/
│ │ └── alerts.yml
│ └── grafana/
│ └── dashboards/
├── docs/
│ ├── api_documentation.py
│ └── DEVELOPMENT.md
├── scripts/
│ ├── quick_deploy.sh
│ ├── free_deploy.sh
│ ├── backup_restore.sh
│ ├── cost_optimization.py
│ └── security_hardening.py
├── infrastructure/
│ └── terraform/
│ └── security.tf
├── .github/
│ └── workflows/
│ └── main.yml
├── docker-compose.free.yml
├── Dockerfile
├── requirements.txt
└── .env.free
Loading

0 comments on commit 2d1c4ac

Please sign in to comment.