About the Project

Inspiration

The inspiration for NightSchool AI came from my desire to explore how technology can make the most of untapped hours during sleep. I was fascinated by the concept of memory consolidation during REM sleep and wanted to leverage it to make learning more effective and accessible. The idea of turning dreams into a productive, engaging learning experience sparked my creativity and led to the creation of this innovative application.

What I Learned

Throughout this project, I learned:

  • The importance of REM sleep in memory retention and how auditory stimuli can enhance this process.
  • How to integrate APIs like OpenAI to generate high-quality, educational content.
  • Building a Flask application that is scalable, efficient, and user-friendly.
  • Deploying a live app on PythonAnywhere, including managing deployment intricacies like static files and environment configurations.
  • Using PearAI for testing and debugging, which significantly improved the quality and efficiency of my code.

How I Built It

  1. Backend:

    • I developed the backend using Flask, ensuring robust and efficient request handling.
    • I integrated OpenAI GPT API to generate personalized, educational stories tailored to user inputs.
    • I designed functions to convert text into soothing audio for bedtime listening.
  2. Frontend:

    • I created the frontend with HTML, CSS, and TailwindCSS to provide a clean and responsive user interface.
    • I implemented JavaScript to enable seamless user interactions for topic submission and audio playback.
  3. Deployment:

    • I deployed the app on PythonAnywhere using their Basic Plan ($5/month), ensuring accessibility and reliability.
    • I configured static file handling and environment variables to ensure smooth performance.
  4. Testing and Debugging:

    • I used PearAI to validate functions, debug effectively, and optimize performance, which streamlined the development process.

Challenges I Faced

Building NightSchool AI wasn’t without its challenges:

  • Crafting Effective Prompts: Ensuring that AI-generated stories were both engaging and accurate required me to iterate and refine prompts for OpenAI.
  • UI Optimization: Designing a simple yet visually appealing user interface was challenging and required continuous feedback and iteration.
  • Deployment Hurdles: Setting up static files, environment variables, and API keys on PythonAnywhere involved a steep learning curve.
  • Performance Tuning: Debugging and testing with large inputs pushed me to come up with creative solutions and leverage tools like PearAI.

Conclusion

NightSchool AI has been a transformative project for me, blending cutting-edge AI, scientific research, and thoughtful design. It has not only expanded my technical skills but also reinforced the value of using technology to make learning accessible, relaxing, and effective. This project reflects my passion for innovation and determination to bring ideas to life.

Built With

  • bash-console
  • css
  • dotenv-(for-environment-variables)
  • fetch-api-(for-frontend-backend-communication)
  • flask
  • flask-(backend)
  • for
  • html
  • javascript
  • openai-(api-access)
  • openai-gpt-api-(story-generation-and-text-to-speech)
  • pearai
  • python
  • pythonanywhere
  • pythonanywhere-(deployment)
  • pythonanywhere-(hosting)
  • sftp
  • tailwindcss-(frontend)
Share this project:

Updates