- Bash: Utilizado para escrever scripts de shell que facilitam a configuração, manutenção e consulta do banco de dados.
- PostgreSQL: Sistema de gerenciamento de banco de dados relacional utilizado para armazenar os dados dos elementos químicos.
- JavaScript: Utilizado no frontend para interatividade e manipulação dinâmica dos elementos da tabela periódica.
- MongoDB/Mongoose: Utilizados para o backend, armazenando e gerenciando dados sobre os elementos químicos de forma não relacional.
frontend link: https://periodic-table-6axapdcm2-carlos-projects-e3485227.vercel.app/
This project showcases a relational and non-relational database designed to store comprehensive information about chemical elements found in the periodic table. It includes scripts for setting up the database schema, seeding initial data, and querying information effectively. Additionally, it provides a web interface for users to interact with the data visually.
sql/
: Contains SQL scripts for creating and seeding the PostgreSQL database.scripts/
: Contains shell scripts for querying and updating the PostgreSQL database.models/
: Contains Mongoose schemas for MongoDB.public/
: Contains frontend files (HTML, CSS, JS).atomic_mass.txt
: File containing corrected atomic masses.index.js
: Main server file to run the backend using Express.
- PostgreSQL installed
- Bash shell
- Node.js and npm installed
- MongoDB installed
-
Clone the repository:
git clone https://github.com/yourusername/periodic-table-database.git cd periodic-table-database
-
Create the PostgreSQL database and tables:
psql -U postgres -f sql/create_database.sql
-
Seed the PostgreSQL database with initial data:
psql -U yourdatabase -d periodic_table -f sql/seed_data.sql
-
Adjust the PostgreSQL database structure:
bash scripts/fix_database.sh
-
Install the Node.js dependencies:
npm install
-
Set up the MongoDB database:
- Ensure MongoDB is running.
- Add connection string to
.env
file:MONGODB_URI=mongodb://localhost:27017/periodic_table
-
Run the server:
node index.js
To retrieve information about a specific chemical element by its name, symbol, or atomic number:
bash scripts/main.sh Hydrogen
Replace Hydrogen
with the element's name, symbol, or atomic number to query details about that element.
- Open a web browser and go to
http://localhost:3000
. - Use the search bar to find elements by name or symbol.
- Click on any element in the periodic table to view detailed information.
The database and web interface allow users to:
- Retrieve Element Information: Query by name, symbol, or atomic number to obtain details such as atomic mass, melting point, boiling point, and classification.
- Update and Maintain Database: Use provided scripts to seed initial data and adjust the database structure as needed.
- Explore Chemical Properties: Leverage SQL queries to explore relationships and properties of elements within the periodic table.
- Interactive Frontend: Visually interact with the periodic table, view element details, and search for elements using a user-friendly web interface.
This project can be integrated into educational platforms, scientific applications, or chemical data analysis tools where detailed information about chemical elements is required.
- Structured Data Storage: Organizes element information into relational tables for efficient querying and data management.
- Scripted Setup and Maintenance: Simplifies initial database setup and ongoing maintenance tasks through provided SQL and shell scripts.
- Extensibility: Offers potential for further expansion and integration with additional chemical properties or external data sources.
- User-Friendly Interface: Provides an interactive frontend for easy access and visualization of chemical element data.