Perishop is a web app that provides you with 300+ Shops.
Die Perishop -App wird unter Verwendung des Mittelwerts erstellt:
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)
Client-Perishop/
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
Kunde/
This is the folder you need to try the app, please don't delete it.
It contains the project build after running :
> ng build
Routen/
Enthält zwei Datei:
? Shops.js :
Handling Shops end points.
? Benutzer.js :
Handling Users end points.
Modelle/
? Shops.js :
Holds the definition of Shop Model using Mongoose Schema, for querying the database and handling all CRUD operations that concerns shops records.
? Benutzer.js :
Holds the definition of User Model using Mongoose Schema, for querying the database and handling all CRUD operations that deals with users records.
Konfiguration/
Holds an Object with database path to connect to using mongoose.
Datenbank/
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.
Perischof -Funktionen sind:
Erstellen Sie einen Projektordner (zB: Perishopapp) und CD in IT:
~$ cd ..../perishopApp
Klonen Sie das Github -Repository in Ihrem Projektordner, indem Sie ausführen:
~$ .../perishopApp // present working directory
git clone https://github.com/atidevs/perishop.git
Sie müssen MongoDB installieren lassen: Community Server
https://www.mongodb.com/download-center?jmp=nav#community
Wenn Sie in MacOS oder Linux sind, überspringen Sie diesen Schritt, wenn Windows Git herunterladen und installieren:
https://git-scm.com/downloads
Sobald MongoDB und Git installiert sind, öffnen Sie Git Bash und CD in:
~$ cd .../mongodb/bin (... : wherever path you installed mongodb in, usually C:/mongodb/bin)
Dann führen Sie diesen Befehl aus:
~$ mongod --dbpath=".../perishopApp/perishop/database"
Öffnen Sie ein weiteres Git -Bash -Terminal:
~$ cd .../perishopApp/perishop (... : wherever the path to your perishopApp folder is)
Und dann diesen Befehl ausführen:
~$ start
Öffnen Sie Ihren Browser und gehen Sie zu:
localhost:3000
Glückwunsch! Sie sind auf der Startseite
Wenn Sie die Datensätze in der Datenbank überprüfen möchten, folgen Sie folgenden Schritten:
Öffnen Sie die Befehlszeile (CMD) als Administrator in Windows oder (Terminal) in MacOS und Linux und rennen Sie:
> mongo
Danach schauen Sie sich das Git -Bash -Terminal an, an dem Sie laufen:
~$ mongod --dbpath=".../perishopApp/perishop/database"
Sie werden irgendwo am Ende sehen (2 Verbindungen jetzt geöffnet): Die erste Verbindung stammt aus der App selbst (wenn Sie ~ $ start) und die zweite ist die, die wir gerade ausführen: (> Mongo).
Jetzt können Sie diese Befehle ausführen:
> 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
Genieße ✌️