About the Project

Inspiration

The inspiration for this project came from a fascination with space exploration and interplanetary missions, especially the complex calculations involved in planning launch windows from Earth to Mars. Understanding the orbital mechanics and determining optimal launch periods presented an exciting challenge that combined astronomy and programming.

What I Learned

Throughout the development process, I gained deeper insights into:

  • Astronomical Calculations: Utilizing the Skyfield library to compute planetary positions and phase angles accurately.
  • Backend Development: Building a robust RESTful API with Flask and optimizing performance using multiprocessing.
  • Frontend Development: Creating an interactive user interface with Vue.js, including implementing date pickers and handling user inputs.
  • Cross-Origin Resource Sharing (CORS): Configuring Flask-CORS to enable seamless communication between the frontend and backend.
  • Production Deployment: Implementing a production-ready WSGI server using Waitress and addressing deployment challenges on Windows.

How I Built the Project

Backend

The backend was developed using Python with the Flask framework. Key technologies and steps included:

  • Astronomical Computations: Leveraged the Skyfield library to calculate the phase angle between Earth and Mars, which is critical for determining launch windows.
  • API Development: Structured the application with blueprints, controllers, services, and utilities for clean code organization.
  • Performance Optimization: Implemented multiprocessing with Python's multiprocessing module to handle intensive calculations efficiently.
  • CORS Configuration: Used Flask-CORS to allow the frontend application to communicate with the backend API without cross-origin issues.
  • Production Server: Deployed the application using Waitress, a production-grade WSGI server suitable for Windows environments.

Frontend

The frontend was created using Vue.js, a progressive JavaScript framework. Key aspects included:

  • User Interface: Designed a responsive and intuitive UI that allows users to select a target date and retrieve the next optimal launch window.
  • Date Picker Component: Implemented a date selection feature using compatible Vue.js components that support Vue 3.
  • API Integration: Employed Axios for making asynchronous HTTP requests to the backend API.
  • State Management: Managed application state effectively to provide real-time feedback to the user.

Challenges Faced

  • Component Compatibility: Faced issues with Vue.js components not being compatible with Vue 3, leading to runtime errors. Resolved by finding and integrating alternative components that support the latest version.
  • Astronomical Data Accuracy: Ensuring precise calculations required a solid understanding of orbital mechanics and careful handling of astronomical data.
  • CORS Issues: Encountered cross-origin request problems, which were resolved by properly configuring Flask-CORS on the backend.
  • Performance Concerns: The computationally intensive nature of astronomical calculations necessitated performance optimization through multiprocessing.
  • Deployment on Windows: Setting up a production-ready environment on Windows involved configuring Waitress and adjusting firewall settings to allow external connections.

By combining both frontend and backend technologies, this project not only provided a functional tool for calculating Earth-to-Mars launch windows but also offered valuable learning experiences in full-stack development and the intricacies of deploying web applications.

Built With

Share this project:

Updates