This assessment tests your understanding of building a full stack app using React, Node/Express, and MySQL.
- Run
npm install
in project directory. This will install server-related dependencies such asexpress
. cd client
and runnpm install
. This will install client dependencies (React).
- Access the MySQL interface in your terminal by running
mysql -u root -p
- Create a new database called facebook:
create database facebook
- Add a
.env
file to the project folder of this repository containing the MySQL authentication information for MySQL user. For example:
DB_HOST=localhost
DB_USER=root
DB_NAME=facebook
DB_PASS=YOURPASSWORD
-
Run
npm run migrate
in the project folder of this repository, in a new terminal window. This will create a table called 'students' in your database. -
Make sure you understand how the
students
table is constructed. In your MySQL console, you can runuse facebook;
and thendescribe students;
to see the structure of the students table.
- Run
npm start
in project directory to start the Express server on port 5000 - In another terminal, do
cd client
and runnpm start
to start the client in development mode with hot reloading in port 3000.
Create a webpage with the following functionality:
- [*] A list of students.
- [*] A form to add new students. There should be fields to input the first and last names, separately.
- After submitting the form, the new student should be added to the database and displayed on the page.
- [*] Each student can be deleted with a delete button. After clicking on this button, student should be deleted from the database and the updated list of students shown on the page
- [*] Style the app to make it look as polished as possible. Bootstrap is already loaded in the index.html file, so you can use it if you want to.
- (Optional/bonus) Clicking on a student should show the student's profile to the right of the students list. The info to display this profile should be obtained from a fetch request to
/students/:id
To accomplish this, you will need to:
- [*] Finish the routes in the API server (
/routes/students.js
). - [*] Finish the front end (
/client/src/
). Create as many components as you need.
- Do not use any presentations from the class or any notes you have taken.
- Try to do the test without looking at code you have previously written. If you get stuck for more than 30min, you may look at your previous code - but make sure you let your instructor know.
- The only resources you may use online are:
- Make sure you give yourself a grade before turning it in!
Suggested Process:
- Try and write the correct query in
mysql
. - Use that query to finish the endpoints in
/routes/students.js
. - Test your endpoints using Postman.
- Call the endpoints from the front end.
Give yourself a grade for each question. Explain why you gave yourself that grade.
Grade | Explanation |
---|---|
4 | I understood this completely and did not struggle answering it. |
3 | I think I did well, but I didn't totally understand why it worked. |
2 | I think I was close, but I didn't get the answer. |
1 | I am struggling with this question. |
0 | I did not attempt this question (explain why) |
- Grade: 3
- Explanation: I managed to make it work, but did have to check some previous exercises to sort out some bugs
- Grade: 3
- Explanation: same as with ### 1