官术网_书友最值得收藏!

Creating the project structure

Now it's time to create our project structure. Organizing source files may sound like a simple task, but a well-thought-out project structure organization helps us understand the underlying architecture of our application. You'll see an example of this later in this book, when we'll talk about the Flux application architecture. Let's start by creating our root project directory named snapterest inside your home directory ~/snapterest/.

Then, inside it, we will create two other directories:

  • ~/snapterest/source/: Here, we'll store our source JavaScript files
  • ~/snapterest/build/: Here, we'll put compiled JavaScript files and an HTML file

Now, inside ~/snapterest/source/, create the components/ folder so that your project structure would look like this:

  • ~/snapterest/source/components/
  • ~/snapterest/build/

Now when we have our fundamental project structure ready, let's start populating it with our application files. First, we need to create our main application file app.js in the ~/snapterest/source/ directory. This file will be the entry point to our application, ~/snapterest/source/app.js.

Leave it empty for now, as we have a more pressing matter to discuss.

主站蜘蛛池模板: 禹州市| 克拉玛依市| 亚东县| 南京市| 泰顺县| 黑龙江省| 宁德市| 武陟县| 苍南县| 绵阳市| 紫金县| 苍山县| 七台河市| 府谷县| 兴宁市| 新密市| 新营市| 宁波市| 镶黄旗| 休宁县| 西贡区| 白山市| 师宗县| 时尚| 苗栗市| 修武县| 南华县| 原平市| 临邑县| 南丹县| 霍城县| 曲阳县| 襄汾县| 台前县| 扬中市| 宁波市| 商河县| 洪江市| 宣汉县| 永新县| 通州市|