├── Orbit_Predictor-BackEnd ├── api │ ├── __init__.py │ ├── tests │ │ ├── __init__.py │ │ └── tests.py │ ├── migrations │ │ ├── __init__.py │ │ ├── 0005_merge_20250203_0240.py │ │ ├── 0012_user_notifications.py │ │ ├── 0009_cdm_organizations.py │ │ ├── 0010_remove_cdm_organizations_organization_cdms.py │ │ ├── 0004_rename_risk_factor_collision_probability_of_collision_and_more.py │ │ ├── 0011_user_interested_cdms_and_more.py │ │ ├── 0002_user.py │ │ ├── 0008_alter_organization_alert_threshold_and_more.py │ │ ├── 0007_organization.py │ │ ├── 0003_remove_collision_conjunction_id_and_more.py │ │ ├── 0004_remove_user_password_hash_cdm_privacy_user_groups_and_more.py │ │ ├── 0006_cdm_sat1_catalog_name_cdm_sat1_covariance_method_and_more.py │ │ └── 0001_initial.py │ ├── .DS_Store │ ├── matlab │ │ ├── .DS_Store │ │ └── Utils │ │ │ ├── UnitTests │ │ │ ├── InputFiles │ │ │ │ └── FindNearbyCA_TestCases.mat │ │ │ ├── Product3x3_UnitTest.m │ │ │ ├── CheckAndResizeCov_UnitTest.m │ │ │ ├── LinearConjDuration_UnitTest.m │ │ │ ├── eig2x2_UnitTest.m │ │ │ ├── FindNearbyCA_UnitTest.m │ │ │ └── conj_bounds_Coppola_UnitTest.m │ │ │ ├── CheckAndResizePosVel.m │ │ │ ├── set_default_param.m │ │ │ ├── EquinoctialMatrices.m │ │ │ ├── PeakOverlapMD2.m │ │ │ ├── Product3x3.m │ │ │ ├── GetAlfanoTestCases.m │ │ │ ├── CheckAndResizeCov.m │ │ │ ├── jacobian_E0_to_Xt.m │ │ │ ├── FindNearbyCA.m │ │ │ ├── eig2x2.m │ │ │ ├── get_covXcorr_parameters.m │ │ │ ├── get_alfano_test_case.m │ │ │ └── CovRemEigValClip2x2.m │ ├── serializers │ │ ├── .DS_Store │ │ ├── cdm_serializer.py │ │ ├── collision_serializer.py │ │ ├── probability_calc_serializer.py │ │ ├── __init__.py │ │ └── organization_serializer.py │ ├── apps.py │ ├── models │ │ ├── __init__.py │ │ ├── probability_calc.py │ │ ├── organization.py │ │ ├── collision.py │ │ ├── user.py │ │ └── cdm.py │ ├── schemas.py │ ├── admin.py │ ├── views │ │ ├── collision_views.py │ │ ├── probability_calc_views.py │ │ ├── __init__.py │ │ ├── refresh_token_views.py │ │ ├── organization_views.py │ │ └── user_views.py │ ├── permissions.py │ ├── authentication.py │ ├── urls.py │ ├── sample_data │ │ └── oct5_data │ │ │ ├── cdm0.json │ │ │ ├── cdm3.json │ │ │ ├── cdm2.json │ │ │ ├── cdm1.json │ │ │ └── cdm4.json │ └── management │ │ └── commands │ │ └── seed_cdm_data.py ├── orbit_predictor │ ├── __init__.py │ ├── .DS_Store │ ├── asgi.py │ ├── wsgi.py │ ├── urls.py │ └── settings.py ├── .DS_Store ├── db.sqlite3 ├── .env.example ├── test.py └── manage.py ├── settings.json ├── on-orbit-frontend ├── .eslintrc.json ├── public │ ├── csa.png │ ├── logo.png │ └── mcgill.png ├── src │ ├── app │ │ ├── favicon.ico │ │ ├── (root) │ │ │ ├── page.tsx │ │ │ └── layout.tsx │ │ ├── login │ │ │ ├── layout.tsx │ │ │ └── page.tsx │ │ ├── signup │ │ │ ├── layout.tsx │ │ │ └── page.tsx │ │ ├── user │ │ │ ├── layout.tsx │ │ │ └── page.tsx │ │ ├── dashboard │ │ │ └── layout.tsx │ │ ├── cesium-view │ │ │ ├── layout.tsx │ │ │ └── [id] │ │ │ │ └── layout.tsx │ │ ├── maneuvering │ │ │ ├── heatmap │ │ │ │ └── [id] │ │ │ │ │ └── layout.tsx │ │ │ └── linear │ │ │ │ └── [id] │ │ │ │ ├── layout.tsx │ │ │ │ └── page.tsx │ │ ├── about │ │ │ └── page.tsx │ │ ├── layout.tsx │ │ ├── styles │ │ │ └── font.ts │ │ ├── loading.tsx │ │ └── globals.css │ ├── lib │ │ └── utils.ts │ └── components │ │ ├── ui │ │ └── input.tsx │ │ ├── footer │ │ └── page.tsx │ │ ├── csa │ │ └── csa.tsx │ │ ├── about │ │ └── about.tsx │ │ └── Navbar.tsx ├── next.config.ts ├── postcss.config.mjs ├── components.json ├── .gitignore ├── tsconfig.json ├── package.json ├── README.md └── tailwind.config.ts ├── .gitignore ├── requirements.txt ├── package.json └── README.md /Orbit_Predictor-BackEnd/api/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Orbit_Predictor-BackEnd/api/tests/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Orbit_Predictor-BackEnd/api/migrations/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Orbit_Predictor-BackEnd/orbit_predictor/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "files.associations": { 3 | "*.m": "matlab" 4 | } 5 | } -------------------------------------------------------------------------------- /on-orbit-frontend/.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": ["next/core-web-vitals", "next/typescript"] 3 | } 4 | -------------------------------------------------------------------------------- /Orbit_Predictor-BackEnd/api/tests/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /Orbit_Predictor-BackEnd/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Erik-Cupsa/On-Orbit-Collision-Predictor/HEAD/Orbit_Predictor-BackEnd/.DS_Store -------------------------------------------------------------------------------- /Orbit_Predictor-BackEnd/db.sqlite3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Erik-Cupsa/On-Orbit-Collision-Predictor/HEAD/Orbit_Predictor-BackEnd/db.sqlite3 -------------------------------------------------------------------------------- /on-orbit-frontend/public/csa.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Erik-Cupsa/On-Orbit-Collision-Predictor/HEAD/on-orbit-frontend/public/csa.png -------------------------------------------------------------------------------- /on-orbit-frontend/public/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Erik-Cupsa/On-Orbit-Collision-Predictor/HEAD/on-orbit-frontend/public/logo.png -------------------------------------------------------------------------------- /on-orbit-frontend/public/mcgill.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Erik-Cupsa/On-Orbit-Collision-Predictor/HEAD/on-orbit-frontend/public/mcgill.png -------------------------------------------------------------------------------- /Orbit_Predictor-BackEnd/api/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Erik-Cupsa/On-Orbit-Collision-Predictor/HEAD/Orbit_Predictor-BackEnd/api/.DS_Store -------------------------------------------------------------------------------- /on-orbit-frontend/src/app/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Erik-Cupsa/On-Orbit-Collision-Predictor/HEAD/on-orbit-frontend/src/app/favicon.ico -------------------------------------------------------------------------------- /Orbit_Predictor-BackEnd/api/matlab/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Erik-Cupsa/On-Orbit-Collision-Predictor/HEAD/Orbit_Predictor-BackEnd/api/matlab/.DS_Store -------------------------------------------------------------------------------- /Orbit_Predictor-BackEnd/api/serializers/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Erik-Cupsa/On-Orbit-Collision-Predictor/HEAD/Orbit_Predictor-BackEnd/api/serializers/.DS_Store -------------------------------------------------------------------------------- /Orbit_Predictor-BackEnd/orbit_predictor/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Erik-Cupsa/On-Orbit-Collision-Predictor/HEAD/Orbit_Predictor-BackEnd/orbit_predictor/.DS_Store -------------------------------------------------------------------------------- /on-orbit-frontend/next.config.ts: -------------------------------------------------------------------------------- 1 | import type { NextConfig } from "next"; 2 | 3 | const nextConfig: NextConfig = { 4 | /* config options here */ 5 | }; 6 | 7 | export default nextConfig; 8 | -------------------------------------------------------------------------------- /Orbit_Predictor-BackEnd/api/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class ApiConfig(AppConfig): 5 | default_auto_field = 'django.db.models.BigAutoField' 6 | name = 'api' 7 | -------------------------------------------------------------------------------- /on-orbit-frontend/postcss.config.mjs: -------------------------------------------------------------------------------- 1 | /** @type {import('postcss-load-config').Config} */ 2 | const config = { 3 | plugins: { 4 | tailwindcss: {}, 5 | }, 6 | }; 7 | 8 | export default config; 9 | -------------------------------------------------------------------------------- /Orbit_Predictor-BackEnd/api/models/__init__.py: -------------------------------------------------------------------------------- 1 | from .collision import Collision 2 | from .probability_calc import ProbabilityCalc 3 | from .cdm import CDM 4 | from .user import User 5 | from .organization import Organization 6 | -------------------------------------------------------------------------------- /on-orbit-frontend/src/lib/utils.ts: -------------------------------------------------------------------------------- 1 | import { clsx, type ClassValue } from "clsx" 2 | import { twMerge } from "tailwind-merge" 3 | 4 | export function cn(...inputs: ClassValue[]) { 5 | return twMerge(clsx(inputs)) 6 | } 7 | -------------------------------------------------------------------------------- /Orbit_Predictor-BackEnd/api/matlab/Utils/UnitTests/InputFiles/FindNearbyCA_TestCases.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Erik-Cupsa/On-Orbit-Collision-Predictor/HEAD/Orbit_Predictor-BackEnd/api/matlab/Utils/UnitTests/InputFiles/FindNearbyCA_TestCases.mat -------------------------------------------------------------------------------- /Orbit_Predictor-BackEnd/api/serializers/cdm_serializer.py: -------------------------------------------------------------------------------- 1 | from rest_framework import serializers 2 | from ..models import CDM 3 | 4 | class CDMSerializer(serializers.ModelSerializer): 5 | class Meta: 6 | model = CDM 7 | fields = '__all__' -------------------------------------------------------------------------------- /Orbit_Predictor-BackEnd/api/schemas.py: -------------------------------------------------------------------------------- 1 | from rest_framework.schemas.openapi import SchemaGenerator 2 | 3 | class CustomSchemaGenerator(SchemaGenerator): 4 | def get_schema(self, request=None, public=False): 5 | return super().get_schema(request=request, public=public) -------------------------------------------------------------------------------- /Orbit_Predictor-BackEnd/api/serializers/collision_serializer.py: -------------------------------------------------------------------------------- 1 | from rest_framework import serializers 2 | from ..models import Collision 3 | 4 | class CollisionSerializer(serializers.ModelSerializer): 5 | class Meta: 6 | model = Collision 7 | fields = '__all__' -------------------------------------------------------------------------------- /Orbit_Predictor-BackEnd/api/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | from .models import Conjunction, Collision, ProbabilityCalc, CDM 3 | 4 | admin.site.register(Conjunction) 5 | admin.site.register(Collision) 6 | admin.site.register(ProbabilityCalc) 7 | admin.site.register(CDM) 8 | -------------------------------------------------------------------------------- /Orbit_Predictor-BackEnd/api/serializers/probability_calc_serializer.py: -------------------------------------------------------------------------------- 1 | from rest_framework import serializers 2 | from ..models import ProbabilityCalc 3 | 4 | class ProbabilityCalcSerializer(serializers.ModelSerializer): 5 | class Meta: 6 | model = ProbabilityCalc 7 | fields = '__all__' -------------------------------------------------------------------------------- /on-orbit-frontend/src/app/(root)/page.tsx: -------------------------------------------------------------------------------- 1 | import Csa from "@/components/csa/csa"; 2 | import Landing from "@/components/landing/landing"; 3 | // import Image from "next/image"; 4 | 5 | export default function Home() { 6 | return ( 7 |
8 | 9 | {/* */} 10 |
11 | ); 12 | } -------------------------------------------------------------------------------- /Orbit_Predictor-BackEnd/api/serializers/__init__.py: -------------------------------------------------------------------------------- 1 | from .collision_serializer import CollisionSerializer 2 | from .probability_calc_serializer import ProbabilityCalcSerializer 3 | from .cdm_serializer import CDMSerializer 4 | from .user_serializer import UserSerializer, LoginSerializer, CDMSerializer, RefreshTokenSerializer 5 | from .organization_serializer import OrganizationSerializer 6 | -------------------------------------------------------------------------------- /on-orbit-frontend/src/app/login/layout.tsx: -------------------------------------------------------------------------------- 1 | import Navbar from "../../components/Navbar"; 2 | import { worksans } from "../styles/font"; 3 | 4 | export default function Layout({children} : Readonly<{children: React.ReactNode}>){ 5 | return( 6 |
7 | 8 | {children} 9 |
10 | ) 11 | } -------------------------------------------------------------------------------- /on-orbit-frontend/src/app/signup/layout.tsx: -------------------------------------------------------------------------------- 1 | import Navbar from "../../components/Navbar"; 2 | import { worksans } from "../styles/font"; 3 | 4 | export default function Layout({children} : Readonly<{children: React.ReactNode}>){ 5 | return( 6 |
7 | 8 | {children} 9 |
10 | ) 11 | } -------------------------------------------------------------------------------- /Orbit_Predictor-BackEnd/.env.example: -------------------------------------------------------------------------------- 1 | SUPABASE_DB_NAME= 2 | SUPABASE_DB_USER= 3 | SUPABASE_DB_PASSWORD= 4 | SUPABASE_DB_HOST= 5 | SUPABASE_DB_PORT= 6 | SECRET_KEY= 7 | DEBUG= 8 | ALLOWED_HOSTS= 9 | JWT_SECRET_KEY= 10 | ADMIN_REGISTRATION_CODE= 11 | 12 | # Generate these from your email provider (e.g. Gmail with your email and an app password) 13 | EMAIL_HOST_USER= 14 | EMAIL_HOST_PASSWORD= 15 | -------------------------------------------------------------------------------- /on-orbit-frontend/src/app/user/layout.tsx: -------------------------------------------------------------------------------- 1 | import { worksans } from "@/app/styles/font"; 2 | import Navbar from "@/components/Navbar"; 3 | 4 | export default function Layout({children} : Readonly<{children: React.ReactNode}>){ 5 | return( 6 |
7 | 8 | {children} 9 |
10 | ) 11 | } -------------------------------------------------------------------------------- /on-orbit-frontend/src/app/dashboard/layout.tsx: -------------------------------------------------------------------------------- 1 | import Navbar from "../../components/Navbar"; 2 | import { worksans } from "../styles/font"; 3 | 4 | export default function Layout({children} : Readonly<{children: React.ReactNode}>){ 5 | return( 6 |
7 | 8 | {children} 9 |
10 | ) 11 | } -------------------------------------------------------------------------------- /on-orbit-frontend/src/app/cesium-view/layout.tsx: -------------------------------------------------------------------------------- 1 | import Navbar from "../../components/Navbar"; 2 | import { worksans } from "../styles/font"; 3 | 4 | export default function Layout({children} : Readonly<{children: React.ReactNode}>){ 5 | return( 6 |
7 | 8 | {children} 9 |
10 | ) 11 | } -------------------------------------------------------------------------------- /on-orbit-frontend/src/app/cesium-view/[id]/layout.tsx: -------------------------------------------------------------------------------- 1 | import Navbar from "../../../components/Navbar"; 2 | import { worksans } from "../../styles/font"; 3 | 4 | export default function Layout({children} : Readonly<{children: React.ReactNode}>){ 5 | return( 6 |
7 | 8 | {children} 9 |
10 | ) 11 | } -------------------------------------------------------------------------------- /on-orbit-frontend/src/app/maneuvering/heatmap/[id]/layout.tsx: -------------------------------------------------------------------------------- 1 | import { worksans } from "@/app/styles/font"; 2 | import Navbar from "@/components/Navbar"; 3 | 4 | export default function Layout({children} : Readonly<{children: React.ReactNode}>){ 5 | return( 6 |
7 | 8 | {children} 9 |
10 | ) 11 | } -------------------------------------------------------------------------------- /on-orbit-frontend/src/app/maneuvering/linear/[id]/layout.tsx: -------------------------------------------------------------------------------- 1 | import { worksans } from "@/app/styles/font"; 2 | import Navbar from "@/components/Navbar"; 3 | 4 | export default function Layout({children} : Readonly<{children: React.ReactNode}>){ 5 | return( 6 |
7 | 8 | {children} 9 |
10 | ) 11 | } -------------------------------------------------------------------------------- /Orbit_Predictor-BackEnd/api/models/probability_calc.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | from .cdm import CDM 3 | 4 | class ProbabilityCalc(models.Model): 5 | cdm = models.ForeignKey(CDM, on_delete=models.CASCADE, related_name='probability_calcs') 6 | probability_value = models.FloatField() 7 | time_to_impact = models.DurationField() 8 | 9 | def __str__(self): 10 | return f"ProbabilityCalc {self.id} - CDM {self.cdm.id}" -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | env/ 2 | Orbit_Predictor-BackEnd/.env 3 | Orbit_Predictor-BackEnd/api/__pycache__/ 4 | Orbit_Predictor-BackEnd/orbit_predictor/__pycache__/ 5 | Orbit_Predictor-BackEnd/api/migrations/__pycache__/ 6 | Orbit_Predictor-BackEnd/api/models/__pycache__/ 7 | Orbit_Predictor-BackEnd/api/serializers/__pycache__/ 8 | Orbit_Predictor-BackEnd/api/views/__pycache__/ 9 | Orbit_Predictor-BackEnd/api/management/commands/__pycache__/ 10 | node_modules 11 | 12 | .env -------------------------------------------------------------------------------- /Orbit_Predictor-BackEnd/api/migrations/0005_merge_20250203_0240.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 5.1.3 on 2025-02-03 02:40 2 | 3 | from django.db import migrations 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('api', '0004_remove_user_password_hash_cdm_privacy_user_groups_and_more'), 10 | ('api', '0004_rename_risk_factor_collision_probability_of_collision_and_more'), 11 | ] 12 | 13 | operations = [ 14 | ] 15 | -------------------------------------------------------------------------------- /Orbit_Predictor-BackEnd/api/views/collision_views.py: -------------------------------------------------------------------------------- 1 | from rest_framework import generics 2 | from ..models import Collision 3 | from ..serializers import CollisionSerializer 4 | 5 | class CollisionListCreateView(generics.ListCreateAPIView): 6 | queryset = Collision.objects.all() 7 | serializer_class = CollisionSerializer 8 | 9 | class CollisionDetailView(generics.RetrieveUpdateDestroyAPIView): 10 | queryset = Collision.objects.all() 11 | serializer_class = CollisionSerializer -------------------------------------------------------------------------------- /on-orbit-frontend/src/app/about/page.tsx: -------------------------------------------------------------------------------- 1 | import Navbar from "@/components/Navbar"; 2 | import Footer from "@/components/footer/page"; 3 | import About from "@/components/about/about"; 4 | import Csa from "@/components/csa/csa"; 5 | 6 | export default function AboutPage() { 7 | return ( 8 |
9 | 10 | 11 | 12 |
14 | ); 15 | } -------------------------------------------------------------------------------- /Orbit_Predictor-BackEnd/test.py: -------------------------------------------------------------------------------- 1 | import matlab.engine 2 | import argparse 3 | 4 | def main(): 5 | parser = argparse.ArgumentParser(description="Run MATLAB sqrt function from Python") 6 | parser.add_argument("number", type=float, help="The number to calculate the square root of") 7 | args = parser.parse_args() 8 | 9 | eng = matlab.engine.start_matlab() 10 | result = eng.sqrt(args.number) 11 | print(result) 12 | eng.quit() 13 | 14 | if __name__ == "__main__": 15 | main() -------------------------------------------------------------------------------- /Orbit_Predictor-BackEnd/orbit_predictor/asgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | ASGI config for orbit_predictor project. 3 | 4 | It exposes the ASGI callable as a module-level variable named ``application``. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/5.1/howto/deployment/asgi/ 8 | """ 9 | 10 | import os 11 | 12 | from django.core.asgi import get_asgi_application 13 | 14 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'orbit_predictor.settings') 15 | 16 | application = get_asgi_application() 17 | -------------------------------------------------------------------------------- /Orbit_Predictor-BackEnd/orbit_predictor/wsgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | WSGI config for orbit_predictor project. 3 | 4 | It exposes the WSGI callable as a module-level variable named ``application``. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/5.1/howto/deployment/wsgi/ 8 | """ 9 | 10 | import os 11 | 12 | from django.core.wsgi import get_wsgi_application 13 | 14 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'orbit_predictor.settings') 15 | 16 | application = get_wsgi_application() 17 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | asgiref==3.8.1 2 | bcrypt==4.2.1 3 | Django==5.1.3 4 | django-cors-headers==4.6.0 5 | django-filter==24.3 6 | djangorestframework==3.15.2 7 | httpcore==1.0.7 8 | httpx==0.27.2 9 | # Change path to your MATLAB installation 10 | matlabengine @ file:///Applications/MATLAB_R2024b.app/extern/engines/python 11 | psycopg2-binary==2.9.10 12 | PyJWT==2.10.1 13 | pyparsing==3.2.3 14 | python-dateutil==2.9.0.post0 15 | python-dotenv==1.0.1 16 | requests==2.32.3 17 | sqlparse==0.5.1 18 | supabase==2.10.0 19 | supafunc==0.7.0 -------------------------------------------------------------------------------- /on-orbit-frontend/src/app/(root)/layout.tsx: -------------------------------------------------------------------------------- 1 | import Footer from "@/components/footer/page"; 2 | import Navbar from "../../components/Navbar"; 3 | import { worksans } from "../styles/font"; 4 | import Csa from "@/components/csa/csa"; 5 | 6 | export default function Layout({children} : Readonly<{children: React.ReactNode}>){ 7 | return( 8 |
9 | 10 | {children} 11 | 12 |
14 | ) 15 | } -------------------------------------------------------------------------------- /Orbit_Predictor-BackEnd/api/migrations/0012_user_notifications.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 5.1.3 on 2025-04-07 03:45 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('api', '0011_user_interested_cdms_and_more'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AddField( 14 | model_name='user', 15 | name='notifications', 16 | field=models.BooleanField(default=True), 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /on-orbit-frontend/src/app/layout.tsx: -------------------------------------------------------------------------------- 1 | import type { Metadata } from "next"; 2 | import "./globals.css"; 3 | import { worksans } from "./styles/font"; 4 | 5 | export const metadata: Metadata = { 6 | title: "On Orbit Collision Predictor", 7 | }; 8 | 9 | export default function RootLayout({ 10 | children, 11 | }: Readonly<{ 12 | children: React.ReactNode; 13 | }>) { 14 | return ( 15 | 16 | 17 | {children} 18 | 19 | 20 | ); 21 | } 22 | -------------------------------------------------------------------------------- /Orbit_Predictor-BackEnd/api/views/probability_calc_views.py: -------------------------------------------------------------------------------- 1 | from rest_framework import generics 2 | from ..models import ProbabilityCalc 3 | from ..serializers import ProbabilityCalcSerializer 4 | 5 | class ProbabilityCalcListCreateView(generics.ListCreateAPIView): 6 | queryset = ProbabilityCalc.objects.all() 7 | serializer_class = ProbabilityCalcSerializer 8 | 9 | class ProbabilityCalcDetailView(generics.RetrieveUpdateDestroyAPIView): 10 | queryset = ProbabilityCalc.objects.all() 11 | serializer_class = ProbabilityCalcSerializer -------------------------------------------------------------------------------- /on-orbit-frontend/components.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://ui.shadcn.com/schema.json", 3 | "style": "new-york", 4 | "rsc": true, 5 | "tsx": true, 6 | "tailwind": { 7 | "config": "tailwind.config.ts", 8 | "css": "src/app/globals.css", 9 | "baseColor": "slate", 10 | "cssVariables": true, 11 | "prefix": "" 12 | }, 13 | "aliases": { 14 | "components": "@/components", 15 | "utils": "@/lib/utils", 16 | "ui": "@/components/ui", 17 | "lib": "@/lib", 18 | "hooks": "@/hooks" 19 | }, 20 | "iconLibrary": "lucide" 21 | } -------------------------------------------------------------------------------- /Orbit_Predictor-BackEnd/api/migrations/0009_cdm_organizations.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 5.1.3 on 2025-02-16 00:28 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('api', '0008_alter_organization_alert_threshold_and_more'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AddField( 14 | model_name='cdm', 15 | name='organizations', 16 | field=models.ManyToManyField(blank=True, related_name='cdms', to='api.organization'), 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /Orbit_Predictor-BackEnd/api/matlab/Utils/CheckAndResizePosVel.m: -------------------------------------------------------------------------------- 1 | % checks the sizes of the matrices and resizes v if needed 2 | function [numR, v] = CheckAndResizePosVel(r, v) 3 | [numR, rColumns] = size(r); 4 | if rColumns ~= 3 5 | error('r matrix must have 3 columns!'); 6 | end 7 | [numV, vColumns] = size(v); 8 | if vColumns ~= 3 9 | error('v matrix must have 3 columns!'); 10 | end 11 | if numV ~= numR 12 | if numV == 1 13 | v = repmat(v,numR,1); 14 | else 15 | error('v matrix cannot be resized to match r matrix'); 16 | end 17 | end 18 | end -------------------------------------------------------------------------------- /on-orbit-frontend/src/app/styles/font.ts: -------------------------------------------------------------------------------- 1 | import { Montserrat, Merriweather, Work_Sans } from "next/font/google"; 2 | 3 | export const worksans = Work_Sans({ 4 | subsets: ["latin"], 5 | weight: ["100", "200", "300", "400", "500", "600", "700", "800", "900"], 6 | display: "swap", 7 | }); 8 | 9 | export const montserrat = Montserrat({ 10 | subsets: ["latin"], 11 | weight: ["100", "200", "300", "400", "500", "600", "700", "800", "900"], 12 | display: "swap", 13 | }); 14 | 15 | export const merriweather = Merriweather({ 16 | subsets: ["latin"], 17 | weight: ["300", "400", "700", "900"], 18 | display: "swap", 19 | }); 20 | -------------------------------------------------------------------------------- /on-orbit-frontend/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.* 7 | .yarn/* 8 | !.yarn/patches 9 | !.yarn/plugins 10 | !.yarn/releases 11 | !.yarn/versions 12 | 13 | # testing 14 | /coverage 15 | 16 | # next.js 17 | /.next/ 18 | /out/ 19 | 20 | # production 21 | /build 22 | 23 | # misc 24 | .DS_Store 25 | *.pem 26 | 27 | # debug 28 | npm-debug.log* 29 | yarn-debug.log* 30 | yarn-error.log* 31 | 32 | # env files (can opt-in for commiting if needed) 33 | .env* 34 | 35 | # vercel 36 | .vercel 37 | 38 | # typescript 39 | *.tsbuildinfo 40 | next-env.d.ts 41 | -------------------------------------------------------------------------------- /Orbit_Predictor-BackEnd/api/views/__init__.py: -------------------------------------------------------------------------------- 1 | from .collision_views import CollisionListCreateView, CollisionDetailView 2 | from .probability_calc_views import ProbabilityCalcListCreateView, ProbabilityCalcDetailView 3 | from .cdm_views import CDMSerializerListCreateView, CDMCalcDetailView, CDMViewSet, CDMCreateView, CDMPrivacyToggleView 4 | from .user_views import RegisterView, LoginView, UserViewSet, CurrentUserView, UserNotificationToggleView 5 | from .refresh_token_views import RefreshTokenView 6 | from .organization_views import OrganizationViewSet 7 | from .tradespace_heatmap_views import CollisionTradespaceView 8 | from .tradespace_linear_views import CollisionLinearTradespaceView 9 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "on-orbit-collision-predictor", 3 | "version": "1.0.0", 4 | "private": true, 5 | "scripts": { 6 | "dev": "concurrently \"npm run dev:frontend\" \"npm run dev:backend\"", 7 | "dev:frontend": "cd on-orbit-frontend && npm run dev", 8 | "dev:backend": "cd Orbit_Predictor-BackEnd && ../env/bin/python manage.py runserver" 9 | }, 10 | "devDependencies": { 11 | "concurrently": "^7.0.0" 12 | }, 13 | "dependencies": { 14 | "@emotion/react": "^11.13.3", 15 | "@emotion/styled": "^11.13.0", 16 | "@mui/material": "^6.1.6", 17 | "lucide-react": "^0.487.0" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /on-orbit-frontend/src/app/loading.tsx: -------------------------------------------------------------------------------- 1 | import Navbar from "@/components/Navbar" 2 | 3 | export default function Loading() { 4 | return ( 5 | <> 6 | 7 |
8 | {/* */} 9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 | 19 | ); 20 | } -------------------------------------------------------------------------------- /Orbit_Predictor-BackEnd/api/migrations/0010_remove_cdm_organizations_organization_cdms.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 5.1.3 on 2025-02-16 00:35 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('api', '0009_cdm_organizations'), 10 | ] 11 | 12 | operations = [ 13 | migrations.RemoveField( 14 | model_name='cdm', 15 | name='organizations', 16 | ), 17 | migrations.AddField( 18 | model_name='organization', 19 | name='cdms', 20 | field=models.ManyToManyField(blank=True, related_name='organizations', to='api.cdm'), 21 | ), 22 | ] 23 | -------------------------------------------------------------------------------- /Orbit_Predictor-BackEnd/api/migrations/0004_rename_risk_factor_collision_probability_of_collision_and_more.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 5.1.3 on 2024-12-07 16:52 2 | 3 | from django.db import migrations 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('api', '0003_remove_collision_conjunction_id_and_more'), 10 | ] 11 | 12 | operations = [ 13 | migrations.RenameField( 14 | model_name='collision', 15 | old_name='risk_factor', 16 | new_name='probability_of_collision', 17 | ), 18 | migrations.RemoveField( 19 | model_name='collision', 20 | name='collision_date', 21 | ), 22 | ] 23 | -------------------------------------------------------------------------------- /Orbit_Predictor-BackEnd/api/views/refresh_token_views.py: -------------------------------------------------------------------------------- 1 | from rest_framework import generics, status 2 | from rest_framework.response import Response 3 | from rest_framework.permissions import AllowAny 4 | from ..serializers import RefreshTokenSerializer 5 | 6 | class RefreshTokenView(generics.GenericAPIView): 7 | serializer_class = RefreshTokenSerializer 8 | permission_classes = [AllowAny] 9 | 10 | def post(self, request, *args, **kwargs): 11 | serializer = self.get_serializer(data=request.data) 12 | if serializer.is_valid(): 13 | return Response(serializer.validated_data, status=status.HTTP_200_OK) 14 | return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST) 15 | -------------------------------------------------------------------------------- /on-orbit-frontend/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "ES2017", 4 | "lib": ["dom", "dom.iterable", "esnext"], 5 | "allowJs": true, 6 | "skipLibCheck": true, 7 | "strict": true, 8 | "noEmit": true, 9 | "esModuleInterop": true, 10 | "module": "esnext", 11 | "moduleResolution": "bundler", 12 | "resolveJsonModule": true, 13 | "isolatedModules": true, 14 | "jsx": "preserve", 15 | "incremental": true, 16 | "plugins": [ 17 | { 18 | "name": "next" 19 | } 20 | ], 21 | "paths": { 22 | "@/*": ["./src/*"] 23 | } 24 | }, 25 | "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"], 26 | "exclude": ["node_modules"] 27 | } 28 | -------------------------------------------------------------------------------- /Orbit_Predictor-BackEnd/manage.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | """Django's command-line utility for administrative tasks.""" 3 | import os 4 | import sys 5 | 6 | 7 | def main(): 8 | """Run administrative tasks.""" 9 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'orbit_predictor.settings') 10 | try: 11 | from django.core.management import execute_from_command_line 12 | except ImportError as exc: 13 | raise ImportError( 14 | "Couldn't import Django. Are you sure it's installed and " 15 | "available on your PYTHONPATH environment variable? Did you " 16 | "forget to activate a virtual environment?" 17 | ) from exc 18 | execute_from_command_line(sys.argv) 19 | 20 | 21 | if __name__ == '__main__': 22 | main() 23 | -------------------------------------------------------------------------------- /Orbit_Predictor-BackEnd/api/migrations/0011_user_interested_cdms_and_more.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 5.1.3 on 2025-02-16 01:09 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('api', '0010_remove_cdm_organizations_organization_cdms'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AddField( 14 | model_name='user', 15 | name='interested_cdms', 16 | field=models.ManyToManyField(blank=True, related_name='interested_users', to='api.cdm'), 17 | ), 18 | migrations.AlterField( 19 | model_name='organization', 20 | name='alert_threshold', 21 | field=models.FloatField(default=1e-09), 22 | ), 23 | ] 24 | -------------------------------------------------------------------------------- /Orbit_Predictor-BackEnd/api/migrations/0002_user.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 5.1.3 on 2024-12-05 22:17 2 | 3 | import uuid 4 | from django.db import migrations, models 5 | 6 | 7 | class Migration(migrations.Migration): 8 | 9 | dependencies = [ 10 | ('api', '0001_initial'), 11 | ] 12 | 13 | operations = [ 14 | migrations.CreateModel( 15 | name='User', 16 | fields=[ 17 | ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), 18 | ('email', models.EmailField(max_length=254, unique=True)), 19 | ('password_hash', models.CharField(max_length=128)), 20 | ('created_at', models.DateTimeField(auto_now_add=True)), 21 | ], 22 | ), 23 | ] 24 | -------------------------------------------------------------------------------- /Orbit_Predictor-BackEnd/api/matlab/Utils/set_default_param.m: -------------------------------------------------------------------------------- 1 | function params = set_default_param(params,param_name,default_param_value) 2 | 3 | % Set a default value in a params structure 4 | 5 | if isempty(param_name) || ~ischar(param_name) 6 | error('Invalid input param_name'); 7 | end 8 | 9 | if ~isfield(params,param_name) 10 | % If param doesn't exist as a field, then set it to the default value 11 | % params = setfield(params,param_name,default_param_value); 12 | params.(param_name) = default_param_value; 13 | elseif isempty(params.(param_name)) && ~isempty(default_param_value) 14 | % If param is empty, then set it to the default value 15 | % params = setfield(params,param_name,default_param_value); 16 | params.(param_name) = default_param_value; 17 | end 18 | 19 | return 20 | end 21 | -------------------------------------------------------------------------------- /Orbit_Predictor-BackEnd/api/migrations/0008_alter_organization_alert_threshold_and_more.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 5.1.3 on 2025-02-16 00:16 2 | 3 | from django.conf import settings 4 | from django.db import migrations, models 5 | 6 | 7 | class Migration(migrations.Migration): 8 | 9 | dependencies = [ 10 | ('api', '0007_organization'), 11 | ] 12 | 13 | operations = [ 14 | migrations.AlterField( 15 | model_name='organization', 16 | name='alert_threshold', 17 | field=models.FloatField(default=5.36104950954095e-09), 18 | ), 19 | migrations.AlterField( 20 | model_name='organization', 21 | name='users', 22 | field=models.ManyToManyField(blank=True, related_name='organizations', to=settings.AUTH_USER_MODEL), 23 | ), 24 | ] 25 | -------------------------------------------------------------------------------- /on-orbit-frontend/src/components/ui/input.tsx: -------------------------------------------------------------------------------- 1 | import * as React from "react" 2 | 3 | import { cn } from "@/lib/utils" 4 | 5 | const Input = React.forwardRef>( 6 | ({ className, type, ...props }, ref) => { 7 | return ( 8 | 17 | ) 18 | } 19 | ) 20 | Input.displayName = "Input" 21 | 22 | export { Input } 23 | -------------------------------------------------------------------------------- /Orbit_Predictor-BackEnd/api/migrations/0007_organization.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 5.1.3 on 2025-02-15 23:48 2 | 3 | from django.conf import settings 4 | from django.db import migrations, models 5 | 6 | 7 | class Migration(migrations.Migration): 8 | 9 | dependencies = [ 10 | ('api', '0006_cdm_sat1_catalog_name_cdm_sat1_covariance_method_and_more'), 11 | ] 12 | 13 | operations = [ 14 | migrations.CreateModel( 15 | name='Organization', 16 | fields=[ 17 | ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), 18 | ('name', models.CharField(max_length=255, unique=True)), 19 | ('alert_threshold', models.FloatField(default=1e-09)), 20 | ('users', models.ManyToManyField(related_name='organizations', to=settings.AUTH_USER_MODEL)), 21 | ], 22 | ), 23 | ] 24 | -------------------------------------------------------------------------------- /Orbit_Predictor-BackEnd/orbit_predictor/urls.py: -------------------------------------------------------------------------------- 1 | """ 2 | URL configuration for orbit_predictor project. 3 | 4 | The `urlpatterns` list routes URLs to views. For more information please see: 5 | https://docs.djangoproject.com/en/5.1/topics/http/urls/ 6 | Examples: 7 | Function views 8 | 1. Add an import: from my_app import views 9 | 2. Add a URL to urlpatterns: path('', views.home, name='home') 10 | Class-based views 11 | 1. Add an import: from other_app.views import Home 12 | 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') 13 | Including another URLconf 14 | 1. Import the include() function: from django.urls import include, path 15 | 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) 16 | """ 17 | from django.contrib import admin 18 | from django.urls import include, path 19 | 20 | urlpatterns = [ 21 | # path('admin/', admin.site.urls), 22 | path('api/', include('api.urls')), 23 | ] 24 | -------------------------------------------------------------------------------- /on-orbit-frontend/src/components/footer/page.tsx: -------------------------------------------------------------------------------- 1 | import Link from 'next/link'; 2 | 3 | export default function Footer() { 4 | return ( 5 | 6 |