irongit

first commit

huncholanehuncholaneauthored
parent bdbf7bdcommit 72aa1d7e88dd4188cc704b4aa8e493a584747c0eBrowse files

31 files changed, +544 -0

+160-0backend/.gitignore
@@ -0,0 +1,160 @@
1+# Byte-compiled / optimized / DLL files
2+__pycache__/
3+*.py[cod]
4+*$py.class
5+
6+# C extensions
7+*.so
8+
9+# Distribution / packaging
10+.Python
11+build/
12+develop-eggs/
13+dist/
14+downloads/
15+eggs/
16+.eggs/
17+lib/
18+lib64/
19+parts/
20+sdist/
21+var/
22+wheels/
23+share/python-wheels/
24+*.egg-info/
25+.installed.cfg
26+*.egg
27+MANIFEST
28+
29+# PyInstaller
30+# Usually these files are written by a python script from a template
31+# before PyInstaller builds the exe, so as to inject date/other infos into it.
32+*.manifest
33+*.spec
34+
35+# Installer logs
36+pip-log.txt
37+pip-delete-this-directory.txt
38+
39+# Unit test / coverage reports
40+htmlcov/
41+.tox/
42+.nox/
43+.coverage
44+.coverage.*
45+.cache
46+nosetests.xml
47+coverage.xml
48+*.cover
49+*.py,cover
50+.hypothesis/
51+.pytest_cache/
52+cover/
53+
54+# Translations
55+*.mo
56+*.pot
57+
58+# Django stuff:
59+*.log
60+local_settings.py
61+db.sqlite3
62+db.sqlite3-journal
63+
64+# Flask stuff:
65+instance/
66+.webassets-cache
67+
68+# Scrapy stuff:
69+.scrapy
70+
71+# Sphinx documentation
72+docs/_build/
73+
74+# PyBuilder
75+.pybuilder/
76+target/
77+
78+# Jupyter Notebook
79+.ipynb_checkpoints
80+
81+# IPython
82+profile_default/
83+ipython_config.py
84+
85+# pyenv
86+# For a library or package, you might want to ignore these files since the code is
87+# intended to run in multiple environments; otherwise, check them in:
88+# .python-version
89+
90+# pipenv
91+# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92+# However, in case of collaboration, if having platform-specific dependencies or dependencies
93+# having no cross-platform support, pipenv may install dependencies that don't work, or not
94+# install all needed dependencies.
95+#Pipfile.lock
96+
97+# poetry
98+# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
99+# This is especially recommended for binary packages to ensure reproducibility, and is more
100+# commonly ignored for libraries.
101+# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
102+#poetry.lock
103+
104+# pdm
105+# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
106+#pdm.lock
107+# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
108+# in version control.
109+# https://pdm.fming.dev/#use-with-ide
110+.pdm.toml
111+
112+# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
113+__pypackages__/
114+
115+# Celery stuff
116+celerybeat-schedule
117+celerybeat.pid
118+
119+# SageMath parsed files
120+*.sage.py
121+
122+# Environments
123+.env
124+.venv
125+env/
126+venv/
127+ENV/
128+env.bak/
129+venv.bak/
130+
131+# Spyder project settings
132+.spyderproject
133+.spyproject
134+
135+# Rope project settings
136+.ropeproject
137+
138+# mkdocs documentation
139+/site
140+
141+# mypy
142+.mypy_cache/
143+.dmypy.json
144+dmypy.json
145+
146+# Pyre type checker
147+.pyre/
148+
149+# pytype static type analyzer
150+.pytype/
151+
152+# Cython debug symbols
153+cython_debug/
154+
155+# PyCharm
156+# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
157+# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
158+# and can be added to the global gitignore or merged into this file. For a more nuclear
159+# option (not recommended) you can uncomment the following to ignore the entire idea folder.
160+#.idea/
+8-0backend/Dockerfile
@@ -0,0 +1,8 @@
1+# syntax=docker/dockerfile:1
2+FROM python:3
3+ENV PYTHONDONTWRITEBYTECODE=1
4+ENV PYTHONUNBUFFERED=1
5+WORKDIR /backend
6+COPY requirements.txt /backend/
7+RUN pip install -r requirements.txt
8+COPY . /backend/
+0-0backend/backend/__init__.py

No content changes (mode or rename only).

