School Adminstration Platform Project

Please guys i am working on this project important project. It is a school management school . Please i have problem in the modeling of the system data flow(Model). The is the relationship of the Model.
A student belongs to a department , each department has many courses that the student will offer , courses belongs to a semester (two semesters : first semester and second semester ) and this semester are under a particular year of study ie session(first year, second year …). Please can anybody help me with a beta modeling technique in this context .

I might can help you out. I don’t work for free though. If you’re still interested let’s work out anymore details and I’ll send your a proposal. Let me know.

Where exactly are you stuck within the project? It sounds as though you have an understanding of what the model is calling for by defining each entity and its associations, have you drawn out an ER-diagram to help illustrate what needs to be implemented?

Everyone here as well as myself would be more than happy to inform you and provide steps along the way for free, but being that this is a school project you should show that you have put in some effort on your own. Otherwise there are people such as justinkbug that would take on the job for a fee, but you will not benefit from such a partnership in any way.

My advise would be to start with an ER-diagram to determine how the tables should be structured. There is a video tutorial here which can help you (they use a similar work-case as what your working on but it will yield a different solution). Then write out the SQL by hand to create the database tables. Next write each SQL statement that will provide functionality for your application, again by hand, to ensure your design will meet all the requirements of the project. Finally determine all of the application rules that are necessary (this is implemented in code not SQL) and then you can start to code.

If you upload an ER diagram I as well as others on the site would be willing to provide advise, but you need to put something into the project first.


thank you for your reply this is the ER- Diagram

Ok nice, so where exactly are stuck in the project? Do you understand how SQL and relations works or are you just trying to model each table within CakePHP itself?

For the later, you can quickly generate scaffold classes of the model using the bake console. Using a terminal (cmd on windows or git-bash); type bin/cake bake model <table_name>. This will create two classes for the model: Table and Entity. I can go over what each of these do if you’d like? Also CakePHP has a standard convention for how database tables should be named. Keep them in plural form (as you’ve already done) and separate each word with an underscore.

BTW, if this is for a course, you may want to speak with your professor before implementing this in CakePHP. They might not mind but Model View Controller frameworks do a lot of abstraction where you can bypass course objectives which is why many professors refuse to let students use them. It’s a double edged sword because you need to know them in the real world but schools frown on them. Of course if its a general web development course where your learning real world tools you should be fine, but I’d recommend asking first before wasting precious time.

1 Like

thank you for your replies. My problem is that am trying to model each table within CakePHP itself .

Step 1. Write out the migrations

Migrations is a way of constructing your databases in a way that it can be versioned. Every change that has been made will be contained within a PHP script that is easy to follow.

The benefits of this is always knowing what has happened during the life of the database and enabling you to easily revert a databases design if anything goes wrong. This is also great if you are designing an open source project where users may not know much about database design and administration. Such users will only need to run a simple command which sets everything up for them.

To create a migration file simply open your terminal and type bin/cake bake migration <migration_name>. This will create a file under config/migrations. In this file create each table and specify the type and constraints for each row. You can read how to write migrations here. It’s very simple and you can learn all the major features in 10 minutes. Once you have your migration written create a database in your dbms of choice (Mysql, SqlServer, PostgreSQL, etc.) and specify the host (localhost, domain name or ip address of computer hosting the database), database name, database user and password within config/app.php datasource section. Type the command bin/cake migrations migrate into your command line. If anything goes wrong you can reverse the process with bin/cake migrations rollback and troubleshoot the issue before trying again.

  1. Scaffold the project

Next you can use cakephp built in scaffolding system to create template files. Open your terminal and type this command in for each table name bin/cake bake all <table_name>. This command will create your model (Table and Entity), Controller, View files as well as test files (I will not go over this but you should test every method you write before writing it.)

  1. Code

Now you can write all of the logic for the project. Keep all of your database logic within the respective Table class and modify how the data should be presented to the user using the models Entity class. Keep you controllers small so that their only purpose is to collect data needed for the page from the model and send it to the view.

CakePHP is great because it allows you to build a prototype without any real coding. After you’ve scaffolded your project you can easily open your web browser, specify the url for one of your tables and actually have a mini version of your application. Example, type localhost/students/ and you will be presented with a table of all students entered into the database. This allows you to concentrate on your applications logic rather than setting up minor details that every web page needs to have to operate.

  • P.S. You can run a server with your server of choice (apache/iis/etc.) but CakePHP has a wrapper tool around the PHP base server that you can call by entering the command line and typing bin/cake server
1 Like

I recommend you read the tutorial here