An example of this app is running here: https://www.myplanapp.info. (for now only in Spanish, multi-language version upcoming)
-
Download and install Nodejs in your computer (LTS version).
-
Open the folder's project in VisualStudio Code and open the terminal.
-
Install dependencies. How? Run the following in the terminal:
npm install -
Create a file named
.envin the root of the project. Update it with the environment variables. You can review.env.examplefile as a referece. IMPORTANT: DO NOT CHANGE.env.exampleOR COMMIT IT TO SOURCE CONTROL, THIS IS JUST A REFERENCE FILE.3.1. Set the port where the backend server will run
PORT=50003.2. The connection string to the mongo cluster and database
MONGO_CONNECTION_STRING=mongodb+srv://<user>:<password>@cluster0.m3ado.mongodb.net/<database>?retryWrites=true&w=majority3.3. The secret used to generate and validate JWT. This should be the same as the one in the frontend project, otherwise the authentication won't be possible.
JWT_SECRET=thesecretvalue -
Finally, run the server executing the following in the terminal:
npm run start-dev -
Now the API should be running and listening requests in the port configured in the
.envfile.