-
Notifications
You must be signed in to change notification settings - Fork 1
Guide: MongoDB
You will be given a database user and password to use the MongoDB database.
Each of you must create an .env file if you want to use the database. It must contain the url having your username and password. In order to do this, copy and paste the .env.test's first line you have in the users module with your user and password AND CREATE A NEW FILE .env.
So then, the .env file has this format:
MONGODB_URI=mongodb+srv://USER:PASSWORD@yovien1a.lzculny.mongodb.net/?appName=yovien1a
With your user and password.
This file extension is already in the gitignore. But please, the .env file with your credentials should NOT be in a pushed commit, in main, only in your local computer.
If you by accident create a .env.txt or something similar, that will be PUBLIC.
This are the credentials to store in the database, and as you may understand, uploading that is VERY dangerous.
Also, do NOT change the .env.test file, not only the test from users may fail, but also dont put your username and password there, CREATE THE .env FILE SEPARATELY. If you remove the NODE_ENV to test, it will upload the tests cases to the database and we do not want that.
- In order to connect to MongoDB, a secret called MONGODB_URI is already established.
- .env.test file has the connection for the test of GitHub Actions.
- Right now, the /createuser creates a user having username, email, password, createdAt (time the user was added to the db, autoinserted).
- The password is already hashed in user service using bcrypt.
- The login does not work YET as it finds all logins successful.
Personally, I recommend you to have MongoDB Compass Desktop App installed. It must be open when you execute the code to connect to the database. Any information you find relevant to include in this guide, please lmk!
YOVI en1a • © 2026 • Escuela de Ingeniería Informática
🏠 Home │
📂 Documentation │
🎮 Play now!
Sprint 0 (v0.1)
Sprint 1 (v0.1 Prototype)
Sprint 2 (v1.0)
Sprint 3 (v2.0)
- ADR: MongoDB
- ADR: Azure Host
- ADR: JWT
- ADR: Gatling
- ADR: bcrypt
- ADR: i18n
- ADR: Cucumber
- ADR: Playwright
- ADR: API REST - gameyapi