Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
13 changes: 13 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"root": true,
"extends": ["next/core-web-vitals", "prettier"],
"rules": {
"import/order": [
"error",
{
"alphabetize": { "order": "asc", "caseInsensitive": true },
"warnOnUnassignedImports": false
}
]
}
}
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright © 2010–2020 Santtu Pajukanta
Copyright © 2010–2024 Santtu Pajukanta

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
19 changes: 6 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,6 @@ To run tests:
alias dc-test="docker-compose --file=docker-compose.test.yml up --abort-on-container-exit --exit-code-from=test"
dc-test

#### Caveats

* Due to deep magic performed by the `react-scripts` proxy, picture & album downloads do not work in local dev and you are offered `index.html` instead.

### The Traditional Way

For developing the backend or frontend components without Docker Compose, please see the set-up instructions in their respective README files under `backend/` and `frontend/`.
Expand Down Expand Up @@ -71,8 +67,10 @@ The following services are required:

* [ingress-nginx](https://github.com/kubernetes/ingress-nginx) or some other ingress controller
* [cert-manager](https://github.com/jetstack/cert-manager) if you want TLS (not required for local development)
* postgres
* redis

The Kubernetes deployment uses [Emskaffolden](https://github.com/con2/emskaffolden) which in turn wraps [Skaffold](https://skaffold.dev) with [Emrichen](https://github.com/con2/emrichen).
The Kubernetes deployment uses [Skaffold](https://skaffold.dev) with [Depleten](https://github.com/japsu/depleten).

To deploy in [Docker Desktop](https://www.docker.com/products/docker-desktop) or similar local Kubernetes:

Expand All @@ -87,23 +85,18 @@ To deploy in [Docker Desktop](https://www.docker.com/products/docker-desktop) or
helm install -n cert-manager cert-manager jetstack/cert-manager --set installCRDs=true

# Once you have the above requirements installed
emskaffolden run
npm install
npm run k8s:dev

To customize, first see `kubernetes/default.vars.yaml` and make a copy of `kubernetes/staging.vars.yaml` under your environment name (eg. `kubernetes/myenv.vars.yaml`). Then activate your environment with `-E myenv`. For a non-local Kubernetes cluster, you also need to add your private registry using `--default-repo`. Eg.

emskaffolden run -E myenv -- --default-repo=harbor.con2.fi/con2

### Ansible & Docker

**DEPRECATED**: Will stop being maintained once we move Conikuvat.fi and Larppikuvat.fi to Kubernetes.

See [here](https://github.com/tracon/ansible-tracon/tree/master/roles/edegal/).

## License

The MIT License (MIT)

Copyright © 2010–2020 Santtu Pajukanta
Copyright © 2010–2024 Santtu Pajukanta

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
22 changes: 11 additions & 11 deletions backend/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# uv pip compile requirements.in
admin-multiupload @ git+https://github.com/con2/django-admin-multiupload.git@b70bc1515ce8d260f3580365f4e1b34762872bae#egg=admin-multiupload
# via -r requirements.in
amqp==5.2.0
amqp==5.3.1
# via kombu
annotated-types==0.7.0
# via pydantic
Expand Down Expand Up @@ -33,7 +33,7 @@ click-plugins==1.1.1
# via celery
click-repl==0.3.0
# via celery
django==5.1.3
django==5.1.4
# via
# -r requirements.in
# django-js-asset
Expand Down Expand Up @@ -63,11 +63,11 @@ idna==3.10
# requests
kombu==5.4.2
# via celery
nh3==0.2.18
nh3==0.2.19
# via django-prose-editor
oauthlib==3.2.2
# via requests-oauthlib
packaging==24.1
packaging==24.2
# via
# build
# gunicorn
Expand All @@ -83,9 +83,9 @@ prompt-toolkit==3.0.48
# via click-repl
psycopg2==2.9.10
# via -r requirements.in
pydantic==2.9.2
pydantic==2.10.3
# via -r requirements.in
pydantic-core==2.23.4
pydantic-core==2.27.1
# via pydantic
pyproject-hooks==1.2.0
# via
Expand All @@ -95,7 +95,7 @@ python-dateutil==2.9.0.post0
# via celery
python-memcached==1.62
# via -r requirements.in
redis==5.2.0
redis==5.2.1
# via
# -r requirements.in
# django-redis
Expand All @@ -105,13 +105,13 @@ requests==2.32.3
# requests-oauthlib
requests-oauthlib==2.0.0
# via -r requirements.in
setuptools==75.3.0
setuptools==75.6.0
# via pip-tools
six==1.16.0
six==1.17.0
# via python-dateutil
soupsieve==2.6
# via beautifulsoup4
sqlparse==0.5.1
sqlparse==0.5.2
# via django
typing-extensions==4.12.2
# via
Expand All @@ -130,5 +130,5 @@ vine==5.1.0
# kombu
wcwidth==0.2.13
# via prompt-toolkit
wheel==0.44.0
wheel==0.45.1
# via pip-tools
19 changes: 6 additions & 13 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,22 +28,15 @@ services:
environment:
<<: *environment
frontend:
build: frontend
build:
context: frontend
dockerfile: dev.Dockerfile
init: true
command:
- node_modules/.bin/vite
- --host=0.0.0.0
ports:
- 3000:3000
# network_mode: service:router
depends_on:
- backend
volumes:
- ./frontend/src:/usr/src/app/src
tmpfs:
- /usr/src/app/node_modules/.cache
- /usr/src/app/node_modules/.vite
environment:
VITE_EDEGAL_PROXY_URL: http://backend:8000
VITE_EDEGAL_LOGIN_URL: http://localhost:8000/admin/
CI: "true"
postgres:
image: postgres
volumes:
Expand Down
15 changes: 0 additions & 15 deletions frontend/.dockerignore

This file was deleted.

13 changes: 13 additions & 0 deletions frontend/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"root": true,
"extends": ["next/core-web-vitals", "prettier"],
"rules": {
"import/order": [
"error",
{
"alphabetize": { "order": "asc", "caseInsensitive": true },
"warnOnUnassignedImports": false
}
]
}
}
1 change: 0 additions & 1 deletion frontend/.gitattributes

This file was deleted.

27 changes: 22 additions & 5 deletions frontend/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,38 @@
# dependencies
/node_modules
/.pnp
.pnp.js
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/versions

# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# env files (can opt-in for committing if needed)
.env*

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts
24 changes: 18 additions & 6 deletions frontend/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,21 @@
FROM node:22

FROM node:22 AS deps
WORKDIR /usr/src/app

COPY package.json package-lock.json tsconfig.json tslint.json index.html vite.config.js /usr/src/app/
COPY package.json package-lock.json ./
RUN npm ci
COPY src /usr/src/app/src

CMD ["node_modules/.bin/vite"]
FROM node:22 AS builder
WORKDIR /usr/src/app
ENV NEXT_TELEMETRY_DISABLED 1
COPY --from=deps /usr/src/app/node_modules ./node_modules
COPY package.json package-lock.json next.config.ts tsconfig.json .eslintrc.json ./
COPY src src
RUN npm run build

FROM node:22 AS runner
WORKDIR /usr/src/app
ENV NODE_ENV production
ENV NEXT_TELEMETRY_DISABLED 1
ENV PORT 3000
COPY --from=builder /usr/src/app/.next/standalone ./
COPY --from=builder /usr/src/app/.next/static .next/static
CMD ["node", "server.js"]
13 changes: 0 additions & 13 deletions frontend/Dockerfile.static

This file was deleted.

47 changes: 23 additions & 24 deletions frontend/README.md
Original file line number Diff line number Diff line change
@@ -1,37 +1,36 @@
# Edegal – Fast Web Image Gallery
This is a [Next.js](https://nextjs.org) project bootstrapped with [`create-next-app`](https://nextjs.org/docs/app/api-reference/cli/create-next-app).

## Responsive Web Frontend
## Getting Started

This is the browser frontend for desktop & mobile browsers. Technology choices include
First, run the development server:

* TypeScript
* React
* Simple state management, no Redux etc.
```bash
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev
```

## Getting started
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.

### The Docker Compose Way
You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.

This is the recommended way to develop Edegal. There is a single unified Docker Compose development environment for both the frontend and the backend. For instructions, see `README.md` in the parent directory.
This project uses [`next/font`](https://nextjs.org/docs/app/building-your-application/optimizing/fonts) to automatically optimize and load [Geist](https://vercel.com/font), a new font family for Vercel.

When developing with Docker Compose, the frontend will use the local backend running under Docker Compose.
## Learn More

### The Traditional Way
To learn more about Next.js, take a look at the following resources:

If, for some reason, you want to develop the Edegal frontend without using Docker, follow these instructions.
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.

When developing without Docker, the frontend will, by default, use the Conikuvat.fi live production backend. If you want to use another backend, change `proxy` in `package.json`.
You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js) - your feedback and contributions are welcome!

Requirements:
## Deploy on Vercel

* Node.js 12.x (10.x or 8.x may work, but are not supported)
The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.

Yarn is not supported, only `npm` is.

You should get up and running with the following commands:

git clone [email protected]:conikuvat/edegal
cd edegal/frontend
npm install
npm start
iexplore http://localhost:3000
Check out our [Next.js deployment documentation](https://nextjs.org/docs/app/building-your-application/deploying) for more details.
13 changes: 13 additions & 0 deletions frontend/dev.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM node:22 AS deps
WORKDIR /usr/src/app
COPY package.json package-lock.json ./
RUN npm ci

FROM node:22 AS dev
WORKDIR /usr/src/app
ENV NEXT_TELEMETRY_DISABLED 1
COPY --from=deps /usr/src/app/node_modules ./node_modules
COPY package.json package-lock.json next.config.ts tsconfig.json .eslintrc.json ./
COPY src src

CMD [ "next", "dev" ]
16 changes: 0 additions & 16 deletions frontend/index.html

This file was deleted.

Loading
Loading