This guide will walk you through the installation process of the Political-Transparency server and the configuration of its connection to the database.
Before you begin, make sure you have the following prerequisites:
- Node.js and npm: Ensure you have Node.js and npm (Node Package Manager) installed on your system. You can download them from nodejs.org.
- GitHub Account: You'll need a GitHub account to access the repository and download the code.
- **MySql
-
Open your terminal and navigate to the directory where you want to clone the repository:
cd /path/to/your/directory -
Clone the Political-Transparency repository from GitHub:
https://github.com/Political-Transparency/political-transparency.git -
Navigate to the project directory:
cd Political-Transparency
-
Install the required dependencies by running the following command:
npm install -
Create .env file in the root folder of the server and to use MySQL Cloud or Local Server and update with your MySql credentials:
-
Once the configuration is set, you can start the server using the following command:
npm start -
The server will start running on the specified port (default is 8080). You can access it using your web browser or tools like Postman.
Preconfigured routes that allow you to interact with the MySQL database. These routes provide endpoints to retrieve bills, Knesset members, vote IDs, and vote lists. Here's how to use them:
- Retrive Bills
Endpoint: http://localhost:8080/database/bills
Action: Use this endpoint to retrive all bills data from the external API and store it in the database. - Retrive Knesset Members:
Endpoint: http://localhost:8080/database/members
Action: Use this endpoint to get all Knesset member data from the external API and store it in the database.
You've successfully installed the Political-Transparency server and configured the connection to your Cloud MySQL database. You can now use the provided APIs to interact with the server and the database. Make sure to explore the available routes and customize the server to meet your specific requirements.
Remember to follow best practices for security and error handling as you work on your project. If you encounter any issues or have questions, feel free to refer to the project documentation or reach out to our support team.
Happy coding!