+16-0backend/backend/asgi.py
@@ -0,0 +1,16 @@
1+"""
2+ASGI config for backend project.
3+
4+It exposes the ASGI callable as a module-level variable named ``application``.
5+
6+For more information on this file, see
7+https://docs.djangoproject.com/en/4.1/howto/deployment/asgi/
8+"""
9+
10+import os
11+
12+from django.core.asgi import get_asgi_application
13+
14+os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'backend.settings')
15+
16+application = get_asgi_application()
+123-0backend/backend/settings.py
@@ -0,0 +1,123 @@
1+"""
2+Django settings for backend project.
3+
4+Generated by 'django-admin startproject' using Django 4.1.3.
5+
6+For more information on this file, see
7+https://docs.djangoproject.com/en/4.1/topics/settings/
8+
9+For the full list of settings and their values, see
10+https://docs.djangoproject.com/en/4.1/ref/settings/
11+"""
12+
13+from pathlib import Path
14+
15+# Build paths inside the project like this: BASE_DIR / 'subdir'.
16+BASE_DIR = Path(__file__).resolve().parent.parent
17+
18+
19+# Quick-start development settings - unsuitable for production
20+# See https://docs.djangoproject.com/en/4.1/howto/deployment/checklist/
21+
22+# SECURITY WARNING: keep the secret key used in production secret!
23+SECRET_KEY = 'django-insecure-nz+u!v6^^m*((dfh-56&kpvrxdg9l^j+z*)m@-%%f#a$32q^%l'
24+
25+# SECURITY WARNING: don't run with debug turned on in production!
26+DEBUG = True
27+
28+ALLOWED_HOSTS = ['backend']
29+
30+
31+# Application definition
32+
33+INSTALLED_APPS = [
34+ 'django.contrib.admin',
35+ 'django.contrib.auth',
36+ 'django.contrib.contenttypes',
37+ 'django.contrib.sessions',
38+ 'django.contrib.messages',
39+ 'django.contrib.staticfiles',
40+]
41+
42+MIDDLEWARE = [
43+ 'django.middleware.security.SecurityMiddleware',
44+ 'django.contrib.sessions.middleware.SessionMiddleware',
45+ 'django.middleware.common.CommonMiddleware',
46+ 'django.middleware.csrf.CsrfViewMiddleware',
47+ 'django.contrib.auth.middleware.AuthenticationMiddleware',
48+ 'django.contrib.messages.middleware.MessageMiddleware',
49+ 'django.middleware.clickjacking.XFrameOptionsMiddleware',
50+]
51+
52+ROOT_URLCONF = 'backend.urls'
53+
54+TEMPLATES = [
55+ {
56+ 'BACKEND': 'django.template.backends.django.DjangoTemplates',
57+ 'DIRS': [],
58+ 'APP_DIRS': True,
59+ 'OPTIONS': {
60+ 'context_processors': [
61+ 'django.template.context_processors.debug',
62+ 'django.template.context_processors.request',
63+ 'django.contrib.auth.context_processors.auth',
64+ 'django.contrib.messages.context_processors.messages',
65+ ],
66+ },
67+ },
68+]
69+
70+WSGI_APPLICATION = 'backend.wsgi.application'
71+
72+
73+# Database
74+# https://docs.djangoproject.com/en/4.1/ref/settings/#databases
75+
76+DATABASES = {
77+ 'default': {
78+ 'ENGINE': 'django.db.backends.sqlite3',
79+ 'NAME': BASE_DIR / 'db.sqlite3',
80+ }
81+}
82+
83+
84+# Password validation
85+# https://docs.djangoproject.com/en/4.1/ref/settings/#auth-password-validators
86+
87+AUTH_PASSWORD_VALIDATORS = [
88+ {
89+ 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
90+ },
91+ {
92+ 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
93+ },
94+ {
95+ 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
96+ },
97+ {
98+ 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
99+ },
100+]
101+
102+
103+# Internationalization
104+# https://docs.djangoproject.com/en/4.1/topics/i18n/
105+
106+LANGUAGE_CODE = 'en-us'
107+
108+TIME_ZONE = 'UTC'
109+
110+USE_I18N = True
111+
112+USE_TZ = True
113+
114+
115+# Static files (CSS, JavaScript, Images)
116+# https://docs.djangoproject.com/en/4.1/howto/static-files/
117+
118+STATIC_URL = 'static/'
119+
120+# Default primary key field type
121+# https://docs.djangoproject.com/en/4.1/ref/settings/#default-auto-field
122+
123+DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
+21-0backend/backend/urls.py
@@ -0,0 +1,21 @@
1+"""backend URL Configuration
2+
3+The `urlpatterns` list routes URLs to views. For more information please see:
4+ https://docs.djangoproject.com/en/4.1/topics/http/urls/
5+Examples:
6+Function views
7+ 1. Add an import: from my_app import views
8+ 2. Add a URL to urlpatterns: path('', views.home, name='home')
9+Class-based views
10+ 1. Add an import: from other_app.views import Home
11+ 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home')
12+Including another URLconf
13+ 1. Import the include() function: from django.urls import include, path
14+ 2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
15+"""
16+from django.contrib import admin
17+from django.urls import path
18+
19+urlpatterns = [
20+ path('admin/', admin.site.urls),
21+]
+16-0backend/backend/wsgi.py
@@ -0,0 +1,16 @@
1+"""
2+WSGI config for backend project.
3+
4+It exposes the WSGI callable as a module-level variable named ``application``.
5+
6+For more information on this file, see
7+https://docs.djangoproject.com/en/4.1/howto/deployment/wsgi/
8+"""
9+
10+import os
11+
12+from django.core.wsgi import get_wsgi_application
13+
14+os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'backend.settings')
15+
16+application = get_wsgi_application()
+22-0backend/manage.py
@@ -0,0 +1,22 @@
1+#!/usr/bin/env python
2+"""Django's command-line utility for administrative tasks."""
3+import os
4+import sys
5+
6+
7+def main():
8+ """Run administrative tasks."""
9+ os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'backend.settings')
10+ try:
11+ from django.core.management import execute_from_command_line
12+ except ImportError as exc:
13+ raise ImportError(
14+ "Couldn't import Django. Are you sure it's installed and "
15+ "available on your PYTHONPATH environment variable? Did you "
16+ "forget to activate a virtual environment?"
17+ ) from exc
18+ execute_from_command_line(sys.argv)
19+
20+
21+if __name__ == '__main__':
22+ main()
+2-0backend/requirements.txt
@@ -0,0 +1,2 @@
1+Django>=3.0,<4.0
2+psycopg2>=2.8
+19-0docker-compose.yml
@@ -0,0 +1,19 @@
1+services:
2+ nginx:
3+ image: nginx:1.22.1-alpine
4+ container_name: nginx
5+ ports:
6+ - "80:80"
7+ volumes:
8+ - ./nginx/nginx.conf:/etc/nginx/nginx.conf
9+
10+ backend:
11+ build: backend
12+ command: python manage.py runserver 0:8000
13+ volumes:
14+ - ./backend:/backend
15+ frontend:
16+ build: frontend
17+ command: npm start
18+ volumes:
19+ - ./frontend:/frontend
+0-0.gitignore → frontend/.gitignore

