This is a Python-based e-commerce application built with FastAPI, SQLAlchemy, and Redis for session management. This README provides instructions on how to set up, install, and run the application.
Before you begin, ensure you have met the following requirements:
- Python 3.8 or higher
- PostgreSQL for the database
- Redis for session management
- pip for package management
-
Clone the repository:
git clone https://github.com/yourusername/ecommerce.git cd ecommerce```
-
Set up a virtual environment:
python -m venv venv
-
Activate the virtual environment:
-
On macOS/Linux:
source venv/bin/activate -
On Windows:
venv\Scripts\activate
-
Install the required packages:
pip install -r requirements.txt
-
Configuration:
Create a .env file in the root of your project and add the following environment variables:
DATABASE_URL="postgresql://username:password@host:port/database" ANTROPIC_API="your_antropic_api_key" REDIS_DB="rediss://username:password@host:port" REDIS_HOST="your_redis_host" REDIS_PORT=your_redis_port REDIS_USER="your_redis_username" REDIS_PASS="your_redis_password"Modify the database URL with your PostgreSQL credentials.
-
Running the Application:
Start the application:
uvicorn main:app --reload
The application will be available at http://127.0.0.1:8000.
Access the API documentation: Open your browser and go to http://127.0.0.1:8000/docs to view the interactive API documentation provided by FastAPI.
- User Registration: POST /users/
- User Login: POST /login
- Get Current User: GET /users/me
This project is licensed under the MIT License - see the LICENSE file for details.