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
ルート/
2つのファイルが含まれています。
? 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
実行して、プロジェクトフォルダーのgithubリポジトリをクローンします。
~$ .../perishopApp // present working directory
git clone https://github.com/atidevs/perishop.git
MongoDBをインストールする必要があります:Community Server
https://www.mongodb.com/download-center?jmp=nav#community
MacOSまたはLinuxを使用している場合、この手順をスキップします。Windowsをダウンロードしてインストールする場合は:
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
おめでとう!あなたはホームページにいます
データベースのレコードを確認する場合は、次の手順に従ってください。
コマンドライン(CMD)をWindowsの管理者として、またはMacOSおよびLinuxの(端末)として開き、実行します。
> mongo
その後、実行するGit Bash端末を見ると:
~$ mongod --dbpath=".../perishopApp/perishop/database"
最後のどこかが表示されます(2つの接続が開いています):最初の接続はアプリ自体(〜$ startを実行するとき)から、2番目は実行したものです:(> 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
お楽しみください✌️