- Clone Repository
- cd into
notesfolder - run
mvn clean install - run
mvn spring-boot:run - Now the backend hould be running on port 8080, and you can use curl or postman to interact with it
NOTE: Currently the backend is hosted using MongoDB Atlas. I have tested this on my local machine and it works fine, however Coder cannot access the Mongo endpoint (some kind of DNS restriction), and as there is no local Mongo instance ready yet our database will NOT function inside of coder. However, once that problem is resolved, we can simply plug in the working Mongo URI and the code will work.
Currently, I have set up SpringBoot to use a test account on my (luanders@tcd.ie) cloud hosted MongoDB Cluster. To set up your own MongoDB Atlas account:
- Create a (free-tier) account here: https://www.mongodb.com/cloud/atlas/register
- Create a new database cluster, name it.
- Create a new user for the database and set it as an
adminrole. Save the name and password for later. - Click on the
connectbutton in your cluster, then click ondrivers, and grab the Java access URI. - Create a new
.envfile - Set the URI as the following environmental variable:
MONGODB_URIso that your database can be accessed while coding, making sure to use the name and password you created earlier. For example:mongodb+srv://<username>:<password>@cluster_name.abcde.mongodb.net/notes?retryWrites=true&w=majority. - Set the name of the Cluster to the follow environment variable:
MONGODB_NAME - Change the
application.propertiesfile to match the newly create environment variables (i.espring.data.mongodb.uri=$MONGODB_URI) - Run the command
source .envto load environment variables - MongoDB should now be connected!
To run the frontend:
- cd into
frontend - run
npm run dev - React is not running on port 3000