Skip to content

This project is a personal website backend developed using Python and FastAPI, providing APIs to manage and serve dynamic content for the frontend.

Notifications You must be signed in to change notification settings

RicoRF/PersonalWebsite-BackEnd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Backend API - FastAPI

This is the backend API for the project. It is built using FastAPI and provides endpoints for fetching LinkedIn and GitHub data.

Requirements

Before running the backend, ensure you have the following installed:

  • Python 3.10 or higher
  • pip (Python package manager)

Installation

  1. Clone the repository:

    git clone <repository_url>
    cd <repository_directory>
  2. Create a virtual environment:

    python -m venv venv
  3. Activate the virtual environment:

    • On macOS/Linux:

      source venv/bin/activate
    • On Windows:

      .\venv\Scripts\activate
  4. Install dependencies:

    pip install -r requirements.txt

Running the Backend

  1. Start the FastAPI server:

    uvicorn main:app --reload

    The server will start at http://localhost:8000.

  2. Verify the server is running by visiting the automatically generated API docs:

    • Swagger UI: http://localhost:8000/docs
    • ReDoc: http://localhost:8000/redoc

CORS Configuration

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.

API Endpoints

LinkedIn Data

  • URL: http://localhost:8000/linkedin
  • Method: GET
  • Description: Fetches LinkedIn data.

GitHub Data

  • URL: http://localhost:8000/github
  • Method: GET
  • Description: Fetches GitHub data.

Development Notes

  • Update the .env file with any required environment variables.
  • To add new endpoints, modify the main.py file.

Troubleshooting

  • 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.

License

This project is licensed under the MIT License.

About

This project is a personal website backend developed using Python and FastAPI, providing APIs to manage and serve dynamic content for the frontend.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages