Skip to content

ankikumar1018/github_api_project

Repository files navigation

GitHub Profiles API & Frontend

Overview

A full-stack project with a Django REST API backend and a React frontend to manage GitHub user profiles, supporting full CRUD operations.


Prerequisites


Setup and Run

1. Backend


2. Frontend

  • Navigate to the frontend directory:

    cd frontend
  • Build and run the frontend Docker container:

    docker build -t github-profiles-frontend .
    docker run -p 3000:3000 github-profiles-frontend
  • The frontend will be accessible at:
    http://localhost:3000


Environment Variables

Create a .env file in your backend directory with:

DEBUG=True
SECRET_KEY=your-secret-key
ALLOWED_HOSTS=*
POSTGRES_DB=github_db
POSTGRES_USER=github_user
POSTGRES_PASSWORD=github_pass
POSTGRES_HOST=db
POSTGRES_PORT=5432
GITHUB_API_URL=https://api.github.com/users/
GITHUB_API_TOKEN= # optional

Notes

  • Ensure Docker daemon is running before starting.
  • Backend uses PostgreSQL in a Docker container.
  • Frontend communicates with backend via http://localhost:8000/api/profiles/.
  • For development, you can use docker-compose down to stop containers.

API Endpoints

  • GET /api/profiles/ — List all GitHub users.
  • POST /api/profiles/ — Create user by GitHub username.
  • GET /api/profiles/{id}/ — Retrieve user.
  • PUT/PATCH /api/profiles/{id}/ — Update user.
  • DELETE /api/profiles/{id}/ — Delete user.

Troubleshooting

  • If ports are already in use, stop other services or change the ports in docker-compose.yml.
  • Check logs with docker-compose logs for backend issues.

Enjoy!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published