A real-time chat application that allows users in the same network to communicate through a modern interface.
simple-chat/
├── backend/ # FastAPI backend
│ ├── main.py # Main application file
│ └── requirements.txt
└── frontend/ # Svelte frontend
├── src/
│ ├── components/
│ │ ├── UserList.svelte # User list component
│ │ └── ChatWindow.svelte # Chat interface component
│ ├── App.svelte
│ ├── main.js
│ └── app.css
├── public/
├── package.json
└── vite.config.js
cd backend
pip install -r requirements.txt
cd frontend
npm install
The easiest way to run the application is using Docker and Docker Compose with our single-container setup:
docker-compose up --build
You can also build and run the container manually:
# Build the image
docker build -t simple-chat .
# Run the container
docker run -p 8000:8000 -p 5173:5173 simple-chat
cd backend
uvicorn main:app --reload --host 0.0.0.0 --port 8000
This will start the FastAPI server on port 8000.
cd frontend
npm run dev -- --host
This will start the Svelte development server, usually on port 5173.
By default, the application is configured to work on a local network:
Make sure to allow these ports through your firewall if you want others on the same network to connect.
/backend/main.py
to change server behavior or nickname generation/frontend/src/components/
to customize the UI