Skip to content

NFDI4ING/NFDI4ING-Copilot-Team-Frontend

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NFDI4Ing Copilot

A full-stack application with a FastAPI backend and Next.js frontend for chat-based interactions.

Project Structure

.
├── backend/          # Python FastAPI server
│   ├── index.py      # Main FastAPI application
│   ├── requirements.txt
│   └── venv/         # Python virtual environment (created during setup)
└── frontend/         # Next.js React application
    ├── src/          # Source files
    ├── public/       # Static assets
    └── package.json  # Node.js dependencies

Prerequisites

Make sure you have the following installed on your system:

Getting Started

This project consists of two separate servers that need to run simultaneously:

  1. Backend server (FastAPI) on port 8000
  2. Frontend server (Next.js) on port 3000

Backend Setup

  1. Navigate to the backend directory:
cd backend
  1. Create a Python virtual environment:
python3 -m venv venv
  1. Activate the virtual environment:
# On Linux/Mac:
source venv/bin/activate

# On Windows:
venv\Scripts\activate
  1. Install Python dependencies:
pip install -r requirements.txt
  1. Start the backend server:
uvicorn index:app --reload --host 0.0.0.0 --port 8000

The backend server will be running at http://localhost:8000

You can verify it's working by visiting: http://localhost:8000/healthchecker

Frontend Setup

  1. Open a new terminal window and navigate to the frontend directory:
cd frontend
  1. Install pnpm (if not already installed) and dependencies:
# Install dependencies using npx pnpm
npx pnpm install
  1. Start the frontend development server:
npx pnpm run next-dev

The frontend server will be running at http://localhost:3000

Available API Endpoints

The backend provides the following REST API endpoints:

  • GET /healthchecker - Health check endpoint
  • POST /session/create - Create a new chat session
  • POST /chat/{session_id} - Send a message to a specific session
  • GET /chat/{session_id}/history - Get chat history for a session

Development

Backend

The backend uses:

  • FastAPI - Modern Python web framework
  • Uvicorn - ASGI server
  • Pydantic - Data validation
  • CORS middleware - Enabled for all origins

To make changes to the backend, edit backend/index.py. The server will automatically reload when you save changes (thanks to the --reload flag).

Frontend

The frontend uses:

  • Next.js 15 - React framework
  • React 19 - UI library
  • Tailwind CSS 4 - Styling
  • Framer Motion - Animations
  • pnpm - Package manager

Frontend files are located in frontend/src/. The development server will hot-reload when you make changes.

Troubleshooting

Backend Issues

  • If you get ModuleNotFoundError, make sure your virtual environment is activated
  • If port 8000 is already in use, either stop the other service or change the port in the uvicorn command

Frontend Issues

  • If you get dependency errors, try removing node_modules and pnpm-lock.yaml, then run npx pnpm install again
  • If port 3000 is already in use, Next.js will automatically try port 3001

Permission Issues

  • On Linux/Mac, you may need to use sudo or configure permissions for global npm packages
  • We recommend using npx pnpm instead of installing pnpm globally to avoid permission issues

Next Steps

  • Explore the codebase in backend/index.py and frontend/src/
  • Try making API calls to the backend using the frontend
  • Customize the chat functionality to fit your needs

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • JavaScript 95.5%
  • Python 3.6%
  • CSS 0.9%