🎨

Brainstorming

 
Note: I used this space to brainstorming and document my thoughts throughout this project. Here, you'll find a collection of various approaches, resources I've used, and random notes.
 
Rough System Design Diagram:
notion image
 
General Workflow:
initial_suggestion —> reflection —> calculate diff —> return diff
 

Deliverables


  • Repo on Github
    • Add codegen-team
  • A README for how to hit the public URL & get it running on our machines
    • Assume we are on Mac OS
 

TinyGen Project Checklist

1. Project Setup

Create GitHub repository.
Add codegen-team to the repository collaborators.
Initialize README.md file.
Set up environment for Python development.

2. Design and Architecture

Define the overall architecture of the system.
Plan file structure according to the proposed layout.
Determine the technology stack and libraries to be used.
Sketch out the workflow for code generation and reflection.

3. FastAPI API Development

Implement FastAPI endpoints for handling POST requests.
Write code to accept repoUrl and prompt inputs.
Develop logic to generate unified diff based on inputs.
Integrate ChatGPT for reflection step.
Test API endpoints for functionality and correctness.

4. Supabase Integration (Bonus Objective)

Set up Supabase database.
Implement functionality to store inputs/outputs in the database.
Test database integration for reliability and scalability.

5. Documentation

Write comprehensive README.md file.
Include setup instructions for accessing the public URL.
Provide guidelines for running the project on Mac OS.
Document any dependencies or prerequisites for deployment.

6. Deployment

Deploy the API live on the web.
Ensure accessibility for testing purposes.
Monitor for any issues or errors post-deployment.
 
 

Approach:

  • Understand project requirements thoroughly.
  • Conduct research on similar projects and technologies.
  • Finalize the technology stack.
  • Design the architecture considering scalability and maintainability.
  • Break down development into manageable iterations.
  • Implement testing for reliability and correctness.
  • Maintain comprehensive documentation.
  • Regular communication with the employer for alignment.
 

File Structures:

  • app/
    • app.py
    • Utility functions:
      • database.py
      • chatgpt_interaction.py
      • github_interaction.py
      • calculate_diff.py
  • tests/
    • test_api.py: API endpoint tests.
    • test_tinygen.py: Code generation logic tests.
    •  
  • .env: Environment variables.
  • README.md: Project documentation.
  • requirements.txt: Python dependencies.
 

Technologies Used:

  • Python: Primary language for backend development.
  • FastAPI: Web framework for building APIs.
  • Supabase: Database integration for storage.
  • ChatGPT: AI model for reflection and verification.
 

Next Steps:

  • Set up the development environment.
  • Initialize the project repository.
  • Begin implementation iteratively.
  • Conduct testing and refinement stages.
  • Ensure alignment with employer's expectations.
  • Deliver a valuable solution.
 
 
Light Testing:
"repoUrl": "https://github.com/Deniz-Jasa/Python-Project-Euler", "prompt": "Change problem 1 to java only. Keep the rest as python."
 
notion image
 
 
notion image
notion image
 
Diff Response:
notion image
 
 
ChatGPT API Usage:
notion image
 
 
Nginx Setup:
notion image
 
Initial run on EC2:
notion image
 
notion image
 
notion image
 
Correctly added to Supabase!!
notion image
 

Next Steps:

 
  • Add auth
  • Add tests
  • Use custom gpt models