Update Readme

This commit is contained in:
Devoalda 2023-11-01 12:15:58 +08:00
parent 061622ab79
commit 316d438fa8
1 changed files with 35 additions and 3 deletions

View File

@ -18,11 +18,15 @@ pip install -r requirements.txt
## Usage ## Usage
### Running Backend & Frontend Together (Using Docker Compose)
```bash ```bash
# Run backend & frontend using docker-compose # Run backend & frontend using docker-compose
docker-compose up docker-compose up
```
#Run frontend using docker-compose ### Running Backend & Frontend Separately (Docker + Kubernetes)
```bash
# Run frontend using docker-compose
docker compose -f docker-compose-frontend.yml up -d docker compose -f docker-compose-frontend.yml up -d
# Run backend using kubernetes # Run backend using kubernetes
@ -30,14 +34,42 @@ cd K8s
kubectl apply -f redis_deployment.yaml kubectl apply -f redis_deployment.yaml
kubectl apply -f backend_deployment.yaml kubectl apply -f backend_deployment.yaml
kubectl apply -f backend_service.yaml kubectl apply -f backend_service.yaml
```
### For development
```bash
# Run frontend locally # Run frontend locally
cd ../safeshare-frontend cd ../safeshare-frontend
npm install npm install
npm start npm start
# Run backend locally (After installing requirements.txt)
cd ../safeshare
python manage.py runserver
``` ```
## Endpoints ## Endpoints
- `/admin/` - Admin Panel > React App - `http://localhost:3000/` (if running locally)
- `/api/` - API Root
> Django App - `http://localhost:8000/` (if running locally)
> React App - `http://localhost:80/` (if running using docker-compose)
- `Django App` - `http://localhost:8000/api/` - Django REST API
## Python Testing Scripts
>DO NOT MISUSE THESE SCRIPTS. THEY ARE FOR TESTING PURPOSES ONLY
```bash
# All scripts are in saveshare_app/
# post_and_get_files.py
# Uploads a file to the server and then downloads it
python post_and_get_files.py
# stressTest.py
# Uploads multiple files in multiple threads (upload/download)
python stressTest.py
```