Visitar URL original
GitHub - Pandora-Project/PAI · GitHub
Skip to content
Pandora-ProjectPublic

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

1 watching

Forks

Repository files navigation

Tender Management

Summary

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.

Features

  • 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

Tech Stack

  • Node.js
  • Express
  • EJS
  • Sequelize
  • SQL database through Sequelize
  • dotenv
  • body-parser
  • MySQL or PostgreSQL database driver support

Prerequisites

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 .env file with database connection settings

Installation

Install project dependencies:

npm install

Create 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=3000

For PostgreSQL, use:

DB_PORT=5432
DB_DIALECT=postgres

Run the application:

node app.js

Open the app in your browser:

http://localhost:3000

Database Setup

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.

Data Models

Tender

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.

Offer

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.

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages