Coder Social home page Coder Social logo

githubrepoapi's Introduction

GithubRepoAPI

A simple FastAPI application for demo GitHub repositories API with PostgreSQL integration.

Running Integration Tests

This project uses pytest for integration testing. Follow these steps to run the tests:

  1. Navigate to the project directory:

    cd GithubRepoAPI
  2. Run the tests with pytest:

    pytest tests/

This will run all the test cases located in the tests/ directory. pytest will automatically discover and run all test cases in this directory that follow its naming conventions.

Running with Docker Compose

  1. Clone the repository:
    git clone https://github.com/weiczhu/GithubRepoAPI.git
    
  2. Navigate to the project directory:
    cd GithubRepoAPI
    
  3. Build and start the Docker containers:
    docker-compose up --build
    

The application should now be running at http://localhost:8000.

Testing the Project

You can test the project by making a GET request to the /repositories/{owner}/{repo} endpoint. For example, to get the details of the Hello-World repository owned by octocat, you can use the following curl command:

curl http://0.0.0.0:8000/repositories/octocat/Hello-World

This should return a JSON response with the details of the Hello-World repository. Here's an example of what the response might look like:

{
"fullName": "octocat/Hello-World",
"description": "My first repository on GitHub!",
"cloneUrl": "https://github.com/octocat/Hello-World.git",
"stars": 2516,
"createdAt": "2011-01-26T19:01:12"
}

Stopping the Project

To stop the Docker containers, use the following command:

docker-compose down

githubrepoapi's People

Contributors

weiczhu avatar

Watchers

 avatar

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.