Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate MongoDB from localhost:27017 to MongoDB Atlas for Deployment #483

Open
JordanChen123 opened this issue Feb 3, 2025 · 0 comments
Assignees
Labels
maintenance Update or upgrade feature web Website team

Comments

@JordanChen123
Copy link
Contributor

JordanChen123 commented Feb 3, 2025


Purpose

Currently, the website is using a local MongoDB instance (localhost:27017) for development. However, when deploying the website, this local database is not accessible.

Description

To allow the deployed version to retrieve data correctly, we need to:

  • Set up a cloud MongoDB database (MongoDB Atlas).
  • Modify .env files for production
  • Ensure Vercel has the correct MongoDB URI configured.

Tasks

  1. Set Up MongoDB Atlas
  • Set up a Free Shared Cluster
  • Create a New Database
  • Create a Database User (set a username and password)
  • Allow Access from any IP (we can restrict this later)
  • Copy the MongoDB Connection String.
  1. Update .env.production file
  • Add the MongoDB Atlas URI. Do not commit .env.production to Github (add it to .gitignore). Since this file may contain sensitive information like secrets.
  1. Add MongoDB URI to Vercel Environment Variables and Deploy
  2. Deploy and Test
  • Test the API in Production, such as whether or not you can send POST and GET requests.

Resources

@JordanChen123 JordanChen123 added maintenance Update or upgrade feature web Website team labels Feb 3, 2025
@github-project-automation github-project-automation bot moved this to Backlog in SOFT Project Feb 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance Update or upgrade feature web Website team
Projects
Status: Backlog
Development

No branches or pull requests

2 participants