Skip to content

Commit

Permalink
Merge pull request #172 from AnimalFoodBank/delano/20240627-update-deps
Browse files Browse the repository at this point in the history
Maintenance - Deps update (pnpm & poetry)
  • Loading branch information
delano authored Jun 27, 2024
2 parents 594ce26 + 1f237e4 commit 1833dc0
Show file tree
Hide file tree
Showing 10 changed files with 2,785 additions and 2,708 deletions.
137 changes: 82 additions & 55 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,92 @@
## UI



### Nuxt.js 3 (Vue 3)

https://nuxtjs.org/docs/3.x/get-started/installation

Nuxt.js is a framework for building server-side rendered (SSR) applications with Vue.js. It is a powerful tool for building SEO-friendly, fast, and scalable web applications. Nuxt.js 3 is the latest version of the framework and it is built on top of Vue 3.


### Vueform


https://vueform.com/docs/getting-started


## API

### Django Rest Framework (DRF)

[Django 5.1](https://docs.djangoproject.com/en/5.1/)

https://www.django-rest-framework.org/


### PostgreSQL 15

[PostgreSQL 15](https://www.postgresql.org/docs/15/index.html)


## Deployment


### Gunicorn


[Gunicorn Deployment docs](https://docs.gunicorn.org/en/latest/deploy.html)



### Caddy Server

https://caddyserver.com/docs/getting-started

Caddy is a powerful, enterprise-ready, open source web server with automatic HTTPS written in Go. It is a production-ready server that is easy to use, configure, and extend.

We use Caddy as a reverse proxy to serve the Django application and the Vue.js frontend. It also handles the automatic HTTPS certificate generation and renewal. Configuration is simple and straightforward. Here is an example of a Caddyfile:

```caddy
example.com {
reverse_proxy
{
to localhost:8000
}
}
```

This configuration will automatically generate an HTTPS certificate for example.com and proxy all requests to the Django application running on port 8000.



## Dev tools


### Email Server (from cookiecutter-django)

In development, it is often nice to be able to see emails that are being sent from your application. If you choose to use [Mailpit](https://github.com/axllent/mailpit) when generating the project a local SMTP server with a web interface will be available.

1. [Download the latest Mailpit release](https://github.com/axllent/mailpit/releases) for your OS.

2. Copy the binary file to the project root.

3. Make it executable:

```bash
$ chmod +x mailpit
```

4. Spin up another terminal window and start it there:

```bash
./mailpit
```

5. Check out http://127.0.0.1:8025/ to see how it goes.


### Mailpit
#### Mailpit

Send emails from your Django application in development without sending them to real email addresses. Mailpit is a local SMTP server with a web interface that allows you to view emails sent from your application.

Expand Down Expand Up @@ -169,64 +250,10 @@ https://github.com/unfoldadmin/django-unfold#installation
```


## Links nov 19

https://httptoolkit.com/blog/how-to-debug-cors-errors/


### Email Server (from cookiecutter-django)

In development, it is often nice to be able to see emails that are being sent from your application. If you choose to use [Mailpit](https://github.com/axllent/mailpit) when generating the project a local SMTP server with a web interface will be available.

1. [Download the latest Mailpit release](https://github.com/axllent/mailpit/releases) for your OS.

2. Copy the binary file to the project root.

3. Make it executable:

```bash
$ chmod +x mailpit
```

4. Spin up another terminal window and start it there:

```bash
./mailpit
```

5. Check out http://127.0.0.1:8025/ to see how it goes.



### Django Unfold Admin

https://

The Django Unfold Admin is a modern Django admin theme that uses the latest technologies. It is a drop-in replacement for Django's built-in admin interface.


### Caddy Server

https://caddyserver.com/docs/getting-started

Caddy is a powerful, enterprise-ready, open source web server with automatic HTTPS written in Go. It is a production-ready server that is easy to use, configure, and extend.

We use Caddy as a reverse proxy to serve the Django application and the Vue.js frontend. It also handles the automatic HTTPS certificate generation and renewal. Configuration is simple and straightforward. Here is an example of a Caddyfile:

```caddy
example.com {
reverse_proxy
{
to localhost:8000
}
}
```

This configuration will automatically generate an HTTPS certificate for example.com and proxy all requests to the Django application running on port 8000.


### Nuxt.js 3 (Vue 3)

https://nuxtjs.org/docs/3.x/get-started/installation

Nuxt.js is a framework for building server-side rendered (SSR) applications with Vue.js. It is a powerful tool for building SEO-friendly, fast, and scalable web applications. Nuxt.js 3 is the latest version of the framework and it is built on top of Vue 3.
10 changes: 9 additions & 1 deletion apps/api/afbcore/views/authtoken.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import logging

from rest_framework import status
from rest_framework.generics import GenericAPIView
from rest_framework.permissions import IsAuthenticated
Expand All @@ -15,6 +17,8 @@
# valid and (currently) can be used N times until they expire.
# See: PASSWORDLESS_TOKEN_EXPIRE_TIME in settings.py.

logger = logging.getLogger(__name__)


class LogoutView(GenericAPIView):
permission_classes = [IsAuthenticated]
Expand All @@ -25,6 +29,10 @@ def post(self, request, version=None):
request.user.auth_token.delete()
return Response(status=status.HTTP_200_OK)
except Exception as e:
logger.error(
f"Error logging out user: {request.user.id} - {str(e)}"
)
return Response(
data={"detail": str(e)}, status=status.HTTP_400_BAD_REQUEST
data={"detail": "Server error"},
status=status.HTTP_400_BAD_REQUEST,
)
2 changes: 1 addition & 1 deletion apps/ui/pages/contact.vue
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@
const validateEmail = (email: string) => {
return (/^\w{1,128}([\.-\\+]?\w{1,128}){1,3}@\w{1,128}([\.-]?\w{1,128}){1,2}(\.\w{2,3})+$/.test(email))
return (/^\w{1,128}([\.-\\+]?\w{1,128}){1,3}@\w{1,128}([\.-]?\w{1,128}){1,2}(\.\w{2,8}){1,2}$/.test(email))
}
const validate = (state: any): FormError[] => {
Expand Down
2 changes: 1 addition & 1 deletion apps/ui/pages/login/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const fields = [


const validateEmail = (email: string) => {
return (/^\w{1,128}([\.-\\+]?\w{1,128}){1,3}@\w{1,128}([\.-]?\w{1,128}){1,2}(\.\w{2,3})+$/.test(email))
return (/^\w{1,128}([\.-\\+]?\w{1,128}){1,3}@\w{1,128}([\.-]?\w{1,128}){1,2}(\.\w{2,8}){1,2}$/.test(email))
}

const validate = (state: any): FormError[] => {
Expand Down
2 changes: 1 addition & 1 deletion apps/ui/pages/welcome/clients.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const email = route.query.email as string;
const fields = ref<any>([]);
const validateEmail = (email: string) => {
return (/^\w{1,128}([\.-\\+]?\w{1,128}){1,3}@\w{1,128}([\.-]?\w{1,128}){1,2}(\.\w{2,3})+$/.test(email))
return (/^\w{1,128}([\.-\\+]?\w{1,128}){1,3}@\w{1,128}([\.-]?\w{1,128}){1,2}(\.\w{2,8}){1,2}$/.test(email))
}
const validate = (state: any): FormError[] => {
Expand Down
2 changes: 1 addition & 1 deletion apps/ui/pages/welcome/volunteers.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const email = route.query.email as string;
const fields = ref<any>([]);
const validateEmail = (email: string) => {
return (/^\w{1,128}([\.-\\+]?\w{1,128}){1,3}@\w{1,128}([\.-]?\w{1,128}){1,2}(\.\w{2,3})+$/.test(email))
return (/^\w{1,128}([\.-\\+]?\w{1,128}){1,3}@\w{1,128}([\.-]?\w{1,128}){1,2}(\.\w{2,8}){1,2}$/.test(email))
}
const validate = (state: any): FormError[] => {
Expand Down
48 changes: 24 additions & 24 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,68 +25,68 @@
"typecheck": "nuxt typecheck apps/ui"
},
"dependencies": {
"@egoist/tailwindcss-icons": "^1.8.0",
"@egoist/tailwindcss-icons": "^1.8.1",
"@googlemaps/js-api-loader": "^1.16.6",
"@iconify-json/game-icons": "^1.1.9",
"@iconify-json/heroicons": "^1.1.21",
"@iconify-json/ph": "^1.1.13",
"@iconify-json/simple-icons": "^1.1.103",
"@iconify-json/simple-icons": "^1.1.107",
"@iconify-json/streamline": "^1.1.8",
"@nuxt/fonts": "^0.6.1",
"@nuxt/image": "^1.7.0",
"@sidebase/nuxt-auth": "^0.7.2",
"@tailwindcss/forms": "^0.5.7",
"@typescript-eslint/parser": "^7.11.0",
"@typescript-eslint/parser": "^7.14.1",
"@unovis/vue": "^1.4.1",
"@vitejs/plugin-vue": "^5.0.4",
"@vitejs/plugin-vue": "^5.0.5",
"@vueform/nuxt": "^1.6.0",
"@vueform/plugin-mask": "^1.0.5",
"@vueform/vueform": "^1.9.9",
"@vueuse/nuxt": "^10.10.0",
"@vueform/plugin-mask": "^1.0.7",
"@vueform/vueform": "^1.9.12",
"@vueuse/nuxt": "^10.11.0",
"axios": "^1.7.2",
"date-fns": "^3.6.0",
"next": "^14.2.3",
"next": "^14.2.4",
"next-auth": "~4.24.7",
"nitro": "^0.0.0",
"nuxt-og-image": "3.0.0-rc.43",
"nuxt-snackbar": "^1.0.4",
"pinia": "^2.1.7",
"prettier": "^3.2.5",
"vue": "^3.4.27",
"vue-router": "^4.3.2",
"prettier": "^3.3.2",
"vue": "^3.4.30",
"vue-router": "^4.4.0",
"vue3-google-map": "^0.20.0",
"vue3-smooth-dnd": "^0.0.6",
"ws": "^8.17.1"
},
"devDependencies": {
"@nuxt/devtools": "^1.3.2",
"@nuxt/devtools": "^1.3.7",
"@nuxt/eslint-config": "^0.2.0",
"@nuxt/test-utils": "^3.13.1",
"@nuxt/types": "^2.17.3",
"@nuxt/types": "^2.18.0",
"@nuxt/typescript-build": "^3.0.2",
"@nuxt/ui": "^2.16.0",
"@nuxt/ui": "^2.17.0",
"@nuxt/ui-pro": "npm:@nuxt/[email protected]",
"@nuxthq/studio": "^1.1.0",
"@nuxtjs/color-mode": "^3.4.1",
"@nuxthq/studio": "^1.1.2",
"@nuxtjs/color-mode": "^3.4.2",
"@nuxtjs/tailwindcss": "^6.12.0",
"@pinia/nuxt": "^0.5.1",
"@types/google.maps": "^3.55.9",
"@types/google.maps": "^3.55.10",
"@types/jest": "^29.5.12",
"@types/node": "^20.12.13",
"@types/node": "^20.14.9",
"@vue/test-utils": "^2.4.6",
"autoprefixer": "^10.4.19",
"dotenv-cli": "^7.4.2",
"eslint": "^8.57.0",
"favicons": "^7.2.0",
"happy-dom": "^14.11.4",
"happy-dom": "^14.12.3",
"jest": "^29.7.0",
"nuxt": "^3.11.2",
"playwright-core": "^1.44.1",
"nuxt": "^3.12.2",
"playwright-core": "^1.45.0",
"postcss": "^8.4.38",
"tailwindcss": "^3.4.3",
"typescript": "^5.4.5",
"tailwindcss": "^3.4.4",
"typescript": "^5.5.2",
"vitest": "^1.6.0",
"vue-tsc": "^2.0.19"
"vue-tsc": "^2.0.22"
},
"resolutions": {
"vue": "^3.4.0"
Expand Down
Loading

0 comments on commit 1833dc0

Please sign in to comment.