Skip to content
Snippets Groups Projects
README.md 2.2 KiB
Newer Older
# PROG2900

## Database setup
This project requires the use of MongoDB. To use the application, a MongoDB Atlas database must first be set up and configured. The following is a step by step guide of how to set up the database:
1. Create a user/Log into MongoDB Atlas (https://www.mongodb.com/atlas)
2. ?Create an organization?
3. On the left-hand side in the menu under "Organization", press the "Project" tab.
![Alt text](images/image-1.png)
4. In the right-hand corner, press "New Project" and name it as you wish. 
![Alt text](images/image-2.png)
5. After successful creation, you should be taken to a page called "Overview". In the middle of the page right below "Create a deployment", press the button that says "+ Create"
![Alt text](images/image.png)
6. When creating a database deployment, select the M10 template. The provider and region can be selected as is most fit to the organization.
![Alt text](images/image-4.png)
7. Name your cluster appropriately. Optionally, give your cluster tags. Press "Create".
![Alt text](images/image-5.png)
8. After deploying the database you will be taken to the Security Quickstart page. Choose the option "certificate", and chose an appropriate "Common Name". Toggle the "Download certificate when user is added" on, and select a certificate expiration. Then press the "Add User" button.
![Alt text](images/image-7.png)
9. After pressing "Add User", the access certificate will automatically be downloaded to your PC. The certificate will be used to access your database, and should be kept in a safe location to prevent unauthorized access. 
![Alt text](images/image-8.png)
10. Still in the Security Quickstart page, scroll down to the "Where would you like to connect from?" section. Press "Add My Current IP Address", and then press "Finish and close" at the bottom of the page.
![Alt text](images/image-9.png)
![Alt text](images/image-10.png)
11. You have now created a database deployment, but you will still have to configure the connection to the database. 

### Database connection
1. To create a connection with the database, locate your newly created database deployment and press "Connect"

![alt text](images/image-11.png)

2. Select "Drivers"

![alt text](images/image-12.png)