Skip to content

chenpp604/campus-recruitment-website

Repository files navigation

Campus Recruitment Website

A full-stack campus recruitment website project with a static frontend and a Node.js + Express backend.

Features

  • Student registration and login
  • Job listing and company pages
  • Personal center for profile and application records
  • Local resume upload/download (stored in browser localStorage)
  • SQL Server-backed user authentication

Tech Stack

  • Frontend: HTML, CSS, JavaScript
  • Backend: Node.js, Express
  • Database: SQL Server (mssql)
  • Password hashing: bcryptjs

Project Structure

.
├── index.html
├── job_list.html
├── companies.html
├── personal_center.html
├── company_a01.html
├── company_a02.html
├── company_a03.html
├── navbar.html
├── css/
├── js/
├── server.js
├── package.json
└── README.md

Prerequisites

  • Node.js 18+ (recommended)
  • SQL Server (local or remote)
  • npm

Installation

npm install

Database Setup (SQL Server)

Run the following SQL in SQL Server Management Studio:

IF DB_ID('campus_recruitment') IS NULL
BEGIN
    CREATE DATABASE campus_recruitment;
END
GO

USE campus_recruitment;
GO

IF OBJECT_ID('dbo.users', 'U') IS NULL
BEGIN
    CREATE TABLE dbo.users (
        id INT IDENTITY(1,1) PRIMARY KEY,
        username NVARCHAR(255) NOT NULL UNIQUE,
        [password] NVARCHAR(255) NOT NULL,
        created_at DATETIME2 NOT NULL DEFAULT SYSUTCDATETIME()
    );
END
GO

Configure Backend

Open server.js and update the SQL Server config:

const config = {
  user: 'your_username',
  password: 'your_password',
  server: 'localhost', // or localhost\\SQLEXPRESS
  database: 'campus_recruitment',
  options: {
    encrypt: false,
    trustServerCertificate: true
  }
};

Run the Project

npm start

Then open:

  • http://localhost:3000/

API Endpoints

  • POST /register
    • Body: username, password
    • Creates a new user with hashed password
  • POST /login
    • Body: username, password
    • Validates user credentials

Notes

  • Do not commit secrets (DB credentials) to GitHub.
  • node_modules/ is ignored via .gitignore.
  • Profile data, resume file data, and application records are currently stored in browser localStorage.

Future Improvements

  • Move DB credentials to environment variables (.env)
  • Add server-side session/JWT auth
  • Persist applications and profile data in database
  • Add input validation and rate limiting
  • Add deployment config (Docker / cloud)

About

A full-stack campus recruitment website for Macau University of Science and Technology students, featuring job listings, company pages, user registration/login, and personal application tracking.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors