diff --git a/.env.dev b/.env.dev index e339b6f..988db25 100644 --- a/.env.dev +++ b/.env.dev @@ -1,2 +1,3 @@ COMPOSE_FILE=docker-compose.yml:docker-compose.dev.yml -COMPOSE_PROJECT_NAME=apivault \ No newline at end of file +COMPOSE_PROJECT_NAME=apivault +DEBUG=true \ No newline at end of file diff --git a/API_LIST.md b/API_LIST.md index fcfe80e..2e1016a 100644 --- a/API_LIST.md +++ b/API_LIST.md @@ -1240,6 +1240,7 @@ | [Judge0 CE](https://ce.judge0.com/) | Online code execution system | apiKey | True | unknown | | [KONTESTS](https://kontests.net/api) | For upcoming and ongoing competitive coding contests | | True | unknown | | [Mintlify](https://docs.mintlify.com) | For programmatically generating documentation for code | apiKey | True | yes | +| [Pythonium](https://pythonium.net/linter) | Python code validation | | True | no | # Science & Math @@ -1447,6 +1448,7 @@ | [Randommer](https://randommer.io/randommer-api) | Random data generator | apiKey | True | yes | | [RandomUser](https://randomuser.me) | Generates and list user data | | True | unknown | | [RoboHash](https://robohash.org/) | Generate random robot/alien avatars | | True | unknown | +| [Softwium](https://softwium.com/fake-api/) | APIs collection to get fake data | | True | no | | [Spanish random names](https://random-names-api.herokuapp.com/public) | Generate spanish names (with gender) randomly | | True | unknown | | [Spanish random words](https://palabras-aleatorias-public-api.herokuapp.com) | Generate spanish words randomly | | True | unknown | | [This Person Does not Exist](https://thispersondoesnotexist.com) | Generates real-life faces of people who do not exist | | True | unknown | diff --git a/backend/apivault/settings.py b/backend/apivault/settings.py index 6d9d7ac..e91f679 100644 --- a/backend/apivault/settings.py +++ b/backend/apivault/settings.py @@ -20,7 +20,8 @@ environ.Env.read_env() # Build paths inside the project like this: BASE_DIR / 'subdir'. -BASE_DIR = Path(__file__).resolve().parent.parent +BASE_DIR = Path(__file__).resolve(strict=True).parent.parent + MEDIA_ROOT = '' MEDIA_URL = '' @@ -31,7 +32,7 @@ SECRET_KEY = 'django-insecure-pnadu&92%d==xohx_27-z%is=nb7c&s!ph7#1r$i0d#oxttgh5' # SECURITY WARNING: don't run with debug turned on in production! -DEBUG = False +DEBUG = env('DEBUG') ALLOWED_HOSTS = ['*'] @@ -205,8 +206,9 @@ # Static files (CSS, JavaScript, Images) # https://docs.djangoproject.com/en/4.1/howto/static-files/ -STATIC_URL = 'static/' -STATIC_ROOT = os.path.join(BASE_DIR, 'static') +STATIC_URL = '/static/' + +STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles') @@ -224,3 +226,6 @@ AUTHENTICATION_BACKENDS = ( 'django.contrib.auth.backends.ModelBackend', ) + +CSRF_TRUSTED_ORIGINS = ['https://*.apivault.dev', 'http://localhost'] + diff --git a/backend/apivault/urls.py b/backend/apivault/urls.py index e99f163..c0ea56c 100644 --- a/backend/apivault/urls.py +++ b/backend/apivault/urls.py @@ -1,5 +1,5 @@ """apivault URL Configuration""" -from drf_spectacular.views import SpectacularSwaggerView +from drf_spectacular.views import SpectacularAPIView, SpectacularSwaggerView from django.conf.urls.static import static from django.contrib import admin from django.conf import settings @@ -16,7 +16,6 @@ path('api/interaction', include('interaction.urls')), #documentation + path('api/schema/', SpectacularAPIView.as_view(), name='schema'), path('api/schema/swagger-ui/', SpectacularSwaggerView.as_view(url_name='schema'), name='swagger-ui'), -] - -urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) \ No newline at end of file +] + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT) diff --git a/backend/docker-compose.yml b/backend/docker-compose.yml index 8e1946a..010691d 100644 --- a/backend/docker-compose.yml +++ b/backend/docker-compose.yml @@ -34,7 +34,7 @@ services: - DB_USER=apivault - DB_PASSWORD=apivault - DB_PORT=5432 - - DEBUG=true + - DEBUG=${DEBUG} depends_on: - db_postgis_apivault volumes: diff --git a/backend/interaction/urls.py b/backend/interaction/urls.py index 53eb6fd..f10d78a 100644 --- a/backend/interaction/urls.py +++ b/backend/interaction/urls.py @@ -2,6 +2,6 @@ from .api import LikeAPIView, FeedbackView urlpatterns = [ - path('/like//', LikeAPIView.as_view(), name='like-api'), - path('/feedback/', FeedbackView.as_view(), name='feedback') + path('/like/', LikeAPIView.as_view(), name='like-api'), + path('/feedback', FeedbackView.as_view(), name='feedback') ] diff --git a/backend/requirements.txt b/backend/requirements.txt index c8db569..7fa6672 100644 --- a/backend/requirements.txt +++ b/backend/requirements.txt @@ -9,7 +9,7 @@ charset-normalizer==3.1.0 click==8.1.3 click-plugins==1.1.1 cligj==0.7.2 -cryptography==41.0.3 +cryptography==41.0.4 dbus-python==1.2.16 defusedxml==0.7.1 distro-info===0.23ubuntu1 @@ -67,5 +67,5 @@ sqlparse==0.4.4 typing-extensions==4.6.3 unattended-upgrades==0.1 uritemplate==4.1.1 -urllib3==1.26.5 +urllib3==1.26.17 zipp==3.16.2 diff --git a/backend/vault/urls.py b/backend/vault/urls.py index 26a0ced..fd15304 100644 --- a/backend/vault/urls.py +++ b/backend/vault/urls.py @@ -14,18 +14,18 @@ ) urlpatterns = [ - path('detail//', APIDetailView.as_view(), name='api_detail'), + path('detail/', APIDetailView.as_view(), name='api_detail'), path('search', APISearchView.as_view(), name='api_search'), - path('random/', RandomAPIListView.as_view()), - path('create/', APICreateView.as_view()), - path('count/', APICountView.as_view()), - path('all/', APIListView.as_view()), + path('random', RandomAPIListView.as_view()), + path('create', APICreateView.as_view()), + path('count', APICountView.as_view()), + path('all', APIListView.as_view()), - path('my_api/', MyApiView.as_view()), - path('pending/my_api/', MyPendingApiView.as_view()), + path('my_api', MyApiView.as_view()), + path('pending/my_api', MyPendingApiView.as_view()), - path('category//', CategoryAPIListView.as_view()), - path('categories/trending/', TrendingCategoriesView.as_view()), - path('categories/', AllCategoryAPIListView.as_view()), + path('category/', CategoryAPIListView.as_view()), + path('categories/trending', TrendingCategoriesView.as_view()), + path('categories', AllCategoryAPIListView.as_view()), ] \ No newline at end of file diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml index 55bb29c..ccd1258 100644 --- a/docker-compose.dev.yml +++ b/docker-compose.dev.yml @@ -34,7 +34,7 @@ services: - DB_USER=apivault - DB_PASSWORD=apivault - DB_PORT=5432 - - DEBUG=true + - DEBUG=${DEBUG} command: sh -c "python3 backend/docker/command/start_server.py" networks: apivault-network: diff --git a/frontend/.gitignore b/frontend/.gitignore index 9e65000..3296cae 100644 --- a/frontend/.gitignore +++ b/frontend/.gitignore @@ -25,6 +25,9 @@ dist-ssr env .env +# Static files +backend/staticfiles/ + # Editor directories and files .vscode/* !.vscode/extensions.json diff --git a/frontend/.prettierrc b/frontend/.prettierrc new file mode 100644 index 0000000..3c9a31e --- /dev/null +++ b/frontend/.prettierrc @@ -0,0 +1,6 @@ +{ + "tabWidth": 4, + "useTabs": false, + "semi": false, + "singleQuote": true +} \ No newline at end of file diff --git a/frontend/components/Footer.vue b/frontend/components/Footer.vue index f347196..6e4b429 100644 --- a/frontend/components/Footer.vue +++ b/frontend/components/Footer.vue @@ -1,125 +1,125 @@ diff --git a/frontend/components/Sidebar.vue b/frontend/components/Sidebar.vue index 4f84ff4..9c96f9d 100644 --- a/frontend/components/Sidebar.vue +++ b/frontend/components/Sidebar.vue @@ -1,231 +1,250 @@ diff --git a/frontend/components/badges/CodeishotBadge.vue b/frontend/components/badges/CodeishotBadge.vue new file mode 100644 index 0000000..5576a00 --- /dev/null +++ b/frontend/components/badges/CodeishotBadge.vue @@ -0,0 +1,113 @@ + + + + + diff --git a/frontend/components/generics/Modal.vue b/frontend/components/generics/Modal.vue index f1a8e37..de4c003 100644 --- a/frontend/components/generics/Modal.vue +++ b/frontend/components/generics/Modal.vue @@ -7,7 +7,7 @@ aria-hidden="true" >