VFarmService is a FastAPI-based web application for managing chat boxes and messages between users.
- User authentication and token-based access control.
- CRUD operations for users, chat boxes, and messages.
- Secure password hashing using bcrypt.
- PostgreSQL database backend with SQLAlchemy ORM.
To run this application locally, follow these steps:
-
Clone the repository:
git clone https://github.com/yourusername/VFarmService.git cd VFarmService -
Set up a virtual environment (optional but recommended):
python -m venv venv source venv/bin/activateOn Windows use:
venv\Scripts\activate
-
Install dependencies:
pip install -r requirements.txt
-
Set up PostgreSQL database:
Option 1: Manual Setup
- Install PostgreSQL and create a database.
- Update the database connection details in
app/database.py.
Option 2: Using Docker
-
Ensure you have Docker installed and running.
-
Use the provided
docker-compose.ymlfile to set up PostgreSQL:docker-compose up -d
-
Update the database connection details in
app/database.pyto match the Docker configuration.
-
Run database migrations with Alembic:
alembic upgrade head
-
Run the application:
uvicorn app.main:app --reload --port 8888
-
Access the API documentation:
Open your browser and go to http://127.0.0.1:8888/docs to view the Swagger UI.