Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bring back to Django #16

Merged
merged 5 commits into from
Aug 25, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.sh text eol=lf
2 changes: 1 addition & 1 deletion .github/workflows/django_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
run: docker compose -f "docker-compose.yml" up -d --build

- name: Run Tests
run: docker compose exec backend python manage.py test
run: docker compose exec corpus python manage.py test

- name: Stop Containers
if: always()
Expand Down
6 changes: 1 addition & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,4 @@ cython_debug/
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
.idea/

# End of https://www.toptal.com/developers/gitignore/api/django

# Node Modules
node_modules/
.svelte-kit/
# End of https://www.toptal.com/developers/gitignore/api/django
1 change: 0 additions & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
python 3.11.1
nodejs 18.16.0
7 changes: 0 additions & 7 deletions backend/corpus/base_url.py

This file was deleted.

10 changes: 0 additions & 10 deletions backend/requirements.txt

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 1 addition & 2 deletions backend/corpus/settings.py → corpus/corpus/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
"django.contrib.sessions",
"django.contrib.messages",
"django.contrib.staticfiles",
"rest_framework",
]

MIDDLEWARE = [
Expand All @@ -52,7 +51,7 @@
"django.middleware.clickjacking.XFrameOptionsMiddleware",
]

ROOT_URLCONF = "corpus.base_url"
ROOT_URLCONF = "corpus.urls"

TEMPLATES = [
{
Expand Down
1 change: 0 additions & 1 deletion backend/corpus/urls.py → corpus/corpus/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,4 @@

urlpatterns = [
path("admin/", admin.site.urls),
path("api-auth/", include("rest_framework.urls")),
]
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 6 additions & 0 deletions corpus/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
asgiref==3.7.2
Django==4.2.4
gunicorn==21.2.0
packaging==23.1
psycopg2==2.9.7
sqlparse==0.4.4
File renamed without changes.
38 changes: 4 additions & 34 deletions dev-docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ services:
networks:
- corpus_network

backend:
corpus:
build:
context: backend
context: corpus
dockerfile: dev-Dockerfile
working_dir: /corpus
command: bash -c "python manage.py migrate && python manage.py runserver 0.0.0.0:8000"
Expand All @@ -41,48 +41,18 @@ services:
networks:
- corpus_network
volumes:
- ./backend:/corpus
- ./corpus:/corpus
depends_on:
postgres:
condition: service_healthy
env_file:
- .env

frontend:
image: node:18.16.0-alpine
working_dir: /app
restart: always
command: sh -c "npm install && npm run dev -- --port 3000"
networks:
- corpus_network
volumes:
- ./frontend:/app
depends_on:
postgres:
condition: service_healthy
expose:
- "3000"

storybook:
image: node:18.16.0-alpine
working_dir: /app
restart: always
command: sh -c "npm install && npm run storybook"
networks:
- corpus_network
volumes:
- ./frontend:/app
depends_on:
postgres:
condition: service_healthy
ports:
- "6006:6006"

nginx:
build: nginx
restart: always
depends_on:
- backend
- corpus
- postgres
networks:
- corpus_network
Expand Down
18 changes: 3 additions & 15 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ services:
networks:
- corpus_network

backend:
build: backend
corpus:
build: corpus
command: /corpus/start.sh
restart: always
expose:
Expand All @@ -45,23 +45,11 @@ services:
env_file:
- .env

frontend:
build: frontend
restart: always
command: node build
networks:
- corpus_network
depends_on:
postgres:
condition: service_healthy
expose:
- "3000"

nginx:
build: nginx
restart: always
depends_on:
- backend
- corpus
- postgres
networks:
- corpus_network
Expand Down
3 changes: 0 additions & 3 deletions frontend/.dockerignore

This file was deleted.

13 changes: 0 additions & 13 deletions frontend/.eslintignore

This file was deleted.

23 changes: 0 additions & 23 deletions frontend/.eslintrc.cjs

This file was deleted.

10 changes: 0 additions & 10 deletions frontend/.gitignore

This file was deleted.

2 changes: 0 additions & 2 deletions frontend/.npmrc

This file was deleted.

13 changes: 0 additions & 13 deletions frontend/.prettierignore

This file was deleted.

8 changes: 0 additions & 8 deletions frontend/.prettierrc

This file was deleted.

22 changes: 0 additions & 22 deletions frontend/.storybook/main.ts

This file was deleted.

16 changes: 0 additions & 16 deletions frontend/.storybook/preview.ts

This file was deleted.

7 changes: 0 additions & 7 deletions frontend/Dockerfile

This file was deleted.

38 changes: 0 additions & 38 deletions frontend/README.md

This file was deleted.

Loading