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
享受✌️