This project provides a backend API for a project collaboration tool with role-based access control. Users can manage teams, projects, and tasks, with permissions varying by role.
Ensure you have the following tools installed:
- Docker
- Docker Compose
- Node.js (optional, for local development)
Follow these steps to set up and run the server:
Create a .env file in the root directory of the project and add the following environment variables:
DB_HOST=localhost
DB_PORT=5432
DB_USERNAME=admin
DB_PASSWORD=admin
DB_DATABASE=p_collaboration
PORT=3000
JWT_SECRET=your_jwt_secret
JWT_EXPIRATION=3600
Use Docker Compose to build and run the application:
docker-compose up --build -d
This command will:
- Build the Docker images defined in the Dockerfile.
- Start the API and PostgreSQL services.
To set up the database schema, run the migrations:
docker compose exec api npm run typeorm migration:run -- -d dist/data-source.js
To populate the database with initial data (roles and permissions), run the seeder:
docker-compose exec api npm run seed
- Ensure all services are running before executing migrations or seeding.
- For troubleshooting or development, you can check the container logs using:
docker-compose logs -f