Giter Site home page Giter Site logo

airbnb_clone_v3's Introduction

Hello there👋, I'm Munga

AI Software Engineer

mungasoftwiz

  • 🔭 I’m currently working on AI projects at Headstarter AI

  • 🌱 I’m currently learning about LLMs, RAG, Generative AI

  • 💬 Ask me about Backend Engineering and System Design

  • ⚡ Fun fact: I once created an 'Oops' loop so infinite it took 3 cups of coffee to break free!.

Connect and reach me 🤝📫:

X(formerly twitter) LinkedIn Profile Email

Munga's Tech Toolbox 🧰:

c go python flask sqlalchemy ORM jinja2 poetry nginx Rest API json sql mysql bash git linux puppet pytest postman vim vscode github

airbnb_clone_v3's People

Contributors

alexaorrico avatar droffilc1 avatar jhuang10123 avatar jvpupcat avatar mungasoftwiz avatar

airbnb_clone_v3's Issues

feat: improve storage

Update DBStorage and FileStorage, adding two new methods. All changes should be done in the branch storage_get_count:

  1. A method to retrieve one object:
  • Prototype: def get(self, cls, id):
  • Returns the object based on the class and its ID, or None if not found.
  1. A method to count the number of objects in storage:
  • Prototype: def count(self, cls=None):
  • Returns the number of objects in storage matching the given class. If no class is passed, returns the count of all objects in storage.

test: add new tests as much as you can

Since the beginning we’ve been using the unittest module, but do you know why unittests are so important?

Because when you add a new feature, you refactor a piece of code, etc… you want to be sure you didn’t break anything.

The following requirements must be met for your project:

  1. All current tests must pass (don’t delete them…)
  2. Add new tests as much as you can (tests are mandatory for some tasks)

feat: add page not found

Designers are really creative when they have to design a “404 page”, a “Not found”

Today it’s different, because you won’t use HTML and CSS, but JSON!

In api/v1/app.py, create a handler for 404 errors that returns a JSON-formatted 404 status code response. The content should be: "error": "Not found"

feat: start API development(status of your API)

Your first endpoint (route) will be to return the status of your API:

  • Create a folder api at the root of the project with an empty file __init__.py
  • Create a folder v1 inside api: this is where you will create the application file, methods, host and port parameters.
  • Create a folder views inside v1: this is where you will create the blueprint and views.

feat: HTTP access control (CORS)

CORS
A resource makes a cross-origin HTTP request when it requests a resource from a different domain, or port, than the one the first resource itself serves.

Why do we need this?
Because you will soon start allowing a web client to make requests your API. If your API doesn’t have a correct CORS setup, your web client won’t be able to access your data.

With Flask, it’s really easy, you will use the class CORS of the module flask_cors.

How to install it: $ pip3 install flask_cors
Update api/v1/app.py to create a CORS instance allowing: /* for 0.0.0.0

feat: some stats?

Create an endpoint that retrieves the number of each objects by type:

  • In api/v1/views/index.py
  • Route: /api/v1/stats
  • You must use the newly added count() method from storage

NB: No need to have a pretty rendered output, it’s a JSON, only the structure is important

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.