Skip to content

Lesson 09 Jobs API part 1

Mary Alice Moore edited this page Mar 29, 2024 · 1 revision

Lesson Page

Lessons 9 and 10 bring all of the ideas so far together in one project. The project includes user registration into a MongoDB database. The user’s ID and password are stored in the database, and the password is cryptographically hashed. The user can then login, and authentication is done using JWT tokens. CRUD operations are then implemented for the entries in the jobs collection of Mongo documents. There is an association between the user ID and the jobs entries, which is used for authorization checking: the user can only read/update/delete entries that they themselves created, and can’t operate on entries created by other users. There is no front end, so all testing must be done using Postman. The lesson files are in the 06-jobs-api directory. As usual, I recommend that mentors add a .env entry for their MongoDB database, along with one for the JWT secret, so that mentors can demonstrate the working code.

Beginning with lesson 9, students are asked to start working on their own projects, by doing the same operations as are described in the video, but with a data model the students invent for the managed objects. So, the student’s work will differ from that of the video instructor.