Skip to the content.

Retrospective

My Top Five Accomplishments

1) Database Management and APIs: I learned how to create databases with SQLite3 Editor. I became proficient in querying the database to extract JSONified python lists, which were in the form of book details and comment details for my feature. I also became proficient in adding and manipulating the data that was added to the database.Database management also helped my implement RESTful APIs using Flask.

2) CRUD Operations: I learned about how to use CRUD methods. It was crucial for me to understand and use Create, Read, Update, and Delete in order for me to use these methods in my code to manipulate comments for each book. post

3) Iteration and Debugging: I learned about the process of iteration. In my journey, one of the main mistakes I made was making too many changes at a time. It was difficult for me to debug my code whenever I made multiple changes to my code at a time, and I learned how to fix this mistake. Instead of making too many major changes, I made one change, iterated over it, and made another change, which greatly improved the quality of my code.

4) Deployment: I learned a lot about deployment. Through lectures and demos, I learned about different ports, docker commands, AWS deployment, servers. I also learned how to build and take down a backend server, which helped in updating our databases and code.

5) Collaboration: My last biggest accomplishment is learning how to collaborate well with my team members. Initially, we had some difficulty in communications and there were some gaps within our feature. However, after recieving feedback, we were able to collaborate as a team to deliver a product that was cohesive and clean. kanban

Night at The Museum

Our group had a very cohesive feature and we presented it really well. Our UI was impressive and our backend was supportive. We also had a good presentation and presentational structure. Some feedback we recieved on our presentation included making a filter for books based on their genres and improving our book diversity. natm

Collegeboard MCQ Analysis:

Between my last MCQ and my current MCQ, I was able to notice a significant improvement in my scores. In trimester 1, my MCQ scores demonstrate a score of 73%, while my Trimester 2 MCQ scores landed at 94%. Personally, I believe this is a huge improvement and really demonstrates my growth over the course of this trimester.

1) My Strenths: Answering questions about code logic and program design and development, identifying and correcting errors, binary numbers, extracting information from data, mathematical expressions, all of the Big Idea 3 topics, and calling and developing procedures.

2) My Weaknesses: Data compression, developing algorithms, the internet, and data abstraction. I also had difficulty with the timing. On average, most of my questions took around 30 seconds to 45 seconds to answer, however I did find myself taking up to five minutes for one or two questions, which can be an issue. MBMCQss

Project Feature Write Up:

Discuss methods in “class” you created to work with columns (create, read, update, delete):

Create: I created a new instance of the Comments class, populated it with data (attributes that correspond to columns in the database), and then add it to the session to be committed.

 def create(self):
        # Check if the comment already exists for this user and book
        existing_comment = Comments.query.filter_by(
            book_id=self.book_id,
            user_id=self.user_id,
            comment_text=self.comment_text
        ).first()

        if existing_comment:
            # If the comment already exists, return a message indicating no change
            return {"message": "Comment already exists for this book and user."}, 400

        try:
            db.session.add(self)
            db.session.commit()
            return {"message": "Comment added successfully."}, 201
        except Exception as e:
            db.session.rollback()
            raise e

Read: I performed queries using SQLAlchemy’s querying methods to retrieve records from the Comments table.

def read(self):
        return {
            'id': self.id,
            'book_id': self.book_id,
            'user_id': self.user_id,
            'comment_text': self.comment_text
        }

Update: I fetch an existing comment, modify its attributes (which are the columns in the table), and then commit the changes to the database.

    def update(self, inputs):
        if not isinstance(inputs, dict):
            return self

        book_id = inputs.get("book_id", None)
        user_id = inputs.get("user_id", None)
        comment_text = inputs.get("comment_text", "")

        if book_id:
            self.book_id = book_id
        if user_id:
            self.user_id = user_id
        if comment_text:
            self.comment_text = comment_text

        try:
            db.session.commit()
        except IntegrityError as e:
            db.session.rollback()
            print(f"IntegrityError occurred: {e}")
            return None

        return self

Delete: I fetch a comment, delete it from the session, and commit the change to remove it from the database.

def delete(self):
        try:
            db.session.delete(self)
            db.session.commit()
        except Exception as e:
            db.session.rollback()
            raise e

A few other requirements:

  • Lists: comment and book informationis formatted in a list
  • Input: Program starts by recieving comment text as an input
  • Algorithm: Below

    Discuss a method/procedure in class that contains sequencing, selection, and iteration.

    1) Sequencing: Each function follows a structured sequence. This is for the comments section.
    1) Fetch data from request body
    2) Validate input fields
    3) Check if book and user exist in database
    4) Add comment to database
    5) Return success message
    2) Conditionals:
    1) GET: must have a valid book_id to get comments for that book
    2) POST: must have valid user_id,book_id, and some comment_text
    3) PUT: must have a proper comment_id
    4) DELETE: must have a proper comment_id

    3) Iteration: used in the get method for comments. For comments, it extracts comment data for each comment associated with a specific book
    Comments: return [{ "id": comment.id, "book_id": comment.book_id, "user_id": comment.user_id, "comment_text": comment.comment_text } for comment in comments_query]

Next steps:

Currently, I’m working on improving security for my feature and adding better admin roles. My next steps would be creating different roles in my feature in order to improve user experience.

My Self Grade

9.2/10

Reasoning:

Top Five Accomplishments: 5/5 for my top five accomplishments. Throughout this trimester, I’ve learned a LOT and grown a lot. I learned a lot about python code, database management, Javascript, APIs, deployment, ports, docker commands, debugging, iteration, collaboration.

Night at the Museum: 1.8/2 points. I rehearsed a lot for my presentation and created a feature that utlizied CRUD, APIs, met collegeboard requirements, was useful, was interesting, and was something I was passionate about. I also believe I delivered my presentation smoothly, used proper language, and explained my methods well to my audience.

Project Feature Write-Up: 0.9/1. Based on the feedback I recieved in my last CPT write-up, I was able to improve my write-up to include more technical language. I thouroughly answered every question to the best of my ability and my feature met all the CollegeBoard Requirements. I was able to talk about the code.

Collegeboard MCQ: 0.9/1: I greatly improved on my Collegeboard MCQ between last time and this time and I also completed the questions within the time limit. My score was 63/67 and I completed it within 1.3 hours.

Extra Point: 0.6/1: I was really interested in another period’s project. They had a similar feature to ours but executed it in a different fashion, focusing on book to movie adaptations. I’ve reflected on my individual strenghths and weaknesses, created a next steps plan, written about my next steps for CompSci, and sent a DM ahead of time regarding my talking points.