- Project Overview
- Features
- Installation & Setup
- Running the Application
- Project Structure
- API Endpoints
- Middleware
- Testing
- License
Audio Hub is a full-stack audio management web app built with FastAPI and Next.js. Users can register, upload audio files, manage account settings, and stream or play audio both from the database and local storage. Backend storage is powered by PostgreSQL.
- Upload audio files from your device to PostgreSQL
- Dashboard to view and play uploaded audio
- Page for playing local audio not in database
- JWT authentication and token-based login
- Email verification via SendGrid
- Forgot password and reset via email code
- Secure account info editing (username, password, email)
- Audio playback and streaming from backend
- PostgreSQL
-
Clone the repository
git clone https://github.com/SDSU-CompE-561-Spring-2025/nba-sports-tracker cd nba-sports-tracker/PSQL_Backend -
Install Hatch and create environment
pip install hatch hatch env create hatch shell
-
Install
uvicornif not already presentpip install "uvicorn[standard]" -
Set up
.envfileDATABASE_URL=postgresql+asyncpg://Audio:Audio@2025@localhost/mydb SECRET_KEY=your_secret_key SENDGRID_API_KEY=your_sendgrid_api_key -
Run the backend
hatch run dev
-
Navigate to frontend directory
cd ../frontend -
Install dependencies
npm install
-
Start the frontend server
npm run dev
-
Install pgAdmin 4
Go to: https://www.postgresql.org/ftp/pgadmin/pgadmin4/v9.3/windows/
Download:pgadmin4-9.xfor your OS -
Install PostgreSQL
Go to: https://www.enterprisedb.com/downloads/postgres-postgresql-downloads
Download: PostgreSQL 17.4 for your OS -
Add PostgreSQL to system PATH
Ask ChatGPT or Google: “How to add PostgreSQL psql to PATH on Windows” -
Configure in pgAdmin:
- Right click "Servers" → Register → Name:
backend - Hostname:
localhost, Port:5432 - Connect now → Save
- Right click "Servers" → Register → Name:
-
Create Role and DB:
- Right-click
Login/Group Roles→ Create → Name:Audio- Definition: Password =
Audio@2025 - Privileges: Check
Can Login
- Definition: Password =
- Right-click
Databases→ Create → Name:mydb- Go to
Security, add roleAudiowith all privileges
- Go to
- Right-click
- Start PostgreSQL
- Run backend with
hatch run dev - Start frontend with
npm run dev - Access:
- Frontend:
http://localhost:3000 - Backend Docs:
http://127.0.0.1:8000/docs
- Frontend:
nba-sports-tracker/
├── PSQL_Backend/
│ ├── main.py
│ ├── models/
│ ├── schemas/
│ ├── routes/
│ ├── core/
├── frontend/
│ ├── pages/
│ ├── components/
├── tests/
├── .env
└── README.md
POST /make_userPOST /tokenGET /userPUT /user/updatePUT /user/update/usernamePUT /user/update/passwordPUT /user/update/emailDELETE /user/deletePOST /forgot-passwordPOST /reset-passwordPUT /user/verifyPUT /user/verify/newcoderequestPOST /user/confirmGET /user/exists
POST /audio/createGET /audio/get_audiosPUT /audio/update/{audio_id}DELETE /audio/delete/{audio_id}POST /upload-audio-db/GET /download-audio/{track_id}
- Full HTTP method/header support
- Wildcard origin in dev
- Logs method, URL, status code
- Import Postman collections from
tests/ - Run automated unit tests via:
pytest
Distributed under the MIT License