Greenhouse Administration System

Date: January 2024

View on GitHub

University project for the Databases subject, where we had to create a management system for a greenhouse business, to be used by employees and clients. We used MongoDB, Node.js and Express for backend and Angular with Bootstrap for frontend.

HTML CSS (Bootstrap) NodeJS Express Angular MongoDB PassportJS

Code snippets


The index.js file initializes the Express server, connects to MongoDB, and sets up API routes for the application. It serves as the main entry point for the backend of the Greenhouse Administration System, orchestrating the server and database interactions.
The database.sql file defines the SQL database schema and populates it with initial data for the system. It establishes the relational database structure by creating tables like Greenhouses, Ecosystems, and Plants, and inserts sample data to set up the groundwork for the application.

Main server file that initializes Express, connects to MongoDB, and sets up API routes for the app.

Main server file that initializes Express, connects to MongoDB, and sets up API routes for the app.

SQL script that defines the database schema and populates it with initial data for the system.

SQL script that defines the database schema and populates it with initial data for the system.

The ecosystem.js file defines the Mongoose schema and model for the "Ecosystem" collection in MongoDB. It specifies the data structure for ecosystems, including fields like type, description, and a reference to the associated greenhouse—essentially modeling how ecosystem data is stored.
The ecosystems.js file sets up the Express routes for handling HTTP requests related to ecosystems. It provides endpoints to create, read, update, and delete ecosystem records, enabling interaction with the ecosystem data through a RESTful API.

Defines the Mongoose schema and model for ecosystems stored in MongoDB.

Defines the Mongoose schema and model for ecosystems stored in MongoDB.

Sets up Express routes for CRUD operations on ecosystems via a RESTful API.

Sets up Express routes for CRUD operations on ecosystems via a RESTful API.