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.
؟ user.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.
؟ user.js :
Holds the definition of User Model using Mongoose Schema, for querying the database and handling all CRUD operations that deals with users records.
تكوين/
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 ..../perishopApp
استنساخ مستودع github في مجلد المشروع عن طريق التشغيل:
~$ .../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"
افتح محطة باش أخرى:
~$ cd .../perishopApp/perishop (... : wherever the path to your perishopApp folder is)
ثم قم بتشغيل هذا الأمر:
~$ start
افتح متصفحك وانتقل إلى:
localhost:3000
تهاني! أنت على الصفحة الرئيسية
إذا كنت ترغب في التحقق من السجلات في قاعدة البيانات اتبع الخطوات هذه:
افتح سطر الأوامر (CMD) كمسؤول في Windows أو (Terminal) في MacOS و Linux وتشغيله:
> mongo
بعد ذلك إذا نظرت إلى محطة Git Bash حيث تديرها:
~$ mongod --dbpath=".../perishopApp/perishop/database"
سترى مكانًا في النهاية (اتصالان مفتوحان الآن): الاتصال الأول هو من التطبيق نفسه (عند تشغيل ~ $ 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
استمتع ✌