Perishop is a web app that provides you with 300+ Shops.
L'application Perishop est construite en utilisant la pile moyenne:
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-périshop /
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
client/
This is the folder you need to try the app, please don't delete it.
It contains the project build after running :
> ng build
routes /
Contient deux fichiers:
? boutiques.js :
Handling Shops end points.
? users.js :
Handling Users end points.
modèles /
? boutiques.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.
base de données /
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.
Les fonctionnalités de périrish sont:
Créez un dossier de projet (par exemple: Perishopapp) et CD.
~$ cd ..../perishopApp
Clone le référentiel GitHub dans votre dossier de projet en fonctionnant:
~$ .../perishopApp // present working directory
git clone https://github.com/atidevs/perishop.git
Vous devez installer MongoDB: serveur communautaire
https://www.mongodb.com/download-center?jmp=nav#community
Si vous êtes sur macOS ou Linux, sautez cette étape, si Windows Téléchargez et installez GIT:
https://git-scm.com/downloads
Une fois MongoDB et Git installés, ouvrez Git Bash et CD dans:
~$ cd .../mongodb/bin (... : wherever path you installed mongodb in, usually C:/mongodb/bin)
Puis exécutez cette commande:
~$ mongod --dbpath=".../perishopApp/perishop/database"
Ouvrez un autre terminal Git bash:
~$ cd .../perishopApp/perishop (... : wherever the path to your perishopApp folder is)
Puis exécutez cette commande:
~$ start
Ouvrez votre navigateur et allez à:
localhost:3000
Bravo! Vous êtes sur la page d'accueil
Si vous souhaitez vérifier les enregistrements dans la base de données, suivez ces étapes:
Ouvrez la ligne de commande (CMD) en tant qu'administrateur dans Windows ou (Terminal) dans MacOS et Linux et Run:
> mongo
Ensuite, si vous regardez le terminal Git Bash où vous courez:
~$ mongod --dbpath=".../perishopApp/perishop/database"
Vous verrez quelque part à la fin (2 connexions désormais ouvertes): la première connexion provient de l'application elle-même (lorsque vous exécutez ~ $ start) et le second est celui que nous venons de gérer: (> Mongo).
Vous pouvez maintenant exécuter ces commandes:
> 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
Profitez de ✌️