├── theme ├── __init__.py ├── static_src │ ├── .gitignore │ ├── postcss.config.js │ ├── bs.config.js │ ├── src │ │ └── styles.css │ ├── package.json │ └── tailwind.config.js ├── apps.py ├── urls.py └── templates │ └── theme.html ├── memberships ├── __init__.py ├── tests │ ├── __init__.py │ ├── utils.py │ ├── test_login_form.py │ ├── test_member_model.py │ ├── test_stripe_gateway.py │ ├── test_stripe_webhooks.py │ └── test_registration_form.py ├── migrations │ ├── __init__.py │ ├── 0014_merge_20210421_1702.py │ ├── 0010_remove_member_profile_image.py │ ├── 0013_membership_payment_status.py │ ├── 0012_member_email_verified.py │ ├── 0004_auto_20200807_1947.py │ ├── 0002_member_stripe_customer_id.py │ ├── 0008_member_renewal_date.py │ ├── 0009_auto_20210323_1611.py │ ├── 0006_failedpayment.py │ ├── 0012_auto_20210413_1903.py │ ├── 0003_membership.py │ ├── 0001_initial.py │ ├── 0007_auto_20210125_0057.py │ ├── 0011_auto_20210330_2019.py │ └── 0005_auto_20201120_1445.py ├── templates │ ├── memberships │ │ ├── email_message.html │ │ ├── robots.txt │ │ ├── verify_email.html │ │ ├── logout.html │ │ ├── 404.html │ │ ├── verify_sent.html │ │ ├── home.html │ │ ├── verify_confirmation.html │ │ ├── humans.txt │ │ ├── welcome_email.html │ │ ├── confirm.html │ │ ├── member_details.html │ │ ├── member_settings.html │ │ ├── login.html │ │ └── register.html │ ├── inc │ │ ├── input_text.html │ │ ├── help_text.html │ │ └── logo.html │ └── base.html ├── apps.py ├── context_processors.py ├── tokens.py ├── email.py ├── urls.py ├── admin.py ├── services.py ├── tasks.py ├── static │ └── js │ │ └── main.js ├── payments.py ├── forms.py ├── models.py └── views.py ├── .github ├── ISSUE_TEMPLATE │ ├── config.yml │ ├── FEATURE-REQUEST.yml │ └── BUG-REPORT.yml ├── dependabot.yml ├── workflows │ ├── snyk.yaml │ ├── eisenhower.yml │ ├── take-action.yml │ └── black.yml ├── linters │ └── .htmlhintrc └── pull_request_template.md ├── gzweb-phone-dark.png ├── gzweb-phone-light.png ├── gzweb-desktop-dark.png ├── gzweb-desktop-light.png ├── .dockerignore ├── CONTRIBUTING.md ├── web ├── views.py ├── __init__.py ├── .env.dev ├── .env.example ├── asgi.py ├── celery.py ├── wsgi.py ├── urls.py └── settings.py ├── test-results └── readme.md ├── CODEOWNERS ├── docker ├── proxy │ ├── default.conf │ ├── Dockerfile │ └── nginx.conf ├── development │ └── Dockerfile └── backend │ └── Dockerfile ├── manage.py ├── stripe.sequence ├── requirements.txt ├── docker-compose.yml ├── docker-compose.dev.yml ├── funky_time.py ├── .gitignore ├── .circleci ├── config.yml.only-ci ├── config.yml.aws └── config.yml ├── erd.xml └── readme.md /theme/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /memberships/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /memberships/tests/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /memberships/migrations/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /theme/static_src/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | --- 2 | blank_issues_enabled: false 3 | -------------------------------------------------------------------------------- /gzweb-phone-dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GeekZoneHQ/web/HEAD/gzweb-phone-dark.png -------------------------------------------------------------------------------- /gzweb-phone-light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GeekZoneHQ/web/HEAD/gzweb-phone-light.png -------------------------------------------------------------------------------- /gzweb-desktop-dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GeekZoneHQ/web/HEAD/gzweb-desktop-dark.png -------------------------------------------------------------------------------- /gzweb-desktop-light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GeekZoneHQ/web/HEAD/gzweb-desktop-light.png -------------------------------------------------------------------------------- /.dockerignore: -------------------------------------------------------------------------------- 1 | # This prevents secrets from being copied to the image 2 | web/.env 3 | web/.env.dev 4 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | Please see [contributing](https://github.com/GeekZoneHQ/contributing). 4 | -------------------------------------------------------------------------------- /theme/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class ThemeConfig(AppConfig): 5 | name = "theme" 6 | -------------------------------------------------------------------------------- /memberships/templates/memberships/email_message.html: -------------------------------------------------------------------------------- 1 | Hello {{name|safe}}! 2 | 3 | {{body|safe}} 4 | 5 | Thanks! 6 | 7 | Geek.Zone -------------------------------------------------------------------------------- /web/views.py: -------------------------------------------------------------------------------- 1 | from django.contrib.auth import logout 2 | from django.shortcuts import redirect 3 | from django.urls import reverse 4 | -------------------------------------------------------------------------------- /memberships/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class MembershipsConfig(AppConfig): 5 | name = "memberships" 6 | -------------------------------------------------------------------------------- /memberships/templates/memberships/robots.txt: -------------------------------------------------------------------------------- 1 | # www.robotstxt.org/ 2 | 3 | # Allow crawling of all content 4 | User-agent: * 5 | Disallow: 6 | -------------------------------------------------------------------------------- /web/__init__.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import, unicode_literals 2 | from .celery import app as celery_app 3 | 4 | __all__ = ("celery_app",) 5 | -------------------------------------------------------------------------------- /test-results/readme.md: -------------------------------------------------------------------------------- 1 | This is where we store the results of our tests. Please see 2 | [CircleCI docs](https://circleci.com/docs/2.0/configuration-reference/#storetestresults). -------------------------------------------------------------------------------- /theme/urls.py: -------------------------------------------------------------------------------- 1 | from django.urls import path 2 | from django.views.generic import TemplateView 3 | 4 | urlpatterns = [path("", TemplateView.as_view(template_name="theme.html"))] 5 | -------------------------------------------------------------------------------- /memberships/templates/memberships/verify_email.html: -------------------------------------------------------------------------------- 1 | You are almost there! 2 | Please click the link below to verify your membership: 3 | http://{{ domain }}{% url 'verify' uidb64=uid token=token %} 4 | -------------------------------------------------------------------------------- /memberships/templates/memberships/logout.html: -------------------------------------------------------------------------------- 1 | {% extends "base.html" %} 2 | 3 | {% block content %} 4 |
Thanks for choosing Geek.Zone!
7 | {% endblock %} 8 | -------------------------------------------------------------------------------- /memberships/context_processors.py: -------------------------------------------------------------------------------- 1 | from web import settings 2 | 3 | 4 | def recaptcha_enabled(request): 5 | return { 6 | "recaptcha_enabled": settings.RECAPTCHA_SECRET_KEY 7 | and settings.RECAPTCHA_SITE_KEY, 8 | } 9 | -------------------------------------------------------------------------------- /theme/static_src/postcss.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | plugins: { 3 | "postcss-import": {}, 4 | "postcss-simple-vars": {}, 5 | "postcss-nested": {}, 6 | tailwindcss: {}, 7 | autoprefixer: {}, 8 | }, 9 | } 10 | -------------------------------------------------------------------------------- /web/.env.dev: -------------------------------------------------------------------------------- 1 | DATABASE_USER=postgres 2 | DATABASE_NAME=postgres 3 | DATABASE_HOST=db 4 | DATABASE_PASSWORD=password 5 | DATABASE_PORT=5432 6 | CELERY_BROKER_URL=amqp://@rabbitmq 7 | TEST_USER_PASSWORD=k38m1KIhIUzeA^UL 8 | TEST_USER_PASSWORD_BAD=password -------------------------------------------------------------------------------- /memberships/templates/memberships/404.html: -------------------------------------------------------------------------------- 1 | {% extends "base.html" %} 2 | 3 | {% block content %} 4 |Sorry, but the page you were trying to view does not exist.
7 | {% endblock %} 8 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: pip 4 | directory: "/" 5 | schedule: 6 | interval: daily 7 | open-pull-requests-limit: 10 8 | target-branch: master 9 | reviewers: 10 | - "carwynnelson" 11 | - "jamesgeddes" 12 | 13 | -------------------------------------------------------------------------------- /web/.env.example: -------------------------------------------------------------------------------- 1 | DEBUG=on 2 | ALLOWED_HOSTS=localhost 3 | DATABASE_URL=sqlite:/db.sqlite3 4 | STRIPE_SECRET_KEY=example_secret_key 5 | STRIPE_PUBLIC_KEY=example_public_key 6 | MEMBERSHIP_PRICE_ID=example_stripe_membership_price_id 7 | DONATION_PRODUCT_ID=example_annual_donation_product_id 8 | -------------------------------------------------------------------------------- /memberships/migrations/0014_merge_20210421_1702.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.1.7 on 2021-04-21 16:02 2 | 3 | from django.db import migrations 4 | 5 | 6 | class Migration(migrations.Migration): 7 | dependencies = [ 8 | ("memberships", "0012_member_email_verified"), 9 | ("memberships", "0013_membership_payment_status"), 10 | ] 11 | 12 | operations = [] 13 | -------------------------------------------------------------------------------- /memberships/templates/memberships/verify_sent.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | {% extends "base.html" %} 4 | {% block content %} 5 | 6 | 7 | 8 | 9 | 10 | 11 |This page will show the Geek.Zone member something interesting once they have logged in, or show a wiki page if the guest is not logged in.
7 | 8 |For now, you can edit your settings.
9 | {% endblock %} 10 | -------------------------------------------------------------------------------- /CODEOWNERS: -------------------------------------------------------------------------------- 1 | # Lines starting with '#' are comments. 2 | # Each line is a file pattern followed by one or more owners. 3 | 4 | # These owners will be the default owners for everything in the repo. 5 | * @GeekZoneHQ/q 6 | 7 | # Order is important. The last matching pattern has the most precedence. 8 | # So if a pull request only touches javascript files, only these owners 9 | # will be requested to review. 10 | 11 | 12 | # You can also use email addresses if you prefer. 13 | -------------------------------------------------------------------------------- /docker/proxy/default.conf: -------------------------------------------------------------------------------- 1 | server { 2 | listen 0.0.0.0:8080; #Need port 8080 to run container as user "nginx" 3 | 4 | location / { 5 | # this is localhost because gunicorn is 6 | # hosted in the same pod. 7 | proxy_pass http://localhost:8000; 8 | proxy_set_header Host $host; 9 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 10 | } 11 | 12 | location /static { 13 | alias /var/www/static/; 14 | } 15 | } 16 | 17 | -------------------------------------------------------------------------------- /memberships/templates/memberships/verify_confirmation.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | {% extends "base.html" %} 4 | {% block content %} 5 | 6 | 7 | 8 | 9 | 10 | 11 |Your membership will cost £{{total}} a year
7 | 8 |9 | {% if donation %} 10 | This is made up of a £1 membership charge and a £{{donation}} donation 11 | {% else %} 12 | This is made up of a £1 membership charge with no donation 13 | {% endif %} 14 |
15 | 16 | 17 | 18 | 19 | 30 | {% endblock %} 31 | -------------------------------------------------------------------------------- /theme/static_src/src/styles.css: -------------------------------------------------------------------------------- 1 | @tailwind base; 2 | @tailwind components; 3 | @tailwind utilities; 4 | 5 | @layer base { 6 | .btn { 7 | @apply appearance-none py-2 px-4 text-sm text-gray-900 bg-yellow-300 hover:bg-yellow-400 border-none shadow rounded-sm active:shadow-inner focus:ring-2 focus:ring-red-500 outline-none cursor-pointer; 8 | } 9 | .field-error { 10 | @apply text-red-600 dark:text-red-400; 11 | } 12 | .header { 13 | @apply text-xl font-semibold; 14 | } 15 | .input:not(input[type="checkbox"]) { 16 | @apply appearance-none bg-gray-100 dark:bg-gray-700 text-gray-800 dark:text-gray-200 border border-gray-400 focus:ring-1 focus:ring-yellow-300 focus:border-yellow-300 outline-none; 17 | } 18 | .input-error:not(input[type="checkbox"]) { 19 | @apply border-red-400 ring-1 ring-red-500 outline-none; 20 | } 21 | .link { 22 | @apply text-blue-700 dark:text-blue-300 hover:underline; 23 | } 24 | .nav-link { 25 | @apply inline-block py-1 px-2 w-full text-center hover:bg-yellow-200 dark:hover:bg-gray-800 rounded; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /memberships/urls.py: -------------------------------------------------------------------------------- 1 | from django.urls import path 2 | from . import views 3 | from django.contrib.auth.views import * 4 | from django.urls import path, include 5 | 6 | urlpatterns = [ 7 | path("register/", views.register, name="register"), 8 | path("confirm/", views.confirm, name="confirm"), 9 | path("thanks/", views.thanks, name="thanks"), 10 | path("stripe-webhook/", views.stripe_webhook, name="stripe_webhook"), 11 | path("settings/", views.settings_view, name="memberships_settings"), 12 | path("details/", views.details_view, name="memberships_details"), 13 | path("verify", views.sendVerification, name="send_verification"), 14 | path("verify/28 | Will you complete this quest to achieve geeky greatness? 29 | Epic adventurers use a password manager! 30 |
31 | 32 |33 | Membership costs £1 plus the suggested donation of £30 per year. 34 |
35 | 36 | 73 |