School software engineering project on a web application for an airport transport service company.
- Frontend: HTML, CSS, JavaScript (React.js)
- Backend: Node.js (Express.js)
- Database: MySQL
Note: All the following commands are to be run from the root directory of the project.
cd frontend
npm install
Note: The frontend server listens on port
3000
by default. Make sure the port is available. If not, change the port in thefrontend/package.json
file.
cd backend
npm install
Note: The backend server listens on port
5000
by default. Make sure the port is available. If not, change the port in thebackend/server.js
file.
Note: Replace
username
with the username you want to create andpassword
with the password you want to use.
mysql -u root -p
CREATE USER 'username'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';
GRANT ALL PRIVILEGES ON *.* TO 'username'@'localhost';
exit
Note: Replace
username
with the username you created andpassword
with the password you created.
cd database
mysql -u username -p
create database airport_transport_service;
use airport_transport_service;
source schema.sql;
If you want to populate the database with some sample data:
source sample_data.sql;
Create a .env file in the backend
directory and add the following code:
Note: Replace
username
with the username you created andpassword
with the password you created.
DB_HOST=localhost
DB_PORT=3306
DB_USER=username
DB_PASSWORD=password
DB_DATABASE=airport_transport_service
JWT_SECRET=secret
cd frontend
npm start
The backend server should now be running on http://localhost:3000
. You can test it by visiting this URL in your browser (if you have changed the port, replace 3000
with the new port number).
cd backend
npm start
Note: If you are developing, you can use
nodemon
to automatically restart the server when changes are made. To do this, runnpm run dev
instead ofnpm start
.
The backend server should now be running on http://localhost:5000
. You can test it by visiting this URL in your browser (if you have changed the port, replace 5000
with the new port number).
Depending on your MySQL installation, the database server may already be running. If not, start the MySQL server (depending on your OS, the process may be different).
- Check the status of the MySQL server
sudo systemctl status mysql
- Start the MySQL server
sudo systemctl start mysql
- Stop the MySQL server
sudo systemctl stop mysql
- Check the status of the MySQL server
net start | find "MySQL"
- Start the MySQL server
net start MySQL
- Stop the MySQL server
net stop MySQL