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

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.

主站蜘蛛池模板: 奉化市| 崇礼县| 合江县| 井陉县| 河源市| 如皋市| 东阿县| 阜平县| 南漳县| 峨边| 龙门县| 女性| 沙坪坝区| 苏尼特右旗| 贵州省| 怀宁县| 中西区| 卢龙县| 卢湾区| 德昌县| 青铜峡市| 信丰县| 修水县| 五莲县| 沾化县| 南川市| 双桥区| 葫芦岛市| 衡南县| 上饶县| 获嘉县| 保康县| 临城县| 盘锦市| 亳州市| 泉州市| 抚顺县| 洮南市| 平遥县| 宜兰县| 广元市|