Lesson 3: Project Structure
Any project needs to have a structure, you can start it from the beginning of your project that will be easier than try to organize everything after the project is done. The way that you organize your project's file may impact the development of the project.
Web
There is no restrict rules defined as a project structure for an HTML5 application. But instead add everything in the same folder, it is better group and name files in a logical convenient way.
Generally, a web application there are HTML, CSS, Images and Javascript files. Let’s assume your folder is the root of your server, inside it you must create your index and HTML files.
For the other files, you should create a distinct folder for js, css, image and data.
/root-project
index.html
js (this folder will contain your Javascript code)
index.js
bootstrap.js
image (is where you will save all your project images)
logo.png
banner.png
css (is related to styles sheet files)
menu.css
card.css
data (where you can add json, csv and text data files)
names.json
students.csv
Make sure that you are using lower case letters in all folder and file names. When using multiple words to name a folder or file separate them with a hyphen - (i.e., my-logo.png). Do not use special characters as well.
iOS
When you create a new project the Xcode already create and organize the files for you. However, under develop of your project you will create new files and these new files are not organized by Xcode, it is up to you handle that. I suggest to you create at least 3 main folders:
Model (Where you put any object class that you create)
Person.swift
View (Where you put any class that handles UI)
ListPersonViewController
Controller (Where you put any class that handles logic code / business logic. The core of the application)
PersonController
Inside of each one of these folders if you want you can create another folders to keep everything more organized, it all depends on how big is the project.
Android
When you create a new project the Android Studio already create and organize the packages for you. However, under develop of your project you will create new files and these new files are not organized by Android Studio, it is up to you handle that. I suggest to you create at least 3 packages:
com.yourapp.model (Where you put any object class that you create)
Person.java
com.yourapp.view (Where you put any class that handles UI)
PersonScreen.java
com.yourapp.controller (Where you put any class that handles logic code / business logic)
PersonController.java
PersonApi.java
Inside of each one of these folders if you want you can create another folders to keep everything more organized, it all depends on how big is the project.
Last updated