This project is a Client Management API built with Node.js and PostgreSQL. It provides endpoints for managing clients, logging bandwidth usage, and handling admin authentication.
- Node.js
- Express
- PostgreSQL
- Swagger for API documentation
- pgcli for database management
-
Clone the repository:
git clone https://github.com/yourusername/client-management-api.git cd client-management-api
-
Install the required dependencies:
npm install
-
Create a
.env
file in the root directory and add your PostgreSQL database credentials:DB_HOST=your_host DB_USER=your_user DB_PASSWORD=your_password DB_DATABASE=your_database DB_PORT=your_port
To set up the database locally, follow these steps:
-
Create the Database: Open your PostgreSQL command line or pgcli and create a new database:
CREATE DATABASE devfest;
-
Run the Setup Script: Execute the import script to create the necessary tables and insert initial data:
pg_restore -h localhost -U postgres -d devfest -v src/db_backups/devfest.dump
-
Update your
.env
file with the correct database credentials.
The API documentation is available at http://localhost:3000/api-docs
. It provides detailed information about the available endpoints and their usage.
To start the application, run:
cd src
nodemon server.js
The server will be running on http://localhost:3000
.
Contributions are welcome! Please open an issue or submit a pull request.
This project is licensed under the MIT License.