Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
44268c2
development server successfully getting api data
lylashukur Apr 6, 2025
308d1cf
resolved correct tile path
lylashukur Apr 8, 2025
5c3fa0b
fixed environment variable placement
lylashukur Apr 8, 2025
6a12635
ignore env files
lylashukur Apr 8, 2025
69bae05
fixed Passes information and tiles rendering
lylashukur Apr 9, 2025
d3e7d85
Created React template for migration
lylashukur Apr 9, 2025
5daadae
transfer components
lylashukur Apr 9, 2025
b6e0295
tile generation fully configured
lylashukur Apr 10, 2025
23f9dd9
confirmed Oresat passes shared to frontend
lylashukur Apr 11, 2025
5769767
Add server proxy configuration to resolve CORS issues
lylashukur Apr 12, 2025
69077b1
Update backend/cesium_api/app.py
lylashukur Apr 12, 2025
1a68ee4
Update backend/cesium_api/__main__.py
lylashukur Apr 12, 2025
503f767
Update backend/cesium_api/__main__.py
lylashukur Apr 12, 2025
3243665
Update backend/cesium_api/app.py
lylashukur Apr 12, 2025
b6f6f4a
Update backend/cesium_api/app.py
lylashukur Apr 12, 2025
c783eac
Update backend/cesium_api/__init__.py
lylashukur Apr 12, 2025
2768d06
Update backend/cesium_api/app.py
lylashukur Apr 12, 2025
76c8ecb
Remove entire backup directory
lylashukur Apr 12, 2025
4dfff56
resolve merge conflicts
lylashukur Apr 12, 2025
1878075
Update backend/cesium_api/app.py
lylashukur Apr 12, 2025
879b564
revert tiles.py to main version
lylashukur Apr 12, 2025
f80932c
Merge branch 'Lyla-Migration-React' of https://github.com/uniclogs/ce…
lylashukur Apr 12, 2025
0350601
Delete template vite.config
lylashukur Apr 14, 2025
c9bf49f
Fix various devops bugs
dmitri-mcguckin Apr 15, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
4 changes: 2 additions & 2 deletions backend/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
docker:
python -m pip wheel . -w build --no-deps
python3 -m pip wheel . -w build --no-deps
docker compose build --build-arg VERSION=`grep -i 'version' pyproject.toml | cut -d'"' -f2`

hub:
Expand All @@ -17,4 +17,4 @@ tiles:

clean:
rm -rf build cesium_api.egg-info
pyclean
pyclean
3 changes: 0 additions & 3 deletions backend/cesium_api/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,6 @@ def main():
data_dir=args.data_dir,
debug=args.debug,
)
allowed_hosts = ['http://:localhost:3000', 'https://cesium-api.uniclogs.org']
CORS(app, origins=allowed_hosts)
LOG.info(f'Allowing CORs hosts: {allowed_hosts}')

app.run()

Expand Down
4 changes: 3 additions & 1 deletion backend/cesium_api/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from .views import view_czml, view_groundstation, view_passes, view_satellite, view_tiles
from .data import Data


