perishop
1.0.0
Perishop is a web app that provides you with 300+ Shops.
Perishop應用是使用平均堆棧構建的:
M: MongoDB (NoSQL / Non Relational database)
E: ExpressJs (Web application framework for building APIs)
A: Angular (Javascript MVC framework for front end web development)
N: NodeJs (Environment for running Javascript in the server side)
客戶 - 臨時工/
Contains source code of the front end side :
- Components : client-perishop/src/app/components
- Services : client-perishop/src/app/services
- Modules : client-perishop/src/app
- Package.json (dependencies)
- Angular CLI generated files
客戶/
This is the folder you need to try the app, please don't delete it.
It contains the project build after running :
> ng build
路線/
包含兩個文件:
? shops.js :
Handling Shops end points.
? users.js :
Handling Users end points.
型號/
? shops.js :
Holds the definition of Shop Model using Mongoose Schema, for querying the database and handling all CRUD operations that concerns shops records.
? users.js :
Holds the definition of User Model using Mongoose Schema, for querying the database and handling all CRUD operations that deals with users records.
config/
Holds an Object with database path to connect to using mongoose.
資料庫/
Holds the database folder where all records go and mongoDB journaling is saved.
? app.js
Is the entry point to the app. It holds a set of imports among which : Express, Mongoose, BodyParser, Passport and other middleware.
Perishop功能是:
創建一個項目文件夾(例如:perishopapp)和CD:
~$ cd ..../perishopApp
通過運行:
~$ .../perishopApp // present working directory
git clone https://github.com/atidevs/perishop.git
您需要安裝MongoDB:社區服務器
https://www.mongodb.com/download-center?jmp=nav#community
如果您在MacOS或Linux上跳過此步驟,則Windows下載並安裝Git:
https://git-scm.com/downloads
安裝MongoDB和Git後,將Git Bash和CD打開:
~$ cd .../mongodb/bin (... : wherever path you installed mongodb in, usually C:/mongodb/bin)
然後運行此命令:
~$ mongod --dbpath=".../perishopApp/perishop/database"
打開另一個git bash終端:
~$ cd .../perishopApp/perishop (... : wherever the path to your perishopApp folder is)
然後運行此命令:
~$ start
打開您的瀏覽器,然後轉到:
localhost:3000
恭喜!您在主頁上
如果要檢查數據庫中的記錄,請按照以下步驟:
在Windows或MacOS和Linux中的(終端)中打開命令行(CMD),然後運行:
> mongo
之後,如果您查看運行的Git Bash終端:
~$ mongod --dbpath=".../perishopApp/perishop/database"
您會在末尾看到某個地方(現在打開2個連接):第一個連接來自應用程序本身(當您運行〜$ start時),第二個連接是我們剛剛運行的連接:(> mongo) 。
現在您可以運行以下命令:
> show dbs // to show all available databases
> use perishop // to use the perishop database displayed among available dbs
> show collections // to show all collections inside perishop db
> db.users.find().pretty() // to list all signed up users and their information
> db.shops.find().pretty() // to list all shops and their information
享受✌️