Aplicação com React para prática pessoal de GraphQL e Apollo Client.
-
Crie um banco de dados no MongoDb Atlas;
-
Faça o download deste repositório através do botão verde Code no topo da página e, em seguida, clicando em Download ZIP. Ou, se preferir, através do terminal (Git Bash, Powershell, etc.), use o comando:
git clone https://github.com/sucodelarangela/reading-list-graphql.git
-
Acesse a pasta do projeto com seu terminal;
-
Rode o comando
npm install
ouyarn install
para instalar as dependências (você precisa ter o Node.js instalado); -
Crie um arquivo
.env
na pastaserver
. Neste arquivo, crie duas variáveisDBUSER
eDBPASS
e atribua a elas seu nome de usuário e a senha do seu banco de dados do MongoDb Atlas criado no passo 1, respectivamente.
A aplicação só funcionará com esses dados corretamente inseridos no arquivo
.env
.
- Após a correta configuração acima, acesse a pasta
server
e rode o back-end com o comandonpm start
ouyarn start
. Você deve receber a seguinte mensagem de confirmação:
Now listening for requests on port 4000
Connected to database
- Depois, abra outra instância do seu terminal e acesse a pasta
client
. Rode o comandonpm run dev
ouyarn dev
para ter acesso ao front-end da aplicação. Você deve receber a seguinte mensagem de confirmação:
yarn run v1.22.19
$ vite
VITE v4.0.4 ready in 736 ms
➜ Local: http:https://127.0.0.1:5173/
➜ Network: use --host to expose
➜ press h to show help
- Acesse o endereço
Local
acima no seu navegador para usar a lista de leitura.
English version
React app for personal practices of GraphQL and Apollo Client.
-
Create a database in MongoDb Atlas;
-
Download this repository by clicking the green Code button on top of the page and then clicking Download ZIP option. Or use the following command on your terminal (Git Bash, Powershell, etc.):
git clone https://github.com/sucodelarangela/reading-list-graphql.git
-
Access the project root folder on your terminal;
-
Run
npm install
oryarn install
to install all project dependencies (you must have Node.js installed); -
Create a
.env
file in theserver
folder. In this file, create two variablesDBUSER
andDBPASS
and set their values with the user name and password for the MongoDb Atlas database created on step 1, respectively.
The app will only work properly if these data are correctly set in
.env
file.
- After the correct setup above, access the
server
folder and runnpm start
oryarn start
on yout terminal to start the back-end. You should receive the following message:
Now listening for requests on port 4000
Connected to database
-
Then, open a new instance of your terminal and access the
client
folder. Runnpm run dev
oryarn dev
to have access to the front-end. You should receive the following message: -
Open the
Local
url above on your browser to use the reading list.
Developed with 🧡 by @sucodelarangela