No content changes (mode or rename only).

+5-0frontend/Dockerfile
@@ -0,0 +1,5 @@
1+FROM node:18-alpine
2+WORKDIR /frontend
3+COPY package.json /frontend/
4+RUN npm install
5+COPY . /frontend/
+0-0README.md → frontend/README.md

No content changes (mode or rename only).

+0-0package-lock.json → frontend/package-lock.json

No content changes (mode or rename only).

+0-0package.json → frontend/package.json

No content changes (mode or rename only).

+0-0public/favicon.ico → frontend/public/favicon.ico

No content changes (mode or rename only).

+0-0public/index.html → frontend/public/index.html

No content changes (mode or rename only).

+0-0public/logo192.png → frontend/public/logo192.png

No content changes (mode or rename only).

+0-0public/logo512.png → frontend/public/logo512.png

No content changes (mode or rename only).

+0-0public/manifest.json → frontend/public/manifest.json

No content changes (mode or rename only).

+0-0public/robots.txt → frontend/public/robots.txt

No content changes (mode or rename only).

+0-0src/App.css → frontend/src/App.css

No content changes (mode or rename only).

+0-0src/App.js → frontend/src/App.js

No content changes (mode or rename only).

+0-0src/App.test.js → frontend/src/App.test.js

No content changes (mode or rename only).

+0-0src/index.css → frontend/src/index.css

No content changes (mode or rename only).

+0-0src/index.js → frontend/src/index.js

No content changes (mode or rename only).

+0-0src/logo.svg → frontend/src/logo.svg

No content changes (mode or rename only).

+0-0src/reportWebVitals.js → frontend/src/reportWebVitals.js

No content changes (mode or rename only).

+0-0src/setupTests.js → frontend/src/setupTests.js

No content changes (mode or rename only).

