The backend of the PayrollPal application provides the necessary server-side functionality to support the frontend in streamlining contract management and automating payments for TikTok creators.
💼 PayrollPal Backend is built using the following technologies:
- Node.js: A runtime environment for executing JavaScript on the server.
- Express.js: A web application framework for Node.js.
- PostgreSQL: A powerful, open-source relational database system.
- Sequelize: An ORM (Object-Relational Mapping) for Node.js.
- Authentication: Implement user authentication for secure access.
To set up the 💼 PayrollPal Backend and make it work seamlessly with the frontend, follow these steps:
- Clone the repository:
git clone https://github.com/KenHo95/payrollpal-backend.git - Navigate to the project directory:
cd payrollpal-backend - Install dependencies:
npm install - Set up the PostgreSQL database: Configure database connection in
config/config.json. - Run database migrations:
npx sequelize db:migrate - Start the server:
nodemon index.js - Ensure the backend is running on the appropriate port (e.g.,
http://localhost:3001).
Make sure you have Node.js and npm installed on your machine before proceeding with the installation.
The PayrollPal Backend provides the following API endpoints for interaction with the application:
GET /creators: Retrieve a list of all content creators.GET /creators/:id: Retrieve details of a specific content creator by their ID.POST /creators: Create a new content creator profile (Admin only).PUT /creators/:id: Update an existing content creator profile (Admin only).DELETE /creators/:id: Delete a content creator profile (Admin only).
GET /posts: Retrieve a list of all TikTok posts.GET /posts/:id: Retrieve details of a specific TikTok post by its ID.POST /posts: Create a new TikTok post for approval (Content Creator).PUT /posts/:id: Update the details of an existing TikTok post (Content Creator).DELETE /posts/:id: Delete a TikTok post (Content Creator).
GET /contracts: Retrieve a list of all contracts.GET /contracts/:id: Retrieve details of a specific contract by its ID.POST /contracts: Create a new contract for content creators (Admin only).PUT /contracts/:id: Update the details of an existing contract (Admin only).DELETE /contracts/:id: Delete a contract (Admin only).POST /contracts/approve/:id: Approve a contract (Content Manager).POST /contracts/pay-approved-contracts: Batch payment processing (Admin).
GET /categories: Retrieve a list of all content categories.GET /categories/:id: Retrieve details of a specific content category by its ID.POST /categories: Create a new content category (Admin only).PUT /categories/:id: Update the details of an existing content category (Admin only).DELETE /categories/:id: Delete a content category (Admin only).
POST /auth/token: Obtain an access token by providing valid credentials.POST /auth/register: Register a new user account.
Please ensure that you have the necessary authentication and authorization scopes for certain endpoints (e.g., Content Manager or Admin scopes) as defined in your code.
💡 Integration: To fully utilize the PayrollPal application, both the Frontend and Backend components should be used together. The PayrollPal Frontend interacts with this backend to provide a seamless experience for contract management and payment automation.
Please ensure that you have both the Frontend and Backend components set up and configured to work together for the complete functionality of PayrollPal.
For detailed instructions on setting up and running the frontend, refer to the PayrollPal Frontend README.