You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+30-12Lines changed: 30 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,21 +4,30 @@ A FastAPI-powered prototype that serves an interactive Aladin Lite interface for
4
4
5
5
## Quickstart
6
6
7
-
1.Create a virtual environment and install the dependencies:
7
+
1.Build the CosmoView frontend (repeat whenever you change the React app):
8
8
9
9
```bash
10
-
python -m venv .venv
10
+
cd CosmoView
11
+
npm install
12
+
npm run build
13
+
cd ..
14
+
```
15
+
16
+
2. Create a virtual environment and install the FastAPI dependencies:
17
+
18
+
```bash
19
+
python3 -m venv .venv
11
20
source .venv/bin/activate
12
21
pip install -r requirements.txt
13
22
```
14
23
15
-
2. Launch the development server:
24
+
3. Launch the development server:
16
25
17
26
```bash
18
27
uvicorn src.server:app --reload
19
28
```
20
29
21
-
3. Open <http://127.0.0.1:8000/> in your browser and click **“Launch the viewer.”**The FITS explorer lives at <http://127.0.0.1:8000/aladin>.
30
+
4. Open <http://127.0.0.1:8000/> in your browser. The CosmoView landing page now lives at the root route with an **“Explore the Universe”**button that jumps directly to the Aladin viewer at <http://127.0.0.1:8000/aladin>.
22
31
23
32
### Working with FITS datasets
24
33
@@ -42,12 +51,14 @@ ruff check .
42
51
43
52
```
44
53
NASASpaceAppsChallenge2025/
54
+
├── CosmoView/ # React + Vite front-end project
55
+
│ ├── client/src/ # UI components and pages
56
+
│ └── dist/public/ # Production build served by FastAPI
45
57
├── requirements.txt # FastAPI and Uvicorn dependencies
46
58
├── src/
47
59
│ ├── __init__.py
48
-
│ └── server.py # FastAPI application serving the HTML page
60
+
│ └── server.py # FastAPI application that serves both front-ends
49
61
├── web/
50
-
│ ├── index.html # Landing page served at the root route
51
62
│ ├── aladin.html # FITS explorer with Aladin Lite integration
52
63
│ └── styles.css # Styling for the viewer interface
53
64
├── deploy/
@@ -70,12 +81,19 @@ Every push to `main` triggers the GitHub Actions workflow in `.github/workflows/
70
81
pipeline performs the following steps:
71
82
72
83
1. Checks out the latest code.
73
-
2. Copies the repository to `/opt/nasa-sky-explorer` on your EC2 instance via `rsync`.
74
-
3. Creates a dedicated service user (`nasaapp`) if it doesn't exist.
75
-
4. Sets proper ownership and permissions for the application directory.
76
-
5. Installs Python dependencies in a virtual environment owned by the service user.
77
-
6. Applies necessary capabilities to bind to port 80 (if running on a privileged port).
78
-
7. Restarts the systemd service or launches Uvicorn as a background process.
84
+
2. Installs Node.js dependencies for the CosmoView frontend and builds the production bundle.
85
+
3. Copies the repository to `/opt/nasa-sky-explorer` on your EC2 instance via `rsync` (skipping
86
+
local build artefacts such as `node_modules/`).
87
+
4. Creates a dedicated service user (`nasaapp`) if it doesn't exist.
88
+
5. Sets proper ownership and permissions for the application directory.
89
+
6. Installs Python dependencies in a virtual environment owned by the service user.
90
+
7. Installs CosmoView dependencies on the EC2 host and rebuilds the Vite bundle to guarantee fresh
91
+
assets.
92
+
8. Applies necessary capabilities to bind to port 80 (if running on a privileged port).
93
+
9. Restarts the systemd service or launches Uvicorn as a background process.
94
+
95
+
> **Prerequisite:** Ensure Node.js (v20 or newer recommended) is available on the EC2 instance so
96
+
> the deployment script can run `npm install` and `npm run build` inside `CosmoView/`.
0 commit comments