├── backend
├── Dockerfile
├── .dockerignore
├── .gitignore
├── endpoints
│ ├── __init__.py
│ ├── sources.py
│ ├── telescopes.py
│ ├── positions.py
│ ├── users.py
│ ├── readings.py
│ └── commands.py
├── tests
│ ├── __init__.py
│ └── test_database.py
├── classes
│ ├── __init__.py
│ ├── source.py
│ ├── position.py
│ ├── telescope.py
│ ├── user.py
│ ├── command.py
│ ├── reading.py
│ ├── Ifastapi.py
│ └── database.py
├── requirements.txt
└── main.py
├── frontend
├── .dockerignore
├── src
│ ├── app
│ │ ├── app.component.css
│ │ ├── components
│ │ │ ├── cam
│ │ │ │ ├── cam.component.css
│ │ │ │ ├── cam.component.spec.ts
│ │ │ │ ├── cam.component.html
│ │ │ │ └── cam.component.ts
│ │ │ ├── home
│ │ │ │ ├── home.component.css
│ │ │ │ ├── home.component.html
│ │ │ │ ├── home.component.ts
│ │ │ │ └── home.component.spec.ts
│ │ │ ├── users
│ │ │ │ ├── users.component.css
│ │ │ │ ├── users.component.html
│ │ │ │ ├── users.component.ts
│ │ │ │ └── users.component.spec.ts
│ │ │ ├── sign-in
│ │ │ │ ├── sign-in.component.css
│ │ │ │ ├── sign-in.component.spec.ts
│ │ │ │ ├── sign-in.component.ts
│ │ │ │ └── sign-in.component.html
│ │ │ ├── sign-up
│ │ │ │ ├── sign-up.component.css
│ │ │ │ ├── sign-up.component.spec.ts
│ │ │ │ ├── sign-up.component.ts
│ │ │ │ └── sign-up.component.html
│ │ │ ├── sources
│ │ │ │ ├── sources.component.css
│ │ │ │ ├── sources.component.html
│ │ │ │ ├── sources.component.ts
│ │ │ │ └── sources.component.spec.ts
│ │ │ ├── app-layout
│ │ │ │ ├── app-layout.component.css
│ │ │ │ ├── app-layout.component.html
│ │ │ │ ├── app-layout.component.ts
│ │ │ │ └── app-layout.component.spec.ts
│ │ │ ├── commands
│ │ │ │ ├── commands.component.css
│ │ │ │ ├── commands.component.spec.ts
│ │ │ │ ├── commands.component.html
│ │ │ │ └── commands.component.ts
│ │ │ ├── readings
│ │ │ │ ├── readings.component.css
│ │ │ │ ├── readings.component.spec.ts
│ │ │ │ ├── readings.component.html
│ │ │ │ └── readings.component.ts
│ │ │ ├── telescopes
│ │ │ │ ├── telescopes.component.css
│ │ │ │ ├── telescopes.component.spec.ts
│ │ │ │ ├── telescopes.component.html
│ │ │ │ └── telescopes.component.ts
│ │ │ ├── user-details
│ │ │ │ ├── user-details.component.css
│ │ │ │ ├── user-details.component.html
│ │ │ │ ├── user-details.component.ts
│ │ │ │ └── user-details.component.spec.ts
│ │ │ ├── source-details
│ │ │ │ ├── source-details.component.css
│ │ │ │ ├── source-details.component.html
│ │ │ │ ├── source-details.component.ts
│ │ │ │ └── source-details.component.spec.ts
│ │ │ ├── users-details
│ │ │ │ ├── users-details.component.css
│ │ │ │ ├── users-details.component.html
│ │ │ │ ├── users-details.component.ts
│ │ │ │ └── users-details.component.spec.ts
│ │ │ ├── telescope-details
│ │ │ │ ├── telescope-details.component.css
│ │ │ │ ├── telescope-details.component.html
│ │ │ │ ├── telescope-details.component.ts
│ │ │ │ └── telescope-details.component.spec.ts
│ │ │ ├── control-and-monitoring
│ │ │ │ ├── control-and-monitoring.component.css
│ │ │ │ ├── control-and-monitoring.component.html
│ │ │ │ ├── control-and-monitoring.component.ts
│ │ │ │ └── control-and-monitoring.component.spec.ts
│ │ │ └── navbar
│ │ │ │ ├── navbar.component.css
│ │ │ │ ├── navbar.component.spec.ts
│ │ │ │ ├── navbar.component.ts
│ │ │ │ └── navbar.component.html
│ │ ├── app.component.html
│ │ ├── interfaces
│ │ │ ├── create-telescope.ts
│ │ │ ├── user.ts
│ │ │ ├── telescope.ts
│ │ │ ├── command.ts
│ │ │ ├── reading.ts
│ │ │ ├── create-command.ts
│ │ │ └── create-reading.ts
│ │ ├── guards
│ │ │ ├── user.guard.ts
│ │ │ └── user.guard.spec.ts
│ │ ├── app.component.ts
│ │ ├── app.config.ts
│ │ ├── services
│ │ │ ├── user.service.spec.ts
│ │ │ ├── command.service.spec.ts
│ │ │ ├── reading.service.spec.ts
│ │ │ ├── telescope.service.spec.ts
│ │ │ ├── command.service.ts
│ │ │ ├── reading.service.ts
│ │ │ ├── telescope.service.ts
│ │ │ └── user.service.ts
│ │ ├── signal.ts
│ │ ├── app.component.spec.ts
│ │ └── app.routes.ts
│ ├── styles.css
│ ├── environments
│ │ ├── environment.ts
│ │ └── environment.development.ts
│ ├── main.ts
│ └── index.html
├── public
│ ├── favicon.ico
│ └── assets
│ │ ├── meerkat.avif
│ │ ├── sarao-logo.png
│ │ └── sarao-evening-observation.jpg
├── .editorconfig
├── tsconfig.app.json
├── tsconfig.spec.json
├── .gitignore
├── Dockerfile
├── tsconfig.json
├── package.json
├── README.md
└── angular.json
├── .gitignore
├── README.md
├── docker-compose.yaml
└── design
├── architecture.drawio
└── database.drawio
/backend/Dockerfile:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/backend/.dockerignore:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/frontend/.dockerignore:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | venv*
2 |
3 | __pycache__*
--------------------------------------------------------------------------------
/backend/.gitignore:
--------------------------------------------------------------------------------
1 | *.db
2 |
3 | *.env
--------------------------------------------------------------------------------
/frontend/src/app/app.component.css:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/backend/endpoints/__init__.py:
--------------------------------------------------------------------------------
1 | from .users import *
--------------------------------------------------------------------------------
/backend/tests/__init__.py:
--------------------------------------------------------------------------------
1 | from .test_database import *
--------------------------------------------------------------------------------
/frontend/src/app/components/cam/cam.component.css:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/frontend/src/app/components/home/home.component.css:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/frontend/src/app/components/users/users.component.css:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/frontend/src/app/components/sign-in/sign-in.component.css:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/frontend/src/app/components/sign-up/sign-up.component.css:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/frontend/src/app/components/sources/sources.component.css:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/frontend/src/app/components/app-layout/app-layout.component.css:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/frontend/src/app/components/commands/commands.component.css:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/frontend/src/app/components/readings/readings.component.css:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/frontend/src/app/components/telescopes/telescopes.component.css:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/frontend/src/app/app.component.html:
--------------------------------------------------------------------------------
1 |
users works!
2 | -------------------------------------------------------------------------------- /backend/classes/__init__.py: -------------------------------------------------------------------------------- 1 | from .user import User 2 | from .database import Database -------------------------------------------------------------------------------- /frontend/src/app/components/control-and-monitoring/control-and-monitoring.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /frontend/src/app/components/sources/sources.component.html: -------------------------------------------------------------------------------- 1 |sources works!
2 | -------------------------------------------------------------------------------- /frontend/src/app/components/user-details/user-details.component.html: -------------------------------------------------------------------------------- 1 |user-details works!
2 | -------------------------------------------------------------------------------- /frontend/src/app/components/users-details/users-details.component.html: -------------------------------------------------------------------------------- 1 |users-details works!
2 | -------------------------------------------------------------------------------- /frontend/src/app/components/source-details/source-details.component.html: -------------------------------------------------------------------------------- 1 |source-details works!
2 | -------------------------------------------------------------------------------- /frontend/src/styles.css: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | -------------------------------------------------------------------------------- /frontend/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ska-sa/astt-2024-software/master/frontend/public/favicon.ico -------------------------------------------------------------------------------- /frontend/src/app/components/home/home.component.html: -------------------------------------------------------------------------------- 1 |telescope-details works!
2 | -------------------------------------------------------------------------------- /frontend/src/app/components/app-layout/app-layout.component.html: -------------------------------------------------------------------------------- 1 |control-and-monitoring works!
2 | -------------------------------------------------------------------------------- /frontend/public/assets/sarao-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ska-sa/astt-2024-software/master/frontend/public/assets/sarao-logo.png -------------------------------------------------------------------------------- /frontend/src/app/interfaces/create-telescope.ts: -------------------------------------------------------------------------------- 1 | export interface CreateTelescope { 2 | name: string; 3 | health_status: number; 4 | } -------------------------------------------------------------------------------- /frontend/src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true, 3 | host: "localhost", 4 | port: 8000 5 | }; 6 | -------------------------------------------------------------------------------- /frontend/public/assets/sarao-evening-observation.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ska-sa/astt-2024-software/master/frontend/public/assets/sarao-evening-observation.jpg -------------------------------------------------------------------------------- /frontend/src/environments/environment.development.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: false, 3 | host: "localhost", 4 | port: 8000 5 | }; 6 | -------------------------------------------------------------------------------- /frontend/src/app/interfaces/user.ts: -------------------------------------------------------------------------------- 1 | export interface User { 2 | id: number; 3 | email_address: string; 4 | password: string; 5 | create_at: Date; 6 | } 7 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ASTT Software 2 | 3 | ## Description 4 | 5 | ## Getting Started 6 | 7 | ## Design Diagrams 8 | 9 | ## Testing 10 | 11 | ## Conclusion 12 | -------------------------------------------------------------------------------- /frontend/src/app/interfaces/telescope.ts: -------------------------------------------------------------------------------- 1 | export interface Telescope { 2 | id: number; 3 | name: string; 4 | health_status: number; 5 | created_at: Date; 6 | } 7 | -------------------------------------------------------------------------------- /frontend/src/app/interfaces/command.ts: -------------------------------------------------------------------------------- 1 | import { CreateCommand } from "./create-command"; 2 | 3 | export interface Command extends CreateCommand { 4 | id: number; 5 | created_at: Date; 6 | } 7 | -------------------------------------------------------------------------------- /frontend/src/app/interfaces/reading.ts: -------------------------------------------------------------------------------- 1 | import { CreateReading } from "./create-reading"; 2 | 3 | export interface Reading extends CreateReading { 4 | id: number; 5 | created_at: Date; 6 | } 7 | 8 | -------------------------------------------------------------------------------- /frontend/src/app/interfaces/create-command.ts: -------------------------------------------------------------------------------- 1 | export interface CreateCommand { 2 | user_id: number; 3 | telescope_id: number; 4 | target_az_angle: number; 5 | target_el_angle: number; 6 | } 7 | -------------------------------------------------------------------------------- /frontend/src/app/interfaces/create-reading.ts: -------------------------------------------------------------------------------- 1 | export interface CreateReading { 2 | telescope_id: number; 3 | az_angle: number; 4 | el_angle: number; 5 | health_status: string; 6 | movement_status: string; 7 | } -------------------------------------------------------------------------------- /frontend/src/app/guards/user.guard.ts: -------------------------------------------------------------------------------- 1 | import { CanActivateFn } from '@angular/router'; 2 | import { getUser } from '../signal'; 3 | 4 | export const userGuard: CanActivateFn = (route, state) => { 5 | return getUser() !== null; 6 | }; 7 | -------------------------------------------------------------------------------- /backend/classes/source.py: -------------------------------------------------------------------------------- 1 | from datetime import datetime 2 | from pydantic import BaseModel 3 | 4 | class CreateSource(BaseModel): 5 | name: str 6 | 7 | class Source(CreateSource): 8 | id: int 9 | 10 | class Config: 11 | from_attributes = True -------------------------------------------------------------------------------- /frontend/src/main.ts: -------------------------------------------------------------------------------- 1 | import { bootstrapApplication } from '@angular/platform-browser'; 2 | import { appConfig } from './app/app.config'; 3 | import { AppComponent } from './app/app.component'; 4 | 5 | bootstrapApplication(AppComponent, appConfig) 6 | .catch((err) => console.error(err)); 7 | -------------------------------------------------------------------------------- /frontend/src/app/components/users/users.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-users', 5 | imports: [], 6 | templateUrl: './users.component.html', 7 | styleUrl: './users.component.css' 8 | }) 9 | export class UsersComponent { 10 | 11 | } 12 | -------------------------------------------------------------------------------- /backend/classes/position.py: -------------------------------------------------------------------------------- 1 | from datetime import datetime 2 | from pydantic import BaseModel 3 | 4 | class CreatePosition(BaseModel): 5 | datetime : datetime 6 | 7 | class Position(CreatePosition): 8 | id: int 9 | created_at: datetime 10 | 11 | class Config: 12 | from_attribute = True -------------------------------------------------------------------------------- /frontend/src/app/components/sources/sources.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-sources', 5 | imports: [], 6 | templateUrl: './sources.component.html', 7 | styleUrl: './sources.component.css' 8 | }) 9 | export class SourcesComponent { 10 | 11 | } 12 | -------------------------------------------------------------------------------- /backend/classes/telescope.py: -------------------------------------------------------------------------------- 1 | from datetime import datetime 2 | from pydantic import BaseModel 3 | 4 | class CreateTelescope(BaseModel): 5 | name: str 6 | health_status: int 7 | 8 | class Telescope(CreateTelescope): 9 | id: int 10 | created_at: datetime 11 | 12 | class Config: 13 | from_attributes = True -------------------------------------------------------------------------------- /frontend/src/app/components/navbar/navbar.component.css: -------------------------------------------------------------------------------- 1 | .nav-link { 2 | cursor: pointer; 3 | transition: transform 0.2s, font-weight 0.2s; 4 | margin-left: 20px; 5 | color: #0d6efd; 6 | } 7 | .nav-link:hover { 8 | transform: scale(1.1); 9 | font-weight: bolder; 10 | } 11 | 12 | .nav-link.active { 13 | font-weight: bold; 14 | } 15 | -------------------------------------------------------------------------------- /frontend/src/app/components/user-details/user-details.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-user-details', 5 | imports: [], 6 | templateUrl: './user-details.component.html', 7 | styleUrl: './user-details.component.css' 8 | }) 9 | export class UserDetailsComponent { 10 | 11 | } 12 | -------------------------------------------------------------------------------- /frontend/src/app/components/users-details/users-details.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-users-details', 5 | imports: [], 6 | templateUrl: './users-details.component.html', 7 | styleUrl: './users-details.component.css' 8 | }) 9 | export class UsersDetailsComponent { 10 | 11 | } 12 | -------------------------------------------------------------------------------- /backend/classes/user.py: -------------------------------------------------------------------------------- 1 | from dataclasses import dataclass 2 | from datetime import datetime 3 | from pydantic import BaseModel 4 | 5 | class CreateUser(BaseModel): 6 | email_address: str 7 | password: str 8 | 9 | class User(CreateUser): 10 | id: int 11 | created_at: datetime 12 | 13 | class Config: 14 | from_attributes = True 15 | -------------------------------------------------------------------------------- /backend/requirements.txt: -------------------------------------------------------------------------------- 1 | annotated-types==0.7.0 2 | anyio==4.9.0 3 | click==8.1.8 4 | exceptiongroup==1.2.2 5 | fastapi==0.115.12 6 | h11==0.16.0 7 | idna==3.10 8 | pydantic==2.11.4 9 | pydantic_core==2.33.2 10 | python-dotenv==1.1.0 11 | sniffio==1.3.1 12 | starlette==0.46.2 13 | typing-inspection==0.4.0 14 | typing_extensions==4.13.2 15 | uvicorn==0.34.2 16 | -------------------------------------------------------------------------------- /frontend/src/app/components/source-details/source-details.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-source-details', 5 | imports: [], 6 | templateUrl: './source-details.component.html', 7 | styleUrl: './source-details.component.css' 8 | }) 9 | export class SourceDetailsComponent { 10 | 11 | } 12 | -------------------------------------------------------------------------------- /frontend/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 || ID | 5 |Telescope Name | 6 |Heath Status | 7 |Mode | 8 |Movenment Status | 9 |Azimuth Angle | 10 |Elevation Angle | 11 |Created At | 12 |
|---|---|---|---|---|---|---|---|
| 1 | 17 |ASTT 2024 | 18 |Normal | 19 |Pointing | 20 |Stopped | 21 |32.50 ° | 22 |67.87 ° | 23 |03/05/2025 15:14:30 | 24 |
| ID | 13 |User Email | 14 |Telescope Name | 15 |Target Azimuth Angle | 16 |Target Elevation Angle | 17 |Created At | 18 |
|---|---|---|---|---|---|
| {{i + 1}} | 23 |{{ getUserById(command.user_id)?.email_address ?? 'Unknown User' }} | 24 |{{ command.telescope_id }} | 25 |{{ command.target_az_angle }} ° | 26 |{{ command.target_el_angle }} ° | 27 |{{ command.created_at | date: 'short' }} | 28 |
10 | Sign In
11 | | # | 7 |Telescope Name | 8 |Health Status | 9 |Created At | 10 |Action | 11 |
|---|---|---|---|---|
| 16 | | 17 | 18 | | 19 |20 | | 21 | | 22 | 26 | | 27 |
| 31 | No Data! 32 | | 33 |||||
| {{ i + 1 }} | 37 |{{ telescope.name }} | 38 |{{ telescope.health_status }} | 39 |{{ telescope.created_at | date }} | 40 |41 | 45 | 49 | 53 | | 54 |
10 | Sign Up
11 |