A FastAPI-based backend application for DeloConnect, featuring employee management, chat functionality, and HR operations.
- Employee Management System
- Real-time Chat System
- HR Operations Dashboard
- Authentication & Authorization
- MongoDB Database Integration
- WebSocket Support for Real-time Updates
- API Documentation with Swagger UI
- Python 3.8 or higher
- MongoDB Atlas account (or other hosted MongoDB service)
- Docker (optional, for containerized deployment)
- Clone the repository:
git clone <repository-url>
cd backend- Create and activate a virtual environment:
# Windows
python -m venv venv
.\venv\Scripts\activate
# Linux/Mac
python3 -m venv venv
source venv/bin/activate- Install dependencies:
pip install -r requirements.txt- Create a
.env.devfile in the root directory:
cp .env.sample .env.dev- Configure the environment variables in
.env.dev:
# Database Configuration
DATABASE_URL=mongodb+srv://<username>:<password>@<cluster>.mongodb.net/<database>?retryWrites=true&w=majority
# Security Configuration
secret_key=your-secure-secret-key-here
# Email Configuration
sender_email=your-email@example.com
sender_password=your-email-password
email_template=path/to/email/template.html
admin_email_template=path/to/admin/email/template.html
# LLM Configuration
LLM_ADDR=http://your-llm-service:portNote: Replace the DATABASE_URL with your actual MongoDB Atlas connection string. You can get this from your MongoDB Atlas dashboard:
- Go to your cluster
- Click "Connect"
- Choose "Connect your application"
- Copy the connection string and replace
<username>,<password>,<cluster>, and<database>with your actual values
- Build and run the application:
docker-compose up --build- Access the application at
http://localhost:8080
- Run the application:
python main.pyThe application will be available at http://localhost:8080
Once the application is running, you can access the API documentation at:
- Swagger UI:
http://localhost:8080/docs - ReDoc:
http://localhost:8080/redoc
backend/
├── main.py # Application running point
├── app.py # Application entry point
├── auth/ # Authentication
├── employee_filtering/ # Employee filtering API
├── config/ # Configuration files
├── models/ # Database models
├── routes/ # API routes
├── utils/ # Utility functions
- Make sure you have a valid MongoDB Atlas connection string in your
.env.devfile - Update other environment variables as needed
- Run the application using either Docker Compose or directly with Python
- Access the API documentation to test endpoints
- The application uses MongoDB Atlas for data storage
- Email functionality requires proper SMTP configuration
- LLM integration requires a running LLM service
- WebSocket endpoints are available for real-time updates