Plan-A-Gator is a full-stack web application for UF students to upload transcripts, get course recommendations, and plan their schedules.
- Backend: Flask API + PostgreSQL (
backend/) - Frontend: React + Vite (
frontend/)
- Prerequisites
- Clone the Repository
- Database Setup
- Backend Setup
- Frontend Setup
- Running the App
- Testing the Application
- Project Structure
- Troubleshooting
Make sure you have installed:
Verify installations:
python3 --version
node --version
npm --version
psql --version
git --versiongit clone https://github.com/yourusername/Plan-A-Gator.git
cd Plan-A-Gator# Start PostgreSQL service
# macOS (if using Homebrew):
brew services start postgresql
# Linux:
sudo service postgresql start
# Windows: PostgreSQL should auto-start after installation# Open PostgreSQL shell
psql postgres
# Create database
CREATE DATABASE plan_a_gator_db;
# Create user with password
CREATE USER your_username WITH PASSWORD 'your_password';
# Grant privileges
GRANT ALL PRIVILEGES ON DATABASE plan_a_gator_db TO your_username;
# Exit psql
\q# Navigate to backend folder
cd backend
# Run schema file to create tables
psql -U your_username -d plan_a_gator_db -f schema.sql
# Verify tables were created
psql -U your_username -d plan_a_gator_db -c "\dt"
# Should show: users, courses, user_completed_courses, user_schedules, schedule_coursescd backendpython3 -m venv venvmacOS/Linux:
source venv/bin/activateWindows:
venv\Scripts\activateYou should see (venv) in your terminal prompt.
pip install --upgrade pip
pip install -r requirements.txtCreate a .env file in the backend/ folder (or update existing one):
# filepath: backend/.env
DATABASE_URL=postgresql://your_username:your_password@localhost/plan_a_gator_db
SECRET_KEY=your-secret-key-here
FLASK_ENV=developmentReplace:
your_usernamewith your PostgreSQL usernameyour_passwordwith your PostgreSQL password
Open backend/app.py and verify the database URI matches your setup:
# Around line 12-15
app.config['SQLALCHEMY_DATABASE_URI'] = 'postgresql://your_username:your_password@localhost/plan_a_gator_db'python app.pyYou should see:
* Running on http://127.0.0.1:5000
* Restarting with stat
* Debugger is active!
Test the API:
# In a new terminal
curl http://127.0.0.1:5000/Should return: {"message": "Welcome to Plan-A-Gator API"}
Keep the backend running!
Keep the backend terminal running. Open a new terminal window.
cd Plan-A-Gator/frontendnpm installThis will install all dependencies from package.json including:
- React
- React Router DOM
- Vite
- PDF.js
If needed, create .env file in frontend/ folder:
# filepath: frontend/.env
VITE_API_URL=http://127.0.0.1:5000npm run devYou should see:
VITE v5.x.x ready in xxx ms
➜ Local: http://localhost:5173/
➜ Network: use --host to expose
Make sure PostgreSQL is running:
# macOS:
brew services start postgresql
# Linux:
sudo service postgresql start
# Windows: Check Services appcd backend
source venv/bin/activate # macOS/Linux
# or
venv\Scripts\activate # Windows
python app.pyBackend runs at: http://127.0.0.1:5000
cd frontend
npm run devFrontend runs at: http://localhost:5173
Navigate to: http://localhost:5173
- Go to http://localhost:5173/signup
- Create an account with:
- Username
- Password
- Click "Sign Up"
- Go to http://localhost:5173/signin
- Enter your credentials
- Click "Sign In"
- Go to "Transcript" page
- Select your college (e.g., "Engineering")
- Select your grade level (e.g., "Sophomore")
- Upload a PDF transcript or manually enter course codes
- Click "Parse and Save"
- Navigate to "Scheduler" page
- See recommended courses based on your transcript
- Drag courses to create your schedule
- Save your schedule with a name
- Your saved schedules appear on the right side
- Click a schedule to load it
- Download as PDF
- Delete old schedules
Plan-A-Gator/
├── backend/
│ ├── app.py # Flask API entry point
│ ├── models.py # SQLAlchemy database models
│ ├── schema.sql # Database schema
│ ├── recommendation_services.py # Course recommendation logic
│ ├── requirements.txt # Python dependencies
│ ├── venv/ # Python virtual environment (not in git)
│ └── .env # Backend environment variables (not in git)
│
├── frontend/
│ ├── src/
│ │ ├── pages/
│ │ │ ├── Home.jsx # Landing page
│ │ │ ├── SignIn.jsx # Login page
│ │ │ ├── SignUp.jsx # Registration page
│ │ │ ├── Transcript.jsx # Transcript upload page
│ │ │ └── Scheduler.jsx # Schedule builder page
│ │ ├── App.jsx # Main React component
│ │ └── main.jsx # React entry point
│ ├── package.json # Node dependencies
│ ├── vite.config.js # Vite configuration
│ └── .env # Frontend environment variables (not in git)
│
├── .gitignore
└── README.md
Problem: ModuleNotFoundError: No module named 'flask'
Solution:
cd backend
source venv/bin/activate
pip install -r requirements.txtProblem: psycopg2 installation fails
Solution (macOS):
brew install postgresql
pip install psycopg2-binarySolution (Linux):
sudo apt-get install libpq-dev
pip install psycopg2-binaryProblem: Database connection error
Solution:
- Check PostgreSQL is running:
psql -U your_username -d plan_a_gator_db - Verify database credentials in
app.py - Make sure database exists:
psql -l
Problem: "Table does not exist" error
Solution:
psql -U your_username -d plan_a_gator_db -f backend/schema.sqlProblem: npm install fails
Solution:
rm -rf node_modules package-lock.json
npm cache clean --force
npm installProblem: "Cannot find module 'react-router-dom'"
Solution:
npm install react-router-domProblem: API calls failing (CORS errors)
Solution:
- Make sure backend is running on http://127.0.0.1:5000
- Check
flask-corsis installed:pip install flask-cors - Verify
CORS(app)inapp.py
Problem: "password authentication failed"
Solution:
# Reset PostgreSQL password
psql postgres
ALTER USER your_username WITH PASSWORD 'new_password';
\q
# Update app.py with new passwordProblem: Cannot connect to PostgreSQL
Solution:
# macOS:
brew services restart postgresql
# Linux:
sudo service postgresql restart
# Check if PostgreSQL is running:
ps aux | grep postgresProblem: Port 5000 or 5173 already in use
Solution:
# Find process using port
lsof -i :5000 # or :5173
# Kill the process
kill -9 <PID>Problem: Changes not reflecting
Solution:
- Frontend: Vite hot-reloads automatically. If not, restart with
npm run dev - Backend: Restart Flask with
python app.py - Clear browser cache: Cmd+Shift+R (Mac) or Ctrl+Shift+R (Windows)
- Environment Files:
.envfiles contain sensitive information. Never commit them to Git. - Virtual Environment: Always activate
venvbefore running Flask commands. - Hot Reloading: Vite provides instant hot module replacement for React.
- API Endpoints: All backend routes are prefixed with
/(e.g.,/signup,/signin). - Database Migrations: If you change models, drop and recreate tables or use migrations.
If you encounter issues:
- Check the Troubleshooting section
- Review backend terminal for Flask errors
- Check browser console (F12) for frontend errors
- Verify database connection:
psql -U your_username -d plan_a_gator_db
- Your Team Members Here
This project is licensed under the MIT License.
---
## Key improvements:
1. ✅ **Step-by-step PostgreSQL setup** - including database creation, user setup, and schema initialization
2. ✅ **Detailed backend setup** - virtual environment, dependencies, environment variables
3. ✅ **Frontend setup** - all npm installations explicitly listed
4. ✅ **Running instructions** - clear 3-step process with expected outputs
5. ✅ **Testing section** - walk through the entire user flow
6. ✅ **Comprehensive troubleshooting** - common errors with solutions
7. ✅ **Project structure** - visual directory tree
8. ✅ **Verification steps** - how to check if each step worked
Anyone should be able to clone and run the app by following these instructions!<!-- filepath: /Users/elinakocarslan/Documents/GitHub/ProductivityApp/Plan-A-Gator/README.md -->
# Plan-A-Gator - UF Course Scheduler
Plan-A-Gator is a full-stack web application for UF students to upload transcripts, get course recommendations, and plan their schedules.
- **Backend:** Flask API + PostgreSQL (`backend/`)
- **Frontend:** React + Vite (`frontend/`)
---
## Table of Contents
- [Prerequisites](#prerequisites)
- [Clone the Repository](#clone-the-repository)
- [Database Setup](#database-setup-postgresql)
- [Backend Setup](#backend-setup-flask)
- [Frontend Setup](#frontend-setup-react--vite)
- [Running the App](#running-the-app-locally)
- [Testing the Application](#testing-the-application)
- [Project Structure](#project-structure)
- [Troubleshooting](#troubleshooting)
---
## Prerequisites
Make sure you have installed:
- **Python 3.10+** ([Download](https://www.python.org/downloads/))
- **Node.js 18+** & **npm** ([Download](https://nodejs.org/))
- **PostgreSQL 14+** ([Download](https://www.postgresql.org/download/))
- **Git** ([Download](https://git-scm.com/downloads))
Verify installations:
```bash
python3 --version
node --version
npm --version
psql --version
git --version
git clone https://github.com/yourusername/Plan-A-Gator.git
cd Plan-A-Gator# Start PostgreSQL service
# macOS (if using Homebrew):
brew services start postgresql
# Linux:
sudo service postgresql start
# Windows: PostgreSQL should auto-start after installation# Open PostgreSQL shell
psql postgres
# Create database
CREATE DATABASE plan_a_gator_db;
# Create user with password
CREATE USER your_username WITH PASSWORD 'your_password';
# Grant privileges
GRANT ALL PRIVILEGES ON DATABASE plan_a_gator_db TO your_username;
# Exit psql
\q# Navigate to backend folder
cd backend
# Run schema file to create tables
psql -U your_username -d plan_a_gator_db -f schema.sql
# Verify tables were created
psql -U your_username -d plan_a_gator_db -c "\dt"
# Should show: users, courses, user_completed_courses, user_schedules, schedule_coursescd backendpython3 -m venv venvmacOS/Linux:
source venv/bin/activateWindows:
venv\Scripts\activateYou should see (venv) in your terminal prompt.
pip install --upgrade pip
pip install -r requirements.txtCreate a .env file in the backend/ folder (or update existing one):
# filepath: backend/.env
DATABASE_URL=postgresql://your_username:your_password@localhost/plan_a_gator_db
SECRET_KEY=your-secret-key-here
FLASK_ENV=developmentReplace:
your_usernamewith your PostgreSQL usernameyour_passwordwith your PostgreSQL password
Open backend/app.py and verify the database URI matches your setup:
# Around line 12-15
app.config['SQLALCHEMY_DATABASE_URI'] = 'postgresql://your_username:your_password@localhost/plan_a_gator_db'python app.pyYou should see:
* Running on http://127.0.0.1:5000
* Restarting with stat
* Debugger is active!
Test the API:
# In a new terminal
curl http://127.0.0.1:5000/Should return: {"message": "Welcome to Plan-A-Gator API"}
Keep the backend running!
Keep the backend terminal running. Open a new terminal window.
cd Plan-A-Gator/frontendnpm installThis will install all dependencies from package.json including:
- React
- React Router DOM
- Vite
- PDF.js
If needed, create .env file in frontend/ folder:
# filepath: frontend/.env
VITE_API_URL=http://127.0.0.1:5000npm run devYou should see:
VITE v5.x.x ready in xxx ms
➜ Local: http://localhost:5173/
➜ Network: use --host to expose
Make sure PostgreSQL is running:
# macOS:
brew services start postgresql
# Linux:
sudo service postgresql start
# Windows: Check Services appcd backend
source venv/bin/activate # macOS/Linux
# or
venv\Scripts\activate # Windows
python app.pyBackend runs at: http://127.0.0.1:5000
cd frontend
npm run devFrontend runs at: http://localhost:5173
Navigate to: http://localhost:5173
- Go to http://localhost:5173/signup
- Create an account with:
- Username
- Password
- Click "Sign Up"
- Go to http://localhost:5173/signin
- Enter your credentials
- Click "Sign In"
- Go to "Transcript" page
- Select your college (e.g., "Engineering")
- Select your grade level (e.g., "Sophomore")
- Upload a PDF transcript or manually enter course codes
- Click "Parse and Save"
- Navigate to "Scheduler" page
- See recommended courses based on your transcript
- Drag courses to create your schedule
- Save your schedule with a name
- Your saved schedules appear on the right side
- Click a schedule to load it
- Download as PDF
- Delete old schedules
Plan-A-Gator/
├── backend/
│ ├── app.py # Flask API entry point
│ ├── models.py # SQLAlchemy database models
│ ├── schema.sql # Database schema
│ ├── recommendation_services.py # Course recommendation logic
│ ├── requirements.txt # Python dependencies
│ ├── venv/ # Python virtual environment (not in git)
│ └── .env # Backend environment variables (not in git)
│
├── frontend/
│ ├── src/
│ │ ├── pages/
│ │ │ ├── Home.jsx # Landing page
│ │ │ ├── SignIn.jsx # Login page
│ │ │ ├── SignUp.jsx # Registration page
│ │ │ ├── Transcript.jsx # Transcript upload page
│ │ │ └── Scheduler.jsx # Schedule builder page
│ │ ├── App.jsx # Main React component
│ │ └── main.jsx # React entry point
│ ├── package.json # Node dependencies
│ ├── vite.config.js # Vite configuration
│ └── .env # Frontend environment variables (not in git)
│
├── .gitignore
└── README.md
Problem: ModuleNotFoundError: No module named 'flask'
Solution:
cd backend
source venv/bin/activate
pip install -r requirements.txtProblem: psycopg2 installation fails
Solution (macOS):
brew install postgresql
pip install psycopg2-binarySolution (Linux):
sudo apt-get install libpq-dev
pip install psycopg2-binaryProblem: Database connection error
Solution:
- Check PostgreSQL is running:
psql -U your_username -d plan_a_gator_db - Verify database credentials in
app.py - Make sure database exists:
psql -l
Problem: "Table does not exist" error
Solution:
psql -U your_username -d plan_a_gator_db -f backend/schema.sqlProblem: npm install fails
Solution:
rm -rf node_modules package-lock.json
npm cache clean --force
npm installProblem: "Cannot find module 'react-router-dom'"
Solution:
npm install react-router-domProblem: API calls failing (CORS errors)
Solution:
- Make sure backend is running on http://127.0.0.1:5000
- Check
flask-corsis installed:pip install flask-cors - Verify
CORS(app)inapp.py
Problem: "password authentication failed"
Solution:
# Reset PostgreSQL password
psql postgres
ALTER USER your_username WITH PASSWORD 'new_password';
\q
# Update app.py with new passwordProblem: Cannot connect to PostgreSQL
Solution:
# macOS:
brew services restart postgresql
# Linux:
sudo service postgresql restart
# Check if PostgreSQL is running:
ps aux | grep postgresProblem: Port 5000 or 5173 already in use
Solution:
# Find process using port
lsof -i :5000 # or :5173
# Kill the process
kill -9 <PID>Problem: Changes not reflecting
Solution:
- Frontend: Vite hot-reloads automatically. If not, restart with
npm run dev - Backend: Restart Flask with
python app.py - Clear browser cache: Cmd+Shift+R (Mac) or Ctrl+Shift+R (Windows)
- Environment Files:
.envfiles contain sensitive information. Never commit them to Git. - Virtual Environment: Always activate
venvbefore running Flask commands. - Hot Reloading: Vite provides instant hot module replacement for React.
- API Endpoints: All backend routes are prefixed with
/(e.g.,/signup,/signin). - Database Migrations: If you change models, drop and recreate tables or use migrations.
If you encounter issues:
- Check the Troubleshooting section
- Review backend terminal for Flask errors
- Check browser console (F12) for frontend errors
- Verify database connection:
psql -U your_username -d plan_a_gator_db
This project is licensed under the MIT License.
---