+135-0nginx/mime.types
@@ -0,0 +1,135 @@
1+types {
2+
3+ # Data interchange
4+
5+ application/atom+xml atom;
6+ application/json json map topojson;
7+ application/ld+json jsonld;
8+ application/rss+xml rss;
9+ application/vnd.geo+json geojson;
10+ application/xml rdf xml;
11+
12+
13+ # JavaScript
14+
15+ # Normalize to standard type.
16+ # https://tools.ietf.org/html/rfc4329#section-7.2
17+ application/javascript js;
18+
19+
20+ # Manifest files
21+
22+ application/manifest+json webmanifest;
23+ application/x-web-app-manifest+json webapp;
24+ text/cache-manifest appcache;
25+
26+
27+ # Media files
28+
29+ audio/midi mid midi kar;
30+ audio/mp4 aac f4a f4b m4a;
31+ audio/mpeg mp3;
32+ audio/ogg oga ogg opus;
33+ audio/x-realaudio ra;
34+ audio/x-wav wav;
35+ image/bmp bmp;
36+ image/gif gif;
37+ image/jpeg jpeg jpg;
38+ image/png png;
39+ image/svg+xml svg svgz;
40+ image/tiff tif tiff;
41+ image/vnd.wap.wbmp wbmp;
42+ image/webp webp;
43+ image/x-jng jng;
44+ video/3gpp 3gpp 3gp;
45+ video/mp4 f4v f4p m4v mp4;
46+ video/mpeg mpeg mpg;
47+ video/ogg ogv;
48+ video/quicktime mov;
49+ video/webm webm;
50+ video/x-flv flv;
51+ video/x-mng mng;
52+ video/x-ms-asf asx asf;
53+ video/x-ms-wmv wmv;
54+ video/x-msvideo avi;
55+
56+ # Serving `.ico` image files with a different media type
57+ # prevents Internet Explorer from displaying then as images:
58+ # https://github.com/h5bp/html5-boilerplate/commit/37b5fec090d00f38de64b591bcddcb205aadf8ee
59+
60+ image/x-icon cur ico;
61+
62+
63+ # Microsoft Office
64+
65+ application/msword doc;
66+ application/vnd.ms-excel xls;
67+ application/vnd.ms-powerpoint ppt;
68+ application/vnd.openxmlformats-officedocument.wordprocessingml.document docx;
69+ application/vnd.openxmlformats-officedocument.spreadsheetml.sheet xlsx;
70+ application/vnd.openxmlformats-officedocument.presentationml.presentation pptx;
71+
72+
73+ # Web fonts
74+
75+ application/font-woff woff;
76+ application/font-woff2 woff2;
77+ application/vnd.ms-fontobject eot;
78+
79+ # Browsers usually ignore the font media types and simply sniff
80+ # the bytes to figure out the font type.
81+ # https://mimesniff.spec.whatwg.org/#matching-a-font-type-pattern
82+ #
83+ # However, Blink and WebKit based browsers will show a warning
84+ # in the console if the following font types are served with any
85+ # other media types.
86+
87+ application/x-font-ttf ttc ttf;
88+ font/opentype otf;
89+
90+
91+ # Other
92+
93+ application/java-archive jar war ear;
94+ application/mac-binhex40 hqx;
95+ application/octet-stream bin deb dll dmg exe img iso msi msm msp safariextz;
96+ application/pdf pdf;
97+ application/postscript ps eps ai;
98+ application/rtf rtf;
99+ application/vnd.google-earth.kml+xml kml;
100+ application/vnd.google-earth.kmz kmz;
101+ application/vnd.wap.wmlc wmlc;
102+ application/x-7z-compressed 7z;
103+ application/x-bb-appworld bbaw;
104+ application/x-bittorrent torrent;
105+ application/x-chrome-extension crx;
106+ application/x-cocoa cco;
107+ application/x-java-archive-diff jardiff;
108+ application/x-java-jnlp-file jnlp;
109+ application/x-makeself run;
110+ application/x-opera-extension oex;
111+ application/x-perl pl pm;
112+ application/x-pilot prc pdb;
113+ application/x-rar-compressed rar;
114+ application/x-redhat-package-manager rpm;
115+ application/x-sea sea;
116+ application/x-shockwave-flash swf;
117+ application/x-stuffit sit;
118+ application/x-tcl tcl tk;
119+ application/x-x509-ca-cert der pem crt;
120+ application/x-xpinstall xpi;
121+ application/xhtml+xml xhtml;
122+ application/xslt+xml xsl;
123+ application/zip zip;
124+ text/css css;
125+ text/html html htm shtml;
126+ text/mathml mml;
127+ text/plain txt;
128+ text/vcard vcard vcf;
129+ text/vnd.rim.location.xloc xloc;
130+ text/vnd.sun.j2me.app-descriptor jad;
131+ text/vnd.wap.wml wml;
132+ text/vtt vtt;
133+ text/x-component htc;
134+
135+}
+17-0nginx/nginx.conf
@@ -0,0 +1,17 @@
1+events {}
2+
3+http {
4+ include mime.types;
5+
6+ server {
7+ server_name backend.localhost;
8+ location / {
9+ proxy_pass http://backend:8000;
10+ }
11+ }
12+ server {
13+ location / {
14+ proxy_pass http://frontend:3000;
15+ }
16+ }
17+}