A complete guide to set up and run the CityPharma Pharmacy Management System backend on a fresh Windows PC.
Before starting, download and install:
- XAMPP (for MySQL database): https://www.apachefriends.org/
- Python (3.10+): https://www.python.org/downloads/
- Clone this repository to your PC.
- The default settings in the code work with XAMPP's default configuration.
- Download XAMPP from https://www.apachefriends.org/ and run the installer.
- During installation, select MySQL as the module to install.
- After installation, open XAMPP Control Panel.
- Click Start next to MySQL (wait for it to turn green).
- Click Start next to Apache (wait for it to turn green).
MySQL is now running on port 3306
- Open your browser and go to: http://localhost/phpmyadmin
- Click New to create a new database.
- Database name:
citypharma_db - Collation:
utf8mb4_general_ci - Click Create.
Database created!
- In phpMyAdmin, click on citypharma_db in the left sidebar.
- Click the Import tab at the top.
- Click Choose File and select
schema.sqlfrom this project folder. - Scroll down and click Import.
This will create all tables and add 2 default users for testing:
- Username:
admin, Password:password123(Pharmacy Manager) - Username:
staff, Password:password123(Pharmacy Staff)
- Download Python from https://www.python.org/downloads/ (version 3.10 or higher).
- Important: During installation, check "Add Python to PATH".
- Open Command Prompt (cmd) and verify Python is installed:
python --version
- Open Command Prompt and navigate to this project folder:
cd <path-to-project-folder> - Install all required packages:
pip install -r requirements.txt
- Open the
.envfile in this project folder. - The default settings work with XAMPP's default configuration:
DB_HOST=localhost DB_PORT=3306 DB_NAME=citypharma_db DB_USER=root DB_PASSWORD= SECRET_KEY=your-secret-key-change-in-production - Save and close.
Note: Default XAMPP MySQL username is
rootwith no password (leave DB_PASSWORD empty).
In Command Prompt, from this project folder:
python -m uvicorn app.main:app --reload --port 8000
The server will start at: http://localhost:8000
-
Open your browser and go to: http://localhost:8000/docs
-
This is the Swagger UI - interactive API documentation.
-
Click Authorize and login with default credentials:
Role Username Password Manager adminpassword123Staff staffpassword123
| Command | Description |
|---|---|
| Start XAMPP MySQL | Open XAMPP Control Panel → Start MySQL |
| Navigate to project | cd <path-to-project-folder> |
| Run server | python -m uvicorn app.main:app --reload |
| Stop server | Press Ctrl + C in terminal |
Run: pip install -r requirements.txt
- Make sure XAMPP MySQL is running (green in XAMPP Control Panel)
- Check
.envfile has correct DB_PASSWORD (leave empty for default XAMPP)
Create citypharma_db in phpMyAdmin (Step 2)
Change port: python -m uvicorn app.main:app --reload --port 8001
Once the server is running, visit:
- Swagger UI: http://localhost:8000/docs
- ReDoc: http://localhost:8000/redoc