To build the docker image and create the application container, run:
docker build .
docker-compose up
Open a new terminal window to create the database and run the migrations:
docker-compose run web rails db:create
docker-compose run web rails db:migrate
Run the rails seeds to populate the database with external data:
docker-compose run web rails db:seed
Connect to localhost:3000
in the browser to see the application running
- Reproduce the legacy structure to make the team management application more realistic
- Create a new entity called
Role
and associate it with theMembership
entity - Create new
controllers
to handle the new requests related to role and membership - In order to avoid bloated controllers, create
actions
to handle the business logic described in the challenge document
- Model the database with all necessary relationships among the tables
- Create
models
for each entity, add validations and write unit tests to them - Create and test each
controller
- Create and test each
action
- Write the
seed.rb
file. The database gets populated by running it - Dockerize the application
- Test the application entirely with Postman
- Role name must be unique and mustn't be blank
- Membership must be unique. A user can't join a team more than once
- Paginate users and teams list to improve perfomance, since requests might become slower with the ever-increasing number of teams and users
- Assign more roles to a team member, as there might be short-handed teams for any reason