This project modernizes an older method of accessing engineering drawing information using Microsoft Access. The approach was to provide a simple, fast, and web-based solution that offers additional extensibility. This includes the addition of an administrator interface that allows for looking up logs, modifying and adding users, and making other edits to the database without having to write queries.
Installation instructions are provided for Windows, but may work in other environments. Consult software or package documentation for installing on other operating systems/environments.
- Python 3+
- Node.js 16+
- Next.js 13+
- MySQL Server 8+
The documentation for this project is not pre-compiled. This is done to save space and reduce clutter. Creating a local working copy is not difficult. Simply follow the scripts below to generate the build files, and then open the index
file in your web browser to access the project documentation. A brief summary can be found in the readme.md
file of the repository, but it is much more limited in scope compared to the full documentation.
To execute a sphinx-build
you must install sphinx, the MyST extension, and the sphinx book theme.
Install Sphinx on Windows see official docs for other operating systems.
pip install -U sphinx
Install the MyST parser extension. Official docs
pip install myst-parser
Install the sphinx book theme. Official docs
pip install sphinx-book-theme
Now you can run the build. Be sure to run this command in the docs
directory and to not confuse the order of the source and build directories.
python -m sphinx.cmd.build ./source/ ./build/
To run the back-end, you will need to install the following software. All of the required software should be able to run on all operating systems and a variety of hardware configurations.
- MySQL. Please refer to the MySQL installation page for installation instructions and software specific to your operating system.
- Node.js. The Node runtime environment is necessary to run other middleware software applications. You can use the package manager
npm
to install individual packages, or navigate to the back-end directory and run the commandnpm install
to install all dependent packages listed inpackages.json
andpackages-lock
.- Express.js
- MySQL2
Ensure that the MySQL server is launched and confirm the existence of the mydb
database. If it is absent, proceed to create it and input the pole data. Execute the below SQL scripts in the MySQL IDE query window in the order below. Executing them in a different order may cause problems with creating the database.
- create_database
- line_data_import
- drawing_data_import
- pole_data_import
- pole_details_data_import
- linking_table_data_import
To start the API, you'll need to generate a .env file and place it in the back-end script directory. The file should contain the login information for your MySQL server.
HOST="localhost"
USER="username"
PASSWORD="password"
DATABASE_NAME="mydb"
From the command line, navigate to the back-end folder and start the Node.js server. This will initiate the mySQL server connection and expose the API that connects and serves data from the database.
node api.js
For development, you may use the nodemon server command which automatically restarts the system whenever any changes are made.
nodemon api.js
All systems should be operational now. To conduct test queries, please refer to the API page. If you are running it on your local machine, open your browser and visit http://localhost:3000/
to view the outcome of a sample query.
To start the app in development mode, run the command below in the front-end directory. Choosing port 3001 helps prevent any conflicts with the default port of the back-end API.
npx next dev -p 3001
You can view the fully functional site in a web browser at localhost:3001
.