Tender Management is a Node.js web application for creating, browsing, and managing tenders. Institutions can publish tenders with dates, descriptions, and budgets, while users can submit offers for available tenders.
The app uses server-rendered EJS views, Express routes, controller-based request handling, and Sequelize models for database persistence.
- View active tenders
- Create new tenders
- View tender details
- Submit offers for a tender
- Display offers linked to each tender
- View closed tenders
- Close tenders after their end date has passed
- Node.js
- Express
- EJS
- Sequelize
- SQL database through Sequelize
- dotenv
- body-parser
- MySQL or PostgreSQL database driver support
Before running the project, make sure you have:
- Node.js installed
- npm installed
- A running SQL database, such as MySQL or PostgreSQL
- A database created for the application
- A
.envfile with database connection settings
Install project dependencies:
npm installCreate a .env file in the project root:
DB_NAME=your_database_name
DB_USER=your_database_user
DB_PASSWORD=your_database_password
DB_HOST=localhost
DB_PORT=3306
DB_DIALECT=mysql
PORT=3000For PostgreSQL, use:
DB_PORT=5432
DB_DIALECT=postgresRun the application:
node app.jsOpen the app in your browser:
http://localhost:3000
The application uses Sequelize for database access. Database configuration is loaded from environment variables in .env.
Required environment variables:
| Variable | Description |
|---|---|
DB_NAME |
Database name |
DB_USER |
Database username |
DB_PASSWORD |
Database password |
DB_HOST |
Database host |
DB_PORT |
Database port |
DB_DIALECT |
Sequelize dialect, for example mysql or postgres |
PORT |
Optional application port |
On startup, the app runs Sequelize synchronization:
sequelize.sync({ force: false })This creates missing tables without dropping existing data.
The Tender model represents a tender created by an institution.
Fields:
| Field | Type | Required | Description |
|---|---|---|---|
name |
String | Yes | Tender name |
institution |
String | Yes | Institution that created the tender |
description |
String | No | Tender description |
startDate |
Date | Yes | Tender start date |
endDate |
Date | Yes | Tender end date |
maxBudget |
Integer | Yes | Maximum budget for the tender |
status |
Enum | Yes | Tender status: active or closed |
Relationship:
- A tender has many offers.
The Offer model represents an offer submitted for a tender.
Fields:
| Field | Type | Required | Description |
|---|---|---|---|
tenderId |
Integer | Yes | ID of the related tender |
bidderName |
String | Yes | Name of the bidder |
amount |
Float | Yes | Offered amount |
message |
Text | No | Message from the bidder |
Relationship:
- An offer belongs to one tender.