backend directory:.env file in the backend directory root and add the following variables.DATABASE_URL (e.g., job_board_db). You can do this using a GUI tool like Postico or via the command line:http://localhost:4000.client directory:.env file in the client directory root and add your Auth0 application credentials.http://localhost:5173.User model has an enum Role that clearly separates users into JOB_SEEKER and EMPLOYER. This is the foundation for all role-based access control in the application.Employer and a Company is managed through a dedicated EmployerProfile model. The key design choice here is the @unique constraint on the userId field in the EmployerProfile. This enforces a one-to-one relationship, meaning an employer can only be associated with one company at a time. This was chosen for simplicity in this version of the application, as it streamlines the logic for job posting and company management.onDelete: Cascade for critical relationships. For example, if a User is deleted, their associated EmployerProfile or JobSeekerProfile is also automatically deleted, ensuring data integrity.bcryptjs. Upon successful login, the backend generates a JSON Web Token (JWT) containing the user's ID and role.httpOnly cookie. This means that the rest of our application—from protected routes on the backend to conditional UI on the frontend—doesn't need to care how a user logged in. It only needs to verify the single, unified JWT, which creates a very clean and decoupled system.auth, jobs, profile), which makes it easier to navigate and maintain as the application grows.ProfilePage.jsx component is used for both job seekers and employers. It conditionally renders different sections based on the user's role, which significantly reduces code duplication.Posted Oct 3, 2025
Developed a full-stack job board app with user roles and Auth0 authentication.
0
1