This is a project for a contacts storing application with React as it's frontend and a .NET REST API as the backend, this project also persists the information in MongoDB and includes the Swagger documentation for the Rest API calls.
Client: React, CSS.
Server: .NET, MongoDB, Swagger
- react
- react-router-dom
- dotnet
- MongoDB Compass
- mongoDB Shell (mongosh)
Instructions for MongoDB:
Open mongosh and add the path
mongodb://localhost:27017Then add the following code to create a new database
use ContactsStoreCreate a collection
db.createCollection('Contacts')Insert two registries to the collection
db.Contacts.insertMany([{ "Username": "JosePerez", "Email": "jperez@gmail.com", "Telefono": "02231512345678" }, { "Username": "PaulaLopez", "Email": "plopez@gmail.com", "Telefono": "0111587654321" }])Check if the registries were correctly inserted
db.Contacts.find().pretty()Running the project:
Clone the project
git clone https://github.com/mtadakuma/React_Net_Contacts.gitTo run the serverside webapi:
Go to the project directory
cd React_NET_ContactsGo to WebApi folder
cd ContactsStoreApiRun the server side Api
dotnet runTo run the clientside in React:
Go to the project directory
cd React_NET_ContactsGo to React folder
cd clientInstall dependencies
npm installStart the server
npm run startTo check Swagger documentation:
While the serverside webapi is running go to the following path
https://localhost:7235/swagger/index.html
or
http://localhost:5021/swagger/index.html
In case any error appears make sure to have the following softwares
- MongoDB Community https://www.mongodb.com/try/download/community
- MongoDB Shell https://www.mongodb.com/try/download/shell
- dotnet SDK https://dotnet.microsoft.com/en-us/download
