This project is a single-page application that holds both the frontend (react-app) and backend (express + mongoose) sides using the express web framework.
๐๐ป The application is accessible via Heroku: https://fullstackopen-p3-phonebook.herokuapp.com/
The data is kept in a Mongo DB instance located in a MongoDB Atlas.
NOTE 1: In order to apply any frontend changes in this server, you need to git clone [email protected]:sergioruizsan/fullstackopen.git
the main repo. The frontend code is located under https://github.com/sergioruizsan/fullstackopen/tree/main/part3/phonebook
NOTE 2:
To deploy the app to heroku, there is at least one environment variable reqiured, the one for the connection. Checkout the .env.sample
for the variables needed. Setting the Mongo DB URI env variable can be done through the heroku CLI with the following command: heroku config:set MONGODB_URI='mongodb+srv://<user>:<password>@cluster0.abwvbql.mongodb.net/personApp?retryWrites=true&w=majority'
If you have the VSCode REST Client, you can trigger the requests from the file located in requests/persons.rest
In the project directory, you can run:
Starts the express server in production mode
Starts the express server in development mode,
using nodemon
to restart the server automatically whenever there are any changes in the backend code.
Generates the production build for the frontend. The main repository is required to succesfully run this command, as mentioned earlier.
Deploys the application to Heroku
Runs both npm run build:ui
and npm run deploy
. The main repository is required to succesfully run this command, as mentioned earlier.
Shows the heroku logs
Run eslint