Professor:
Username: prof
Password: 123
Admin:
Username: admin
Password: 123
IT Analyst
Username: it
Password: 123
Our project requires the installation of:
-
Install Node (I am using 17.6.0, however the latest LTS should work too according to here)
Your node installation includes the following important tools:
- npx, used to execute packages that haven't been installed (commonly used in generating templates)
- npm, a package manager that doubles to run scripts you define in your
package.json
file
-
Install MySQL (I am using version 8.26.0, anything close should work too)
- Configure your server to run on port 3306 (default) and use the default
username: root
andpassword: password
(This could all be omitted with MySQL being containerized in docker if it was setup)
- Configure your server to run on port 3306 (default) and use the default
-
Install git if you don't have it already. If you have Github Desktop then you should already have it. You can test this by opening a terminal and running
git --version
.
In a terminal in the prefered directory for your project, run git clone https://github.com/Chase-William/RIT-CapSTONERS
. This will create a folder and inside will be a copy of the project. Change directory into the project's root directory and then run npm install
(this may require a terminal with elevated privilage). This will download all the packages require for the project to function.
That is:
git clone https://github.com/Chase-William/RIT-CapSTONERS
cd RIT-CapSTONERS
npm install
Once that is installed, we need to setup Prisma. In the project root dir, run the following:
npx prisma db push
, pushes the schema to the MySQL instance runningnpx prisma generate
, generates the client-side library to match the schema in your node projectnpx prisma db seed
, populates the database with default records
To check the validity of the last commands, open a MySQL CommandLine.
- SHOW DATABASE;
- USE RAWRS:
- SHOW TABLES;
- SELECT * FROM rawrs;
Last command to start the server locally:
- npm run dev
Directory | Description |
---|---|
components | Contains re-usable components that can be used throughout the site. |
compoentns/auth | Contains re-usable components specifically for authentification purposes. |
lib | Contains general utilties used throughout the site. |
pages | Contains all nevigatable endpoints a user can navigate to. |
pages/api | Contains all RESTapi endpoints. |
pages/api/auth | Contains all RESTapi endpoints involved with user login & registration. |
pages/course | Contains the course page which is dynamically routed using the course id. |
prisma | Contains the prisma schema and script for seeding the database. |
public | Contains public assets used by the site. |
styles | Contains all .css files. |
styles/components | Contains styles for components. |
stlyes/pages | Contains styles for pages. |
After modifying the Prisma schema, run npx prisma generate
to keep the generated Prisma library in sync. read here
Ensure you drop the database entirely before seeding the database if already seeded.
Seeding a database will insert default data into the database. Our default data is housed within prisma/seed.ts
and can be used by running npx prisma db seed
. If you run this and get a Unique constraint failed on the constraint, the database already contains seeded records.
Create a volume which can be loaded into a container.
docker volume create rawrs-volume
docker run --name=rawrs-mysql -p3306:3306 -v mysql-volume:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=rawrs123 -d mysql/mysql-server:latest
mysql -u root -p
Provide password: rawrs123
Allow connections outside of docker container local machine itself.
update mysql.user set host = '%' where user='root';
Setup database.
source /app/src/setup.sql
1. Student Help Request
1. Login
2. Professor Dashboard
3. Courses
4. Individual Student
5. Alerts
1. It Analyst
1. Admin