Skip to content

Commit 8b141e6

Browse files
committed
Initial commit
0 parents  commit 8b141e6

File tree

102 files changed

+9074
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

102 files changed

+9074
-0
lines changed

.dockerignore

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
.env
2+
.eslint
3+
.flake8
4+
.git
5+
.gitignore
6+
*.md
7+
*.sample
8+
db.sqlite3
9+
docker-compose.yml
10+
Dockerfile
11+
LICENSE.md
12+
node_modules
13+
README.md
14+
samplefiles
15+
static

.editorconfig

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
indent_style = space
6+
indent_size = 2
7+
end_of_line = lf
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
11+
[*.py]
12+
indent_size = 4
13+
14+
[*.md]
15+
trim_trailing_whitespace = false
16+
indent_size = 4

.eslintrc

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"env": {
3+
"browser": true,
4+
"es6": true,
5+
"node": true
6+
},
7+
"extends": "eslint:recommended",
8+
"globals": {
9+
"Atomics": "readonly",
10+
"SharedArrayBuffer": "readonly"
11+
},
12+
"parserOptions": {
13+
"ecmaVersion": 2018,
14+
"sourceType": "module"
15+
},
16+
"rules": {
17+
"indent": ["error", 2],
18+
"linebreak-style": ["error", "unix"],
19+
"quotes": ["error", "double"],
20+
"semi": ["error", "always"]
21+
}
22+
}

.flake8

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[flake8]
2+
max-line-length = 88
3+
extend-ignore = E203

.gitignore

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
.env
2+
.venv
3+
db.sqlite3
4+
db.sqlite3-shm
5+
db.sqlite3-wal
6+
media
7+
node_modules
8+
static

.isort.cfg

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[settings]
2+
profile = black

Dockerfile

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# A dockerfile to run an analytics server
2+
#
3+
# Analytics can run very simply as long as we have a few basics:
4+
# - python w/ pipenv
5+
# - node w/ yarn
6+
# - sqlite3
7+
# - chromium
8+
9+
10+
FROM alpine:3.16
11+
12+
RUN apk add --update --no-cache \
13+
sqlite \
14+
python3 py3-pip \
15+
nodejs yarn \
16+
chromium libstdc++ nss harfbuzz freetype font-noto font-noto-extra font-noto-emoji && \
17+
pip install --upgrade pipenv
18+
19+
RUN addgroup -S -g 1000 app && \
20+
adduser -S -h /app -s /sbin/nologin -u 1000 -G app app && \
21+
chown -R app:app /app
22+
23+
WORKDIR /app
24+
25+
COPY Pipfile Pipfile.lock package.json yarn.lock /app/
26+
RUN yarn install && pipenv install --system
27+
28+
COPY . .
29+
30+
RUN yarn webpack:production && \
31+
rm -rf node_modules && \
32+
python3 manage.py collectstatic --noinput
33+
34+
USER app:app

LICENSE.md

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# The BSD 2-Clause License
2+
3+
Copyright (c) `2022`, `Isaac Bythewood`
4+
All rights reserved.
5+
6+
Redistribution and use in source and binary forms, with or without modification,
7+
are permitted provided that the following conditions are met:
8+
9+
1. Redistributions of source code must retain the above copyright notice,
10+
this list of conditions and the following disclaimer.
11+
12+
2. Redistributions in binary form must reproduce the above copyright notice,
13+
this list of conditions and the following disclaimer in the documentation
14+
and/or other materials provided with the distribution.
15+
16+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
17+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
20+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
22+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
23+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25+
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Pipfile

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
[[source]]
2+
url = "https://pypi.org/simple"
3+
verify_ssl = true
4+
name = "pypi"
5+
6+
[packages]
7+
django = "*"
8+
gunicorn = "*"
9+
requests = "*"
10+
tzdata = "*" # Fixes "zoneinfo._common.ZoneInfoNotFoundError" on docker server
11+
user-agents = "*"
12+
uvicorn = "*"
13+
whitenoise = "*"
14+
15+
[dev-packages]
16+
black = "*"
17+
flake8 = "*"
18+
isort = "*"
19+
20+
[requires]
21+
python_version = "3.10"

0 commit comments

Comments
 (0)