A project to facilitate the organization of People into Groups. The application allows creating groups and people entries, managing their relationships, and viewing the organization structure.
- Docker and Docker-compose
- Node.js for local development
- Clone the repository
git clone https://github.com/gordins/organization-manager.git
cd organization-manager
- Setup environment variables
Copy the .env.example
file to .env
and modify the environment variables if necessary.
cp .env.example .env
- Build the Docker containers
docker-compose build
- Start the application
docker-compose up
- Run migrations
docker exec -it organization-manager-app-1 npm run migrate
- Access the application
The application should now be running on http://localhost:3000
To run the tests, ensure the application is running and execute:
docker exec -it organization-manager-app-1 npm run migrate
This will run all tests defined in the test directory.
GET /people
: Retrieves all people.GET /people/:id
: Retrieves a single person by ID.GET /people/:id/memberships
: Retrieves all group memberships of a person (including indirect ones)POST /people
: Creates a new person; Updates the cache.PUT /people/:id
: Updates a person; Updates the cache. This is the route to be used to move a person from a group to another.DELETE /people
: Deletes all people; Updates the cache. This is only for testing purposes;DELETE /people/:id
: Deletes a person; Updates the cache.
GET /groups
: Retrieves all groups.GET /groups/:id
: Retrieves a single group by ID.GET /groups/:id/members
: Retrieves all members (people) of a single group, including nested group members.POST /groups
: Creates a new group; Updates the cache.PUT /groups/:id
: Updates a group. Updates the cache. This is the route to be used to move groups by providing anotherparentGroupId
DELETE /groups
: Deletes all groups. Updates the cache. This is only for testing purposesDELETE /groups/:id
: Deletes a group. Updates the cache.
GET /organization
: Retrieves the entire organization structure (from cache).DELETE /organization/cache
: Clears the organization cache.
To stop and remove all Docker containers, networks, and volumes:
docker-compose down -v