Perishop is a web app that provides you with 300+ Shops.
Aplikasi perishop dibangun menggunakan tumpukan rata -rata:
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)
klien-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
klien/
This is the folder you need to try the app, please don't delete it.
It contains the project build after running :
> ng build
rute/
Berisi dua file:
? Shops.js :
Handling Shops end points.
? Users.js :
Handling Users end points.
model/
? 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.
konfigurasi/
Holds an Object with database path to connect to using mongoose.
Database/
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.
Fitur penishop adalah:
Buat folder proyek (misalnya: Perishopapp) dan CD ke dalamnya:
~$ cd ..../perishopApp
Klon Repositori GitHub di folder proyek Anda dengan menjalankan:
~$ .../perishopApp // present working directory
git clone https://github.com/atidevs/perishop.git
Anda perlu menginstal MongoDB: server komunitas
https://www.mongodb.com/download-center?jmp=nav#community
Jika Anda menggunakan MacOS atau Linux, lewati langkah ini, jika Windows mengunduh dan menginstal git:
https://git-scm.com/downloads
Setelah MongoDB dan Git terpasang, buka bash git dan CD ke:
~$ cd .../mongodb/bin (... : wherever path you installed mongodb in, usually C:/mongodb/bin)
Kemudian jalankan perintah ini:
~$ mongod --dbpath=".../perishopApp/perishop/database"
Buka Terminal Bash Git lain:
~$ cd .../perishopApp/perishop (... : wherever the path to your perishopApp folder is)
Dan kemudian jalankan perintah ini:
~$ start
Buka browser Anda dan pergi ke:
localhost:3000
Selamat! Anda berada di halaman beranda
Jika Anda ingin memeriksa catatan dalam database, ikuti langkah -langkah ini:
Buka baris perintah (CMD) sebagai administrator di windows atau (terminal) di macOS dan linux dan jalankan:
> mongo
Setelah itu jika Anda melihat Terminal Git Bash tempat Anda menjalankan:
~$ mongod --dbpath=".../perishopApp/perishop/database"
Anda akan melihat di suatu tempat di akhir (2 koneksi sekarang terbuka): Koneksi pertama adalah dari aplikasi itu sendiri (saat Anda menjalankan ~ $ start) dan yang kedua adalah yang baru saja kami jalankan: (> mongo).
Sekarang Anda dapat menjalankan perintah ini:
> 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
Nikmati ✌️