A full-stack project with a Django REST API backend and a React frontend to manage GitHub user profiles, supporting full CRUD operations.
-
Build and run backend and database containers:
docker-compose up --build
-
The backend API will be available at:
http://localhost:8000/api/profiles/
-
Navigate to the
frontenddirectory: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
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
- 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 downto stop containers.
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.
- If ports are already in use, stop other services or change the ports in
docker-compose.yml. - Check logs with
docker-compose logsfor backend issues.
Enjoy!