class App(Flask):
host: str
port: int
Expand All @@ -30,6 +29,9 @@ def __init__(
self.data = data
self.debug = debug

# CORS(self, origins=["https://cesium-api.uniclogs.org"])
CORS(self, origins=["http://localhost:5173"])

# Register app views
self.register_blueprint(view_czml, url_prefix=f"{api_prefix}/czml")
self.register_blueprint(view_groundstation, url_prefix=f"{api_prefix}/gs")
Expand Down
2 changes: 1 addition & 1 deletion backend/cesium_api/views/czml.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ def get_root():
cz = current_app.data.czml
while len(cz) == 0:
cz = current_app.data.czml
return loads(cz)
return loads(cz)
1 change: 0 additions & 1 deletion backend/cesium_api/views/tiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

view_tiles = Blueprint("view_tiles", __name__)


@view_tiles.route("/<int:zoom>/<int:x>/<int:y>.png")
def get_tile(zoom: int, x: int, y: int):
data_dir = current_app.data_dir
Expand Down
1 change: 1 addition & 0 deletions frontend/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
VITE_API_BASE_URL=http://127.0.0.1:9000
1 change: 1 addition & 0 deletions frontend/.env.development
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
VITE_API_BASE_URL=http://127.0.0.1:9000
1 change: 1 addition & 0 deletions frontend/.env.production
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
VITE_API_BASE_URL=https://cesium-api.uniclogs.org
4 changes: 0 additions & 4 deletions frontend/.eslintignore

This file was deleted.

33 changes: 0 additions & 33 deletions frontend/.eslintrc.json

This file was deleted.

100 changes: 15 additions & 85 deletions frontend/.gitignore
Original file line number Diff line number Diff line change
@@ -1,94 +1,24 @@
# Custom
out

# See http://help.github.com/ignore-files/ for more about ignoring files.

# compiled output
/dist
/tmp
/out-tsc

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# IDEs and editors
.idea
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace

# IDE - VSCode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json

# misc
.sass-cache
connect.lock
typings

# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Dependency directories
node_modules/
jspm_packages/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env

# next.js build output
.next

# Lerna
lerna-debug.log

# System Files
# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
Thumbs.db
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
28 changes: 12 additions & 16 deletions frontend/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,33 +1,29 @@
FROM node:lts-alpine3.21

ARG REST_API
ENV REST_API="https://cesium-api.uniclogs.org"

ARG APP_HOST
ENV APP_HOST="mission.uniclogs.org"
ENV APP_HOST="cesium.uniclogs.org"

ARG APP_PORT
ENV APP_PORT=3000
ENV APP_PORT=7008

ARG APP_DIR
ENV APP_DIR="/srv/cesium"

RUN adduser -h ${APP_DIR} -D cesium users
COPY --chown=cesium:users --chmod=600 next.config.js ${APP_DIR}
COPY --chown=cesium:users --chmod=600 package.json ${APP_DIR}
COPY --chown=cesium:users --chmod=600 yarn.lock ${APP_DIR}

USER cesium
WORKDIR ${APP_DIR}
# COPY --chown=cesium:users --chmod=755 ./* ${APP_DIR}
COPY --chown=cesium:users --chmod=600 ./vite.config.js ${APP_DIR}
COPY --chown=cesium:users --chmod=600 ./package.json ${APP_DIR}
COPY --chown=cesium:users --chmod=700 ./public ${APP_DIR}/public
COPY --chown=cesium:users --chmod=700 ./src ${APP_DIR}/src

RUN yarn install
RUN npm install -g vite@latest

COPY --chown=cesium:users --chmod=700 components ${APP_DIR}/components
COPY --chown=cesium:users --chmod=700 pages ${APP_DIR}/pages
COPY --chown=cesium:users --chmod=700 public ${APP_DIR}/public
USER cesium
WORKDIR ${APP_DIR}

RUN yarn build
RUN npm install

EXPOSE ${APP_PORT}

CMD yarn start -p ${APP_PORT}
CMD vite --host 0.0.0.0 --port 7008
11 changes: 0 additions & 11 deletions frontend/Makefile

This file was deleted.

30 changes: 7 additions & 23 deletions frontend/README.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,13 @@
### Cesium Front-End Application
# React + Vite

```bash
cd frontend
```
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.

Install `nodejs` and `yarn` for your system
Currently, two official plugins are available:

```bash
sudo apt install nodejs yarnpkg
```
- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh

Install JavaScript dependencies
## Expanding the ESLint configuration

```bash
yarn install
```
If you are developing a production application, we recommend using TypeScript and enable type-aware lint rules. Check out the [TS template](https://github.com/vitejs/vite/tree/main/packages/create-vite/template-react-ts) to integrate TypeScript and [`typescript-eslint`](https://typescript-eslint.io) in your project.

Start the app

```bash
yarn dev
```

Goto `localhost3000` in a web browser

[GDAL]:https//gdal.org
[GDAL Download]:https//gdal.org/download.html
[CesiumJS]:https//github.com/CesiumGS/cesium
36 changes: 0 additions & 36 deletions frontend/components/Cesium.jsx

This file was deleted.

2 changes: 1 addition & 1 deletion frontend/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ services:
build:
context: .
ports:
- '3000:3000'
- '7008:7008'
33 changes: 33 additions & 0 deletions frontend/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import js from '@eslint/js'
import globals from 'globals'
import reactHooks from 'eslint-plugin-react-hooks'
import reactRefresh from 'eslint-plugin-react-refresh'

export default [
{ ignores: ['dist'] },
{
files: ['**/*.{js,jsx}'],
languageOptions: {
ecmaVersion: 2020,
globals: globals.browser,
parserOptions: {
ecmaVersion: 'latest',
ecmaFeatures: { jsx: true },
sourceType: 'module',
},
},
plugins: {
'react-hooks': reactHooks,
'react-refresh': reactRefresh,
},
rules: {
...js.configs.recommended.rules,
...reactHooks.configs.recommended.rules,
'no-unused-vars': ['error', { varsIgnorePattern: '^[A-Z_]' }],
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
],
},
},
]
Loading