How cyfer-ap/n-sih-1 works
Project type and purpose
• This is a monolithic full-stack Django web application (“N-SIH: NASA–ISRO Satellite Explorer”) that serves dynamic HTML/CSS/JS pages, pulls data from external APIs (NASA & N2YO), and uses static JSON for some ISRO mission data.
• It exposes multiple user-facing modules (APOD, Mars gallery, Earth imagery, satellite trackers, space weather, ISRO missions) via two Django apps: nasa_app and isro.
File structure
• Top-level:
• manage.py, requirements.txt, render.yaml, .gitignore
• nasa_project/ – Django project settings, ASGI/WSGI entrypoints
• nasa_app/ – Core NASA-related features (views, templates, static assets)
• isro/ – ISRO-related features (static JSON, views, templates)
• db.sqlite3 – local development database
• Each app follows Django conventions:
• models.py, views.py, urls.py, templates/<app>/, static/<app>/
• migrations/ for schema changes
• Configuration / deployment:
• python-dotenv for .env (API keys)
• gunicorn, whitenoise for production
• render.yaml for Render.com deployment
Key insights from the README
• Real-time API integrations: NASA APOD, Mars Rover, Media Library, Earth Imagery, N2YO satellite tracker
• Static mission data in JSON for ISRO module
• Vanilla frontend (HTML, CSS, JS) served by Django templates and static files
• SQLite for local dev but interchangeable with any relational DB
Main components & interactions
a. Users & Clients
• Web browser or mobile browser (HTML/CSS/JS)
b. Frontend Layer (served by Django)
• Templates (*.html), CSS (*.css), JS (*.js), JSON static files
• Whitenoise middleware serves static assets in production
c. Django Application Layer
• nasa_project (project settings & URL router)
• Two Django apps:
– nasa_app.views → pulls from NASA APIs, renders templates
– isro.views → reads static JSON, calls N2YO for live ISRO tracking
• Models: minimal or none (data mostly transient or static JSON)
d. Database
• SQLite (via Django ORM) – used for any persisted data (e.g., user settings if extended)
e. External Services
• NASA APIs (APOD, Rover, Media, Earth Imagery)
• N2YO Satellite Tracking API
f. Deployment & Infrastructure
• Gunicorn (WSGI server) behind a load balancer
• Environment variables (.env) for secrets
• Optional CDN for static content
Architectural patterns & design principles
• Monolithic MVC:
• Views handle HTTP, orchestrate data fetch (API/DB/static), choose template
• Templates handle view logic → static assets
• Models minimal; mostly for Django defaults
• Separation of concerns:
• Two apps (NASA vs ISRO) for modularity
• Static JSON vs live API calls clearly distinguished
• External integration layer:
• Abstract each external API call in its own view or utility function
• Caching or rate-limit safeguards (future improvement)