Perishop is a web app that provides you with 300+ Shops.
O aplicativo PERISHOP é construído usando a pilha média:
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-PEROSHOP/
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
cliente/
This is the folder you need to try the app, please don't delete it.
It contains the project build after running :
> ng build
rotas/
Contém dois arquivos:
? shops.js :
Handling Shops end points.
? usuários.js :
Handling Users end points.
modelos/
? shops.js :
Holds the definition of Shop Model using Mongoose Schema, for querying the database and handling all CRUD operations that concerns shops records.
? usuários.js :
Holds the definition of User Model using Mongoose Schema, for querying the database and handling all CRUD operations that deals with users records.
configuração/
Holds an Object with database path to connect to using mongoose.
banco de dados/
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.
Os recursos do perechop são:
Crie uma pasta de projeto (por exemplo: Perendopopp) e CD nela:
~$ cd ..../perishopApp
Clone o repositório do GitHub em sua pasta de projeto executando:
~$ .../perishopApp // present working directory
git clone https://github.com/atidevs/perishop.git
Você precisa ter o MongoDB instalado: servidor comunitário
https://www.mongodb.com/download-center?jmp=nav#community
Se você estiver no MacOS ou Linux, pule esta etapa, se o Windows baixar e instalar o git:
https://git-scm.com/downloads
Depois que o MongoDB e o Git instalados, abra o Git Bash e o CD em:
~$ cd .../mongodb/bin (... : wherever path you installed mongodb in, usually C:/mongodb/bin)
Em seguida, execute este comando:
~$ mongod --dbpath=".../perishopApp/perishop/database"
Abra outro terminal Git Bash:
~$ cd .../perishopApp/perishop (... : wherever the path to your perishopApp folder is)
E depois execute este comando:
~$ start
Abra o seu navegador e vá para:
localhost:3000
Parabéns! Você está na página inicial
Se você deseja verificar os registros no banco de dados, siga estas etapas:
Abra a linha de comando (CMD) como administrador no Windows ou (terminal) no macOS e Linux e execute:
> mongo
Depois, se você olhar para o terminal Git Bash, onde você corre:
~$ mongod --dbpath=".../perishopApp/perishop/database"
Você verá em algum lugar no final (2 conexões agora abertas): a primeira conexão é do próprio aplicativo (quando você é executado ~ $ START) e o segundo é o que acabamos de executar: (> Mongo).
Agora você pode executar esses comandos:
> 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
Desfrute ✌️