Skip to content

Bankole2000/deployment-test

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Project Name

A brief description of your project.

Frontend Setup:

To set up the frontend, follow these steps:

  1. Install dependencies by running:

npm i

  1. Start the development server:

npm run dev

Backend Setup:

To set up the backend, follow these steps:

  1. Set up MongoDB database URI in the .env file. (Instructions or blog link on how to do this)

  2. Install dependencies by running:

npm i

  1. Start the backend server:

npm run dev

After running both the frontend and backend servers, follow these additional steps:

Configuration:

  1. Go to the client/src/CONSTANT.jsx file and modify the URLs to match your backend and frontend links. Make sure to add a / at the end of each URL.

export const CONSTANT = { server: "http://localhost:4000/", // CHANGE WITH YOUR BACKEND LINK (/ is a MUST AT THE END) client: "http://localhost:5173/", // CHANGE WITH YOUR FRONTEND LINK (/ is a MUST AT THE END) };

Replace http://localhost:4000/ with your actual backend link and http://localhost:5173/ with your actual frontend link.

That's it! You have successfully set up and configured the project. Now you should be able to run the frontend and backend components together and start developing your application.

Additional Notes:

Feel free to add any additional notes or instructions that might be relevant to your project's setup and usage. This could include details about other configuration files, environment variables, or any other specific steps that need to be followed.

MongoDB Database Setup: Create a MongoDB Atlas Account:

MongoDB Atlas is a fully managed cloud database service provided by MongoDB. To get started, go to the MongoDB Atlas website (https://www.mongodb.com/cloud/atlas) and create an account if you don't already have one. Follow the on-screen instructions to set up your account.

Create a New Cluster:

Once you have logged in to your MongoDB Atlas account, click on the "Build a Cluster" button to create a new cluster. Choose the cloud provider and region that suits your needs. The free tier is a good starting point for development purposes.

Set Up Database User:

After creating the cluster, go to the "Database Access" tab and click on the "ADD NEW DATABASE USER" button. Create a new user with a username and password. Make sure to assign the necessary privileges (e.g., read and write access) to this user.

Set Up IP Whitelist:

In the "Network Access" tab, click on the "ADD IP ADDRESS" button and add your IP address to the whitelist. This will allow your backend server to access the database. For development purposes, you can also allow access from anywhere (0.0.0.0/0). However, for production, it's recommended to restrict access to specific IP addresses.

Connect to the Database:

Go back to the "Clusters" tab and click on the "CONNECT" button for your cluster. You will be presented with connection options. Choose "Connect your application" and copy the connection string. This string contains the necessary credentials to connect to your MongoDB database.

Set Up .env File:

In your backend project, create a .env file at the root level (if you don't already have one). In this file, set up the MongoDB URI by adding the following line:

MONGODB_URI=your_connection_string_goes_here Replace your_connection_string_goes_here with the connection string you copied from MongoDB Atlas.

Access MongoDB URI in Your Backend Code:

In your backend code, access the MongoDB URI using process.env.MONGODB_URI. You can then use this URI to connect to the database using a MongoDB client or an ORM (Object-Relational Mapping) library like Mongoose (for Node.js).

About

Repo for testing deployment submission

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors