- Standard of Code
- Initial Setup
- Running shell commands inside container
- Installing PHP Packages
- Creating Controllers
- Creating Request Class
- Creating Middlewares
- Creating Models
- Creating Migrations
- Running Migrations
- Making Tests
- Running Tests
- Running Linter
- pgAdmin
- Code Inspection
The code should be strictly be maintained in PSR12 standard. It's enforced by PHPCodeSniffer linter.
docker-compose run app sh initialsetup.sh
Or
docker exec -it ritsoft_app sh initialsetup.sh
UserName | Roles |
---|---|
csestudent0@rit.com | Student |
csestudent1@rit.com | Student |
csestudent2@rit.com | Student |
csefaculty1@rit.com | Faculty |
csefaculty2@rit.com | Faculty, StaffAdvisor |
csefaculty3@rit.com | Faculty |
hodcse@rit.com | HOD, Faculty |
principal@rit.com | Principal |
office_staff1@rit.com | Office |
office_staff0@rit.com | Office |
admin@rit.com | Admin |
- Principal is an ECE faculty, without any courses
- Departments: CSE, ECE
- Classrooms: BTECH S1 CSE, BTECH S2 CSE.
- All students are enrolled in Classroom
BTECH S1 CSE
csefaculty2@rit.com
is the staff advisor ofBTECH S1 CSE
- All students are enrolled in Classroom
- Subjects: CSE201, CSE301
- Courses:
csefaculty1@rit.com
takesCSE201
forBTECH S1 CSE
csefaculty2@rit.com
takesCSE301
forBTECH S2 CSE
All users have 123456 as their password
Use the format docker exec -it ritsoft_app <CMD>
or docker-compose run app <CMD>
An Example docker exec -it ritsoft_app php artisan migrate
or docker-compose run app php artisan migrate
docker exec -it ritsoft_app composer install <package_name>
Or
docker-compose run app composer install <package_name>
docker exec -it ritsoft_app php artisan make:controller <controller_name>
Or
docker-compose run app php artisan make:controller <controller_name>
docker exec -it ritsoft_app php artisan make:request <name>
Or
docker-compose run app php artisan make:request <name>
docker exec -it ritsoft_app php artisan make:middleware <middleware_name>
Or
docker-compose run app php artisan make:middleware <middleware_name>
docker exec -it ritsoft_app php artisan make:model <model_name>
Or
docker-compose run app php artisan make:model <model_name>
docker exec -it ritsoft_app php artisan make:migration <migration_name>
Or
docker-compose run app php artisan make:migration <migration_name>
Migrations should be named with a proper naming convention like for example, creating a table users should be named like create_users_table
If multiple tables are created in a migration for a feature, it should be named like, create_<feature>_tables
For adding columns, addcolumn<column_name>_to_<table_name>
For removing columns, removecolumn<column_name>_from_<table_name>
docker exec -it ritsoft_app php artisan migrate
Or
docker-compose run app php artisan migrate
docker exec -it ritsoft_app php artisan make:test <test_name>
Or
docker-compose run app php artisan make:test <test_name>
Add --unit
to make unit tests instead of FeatureTest.
sh ./test.sh
sh ./lint.sh
pgAdmin can be used to directly access the database for debugging purposes. 0. Start pgAdmin service by docker-compose --profile pg-admin up -d
- Visit localhost:9000 and login
- Username: admin@rit.com
- Password: 123456
- Get Ip Address of the container
docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' ritsoft_db
- Click add new server, set any name and paste this IP Address in the Connection > Host Column.
- DO NOT change the database
- Username: ritsoft
- Password: ritsoft
- After successful connection, click Databases > ritsoft, in the left panel.
- You can now do whatever you want with this db.
So far the easiest way I've seen is just copying the vendor directory from the container to host.
sudo docker cp ritsoft_app:/ritsoft/vendor /absolute/path/to/RITSoft-3.0/src/
Better alternatives are always welcome