This is the backend API for the project. It is built using FastAPI and provides endpoints for fetching LinkedIn and GitHub data.
Before running the backend, ensure you have the following installed:
- Python 3.10 or higher
- pip (Python package manager)
-
Clone the repository:
git clone <repository_url> cd <repository_directory>
-
Create a virtual environment:
python -m venv venv
-
Activate the virtual environment:
-
On macOS/Linux:
source venv/bin/activate
-
On Windows:
.\venv\Scripts\activate
-
-
Install dependencies:
pip install -r requirements.txt
-
Start the FastAPI server:
uvicorn main:app --reload
The server will start at
http://localhost:8000
. -
Verify the server is running by visiting the automatically generated API docs:
- Swagger UI:
http://localhost:8000/docs
- ReDoc:
http://localhost:8000/redoc
- Swagger UI:
The backend is configured to allow requests from http://localhost:3000
using FastAPI's CORSMiddleware
. This is necessary for the frontend to make API requests to the backend.
- URL:
http://localhost:8000/linkedin
- Method:
GET
- Description: Fetches LinkedIn data.
- URL:
http://localhost:8000/github
- Method:
GET
- Description: Fetches GitHub data.
- Update the
.env
file with any required environment variables. - To add new endpoints, modify the
main.py
file.
- If you encounter CORS issues, ensure the frontend is running on
http://localhost:3000
and matches the allowed origins in the backend. - For missing dependencies, re-run
pip install -r requirements.txt
.
This project is licensed under the MIT License.