The frontend is already deployed at: https://ctp-hacks-code-rangers.vercel.app
For local development:
- Navigate to the frontend directory:
cd ctp_web - Install dependencies:
npm install
- Start the development server:
npm start
To set up and run the backend on your local machine:
-
Navigate to the backend directory:
cd ctp_backend -
Install necessary dependencies:
npm install body-parser cors express mysql2 nodemon axios
-
Set up the database:
- Copy and paste the following SQL script into your MySQL database to create the necessary tables:
CREATE DATABASE my_database; USE my_database; CREATE TABLE survey_answers ( id INT AUTO_INCREMENT PRIMARY KEY, isCunyStudent VARCHAR(10) NOT NULL, -- 'Yes' or 'No' campus VARCHAR(100) NOT NULL, -- Campus name foodInsecurityAffect TINYINT NOT NULL, -- Rating (1-5) housingInsecurityAffect TINYINT NOT NULL, -- Rating (1-5) mentalHealthAffect TINYINT NOT NULL, -- Rating (1-5) healthcareAccessAffect TINYINT NOT NULL, -- Rating (1-5) foodInsecurityAware TINYINT NOT NULL, -- Rating (1-5) housingInsecurityAware TINYINT NOT NULL, -- Rating (1-5) mentalHealthAware TINYINT NOT NULL, -- Rating (1-5) healthcareAccessAware TINYINT NOT NULL, -- Rating (1-5) foodInsecurityAdequate VARCHAR(10) NOT NULL, -- 'Yes', 'No', or 'Not Sure' housingInsecurityAdequate VARCHAR(10) NOT NULL, -- 'Yes', 'No', or 'Not Sure' mentalHealthAdequate VARCHAR(10) NOT NULL, -- 'Yes', 'No', or 'Not Sure' healthcareAccessAdequate VARCHAR(10) NOT NULL -- 'Yes', 'No', or 'Not Sure' );
-
Update the MySQL password:
- If your local MySQL instance requires a password, update the
passwordfield inserver.jsaccordingly.
- If your local MySQL instance requires a password, update the
-
Run the backend server:
node server.js