Skip to content

Latest commit

 

History

History
91 lines (83 loc) · 3.3 KB

README.md

File metadata and controls

91 lines (83 loc) · 3.3 KB

Dall-E-clone

  1. Clone the repository
  2. Go to the client directory
cd client
  1. To install the dependencies
npm install
  1. To run the frontend
npm run dev
  1. To run the backend:
    a) Open up another terminal
    b) Go to the root folder
cd ..

c) Go into the server folder

cd server

d) To install all the dependencies

npm install

Connect to mongoDB

  1. Go to www.mongodb.com/atlas/database
  2. Click on try free-> create a account->new project->give it a project name->project owner
  3. Add current ip address->build a data base->create one for free->create cluster->data base access
  4. Database->connect->type user name & password->connection method-> connect your application
  5. Copy the generated string->add this string to the .env file in the server directory
  6. The user name will be prefilled but you have to manually type in your password
  7. Restart the terminal on the server side
ctrl+c
npm start
  1. To allow access to the database
  2. Go to network access at the dashboard->add ip address -> allow access from anywhere (there are sucuirity risks)/allow access from specific server ips by individualy white listing them(secure)

Api key for the OpenAi

1. Go to openai.com
2. Press the api button
3. Get started
4. Create a account
5. Click on the profile -> view api keys(get a paid subscription for image generation)
6. Create a new secret key
7. Copy the key
8. Add to the .env file
9. Restart the server

Cloudinary setup

Cloudinary is used here to host our images so that we can use them later on for sharing or downloading purposes.
1. Go to cloudinary.com
2. Create an account
3. Move to the dashboard
4. Copy cloud name,api_key, api_secret
5. Paste it in the .env file
6. Restart the server again

Host the backend in the web

1. Go to render.com-> login->new-> web service
2. Go to the project repo
3. Change the repository visibility to public
4. Copy the url -> paste the url in the render -> continue->enter a name->root directory->server->
start command->npm run start-> create web service
5. If build is failed
a) Go to environment->provide the environment variables from .env file one by one
b) Go to logs -> manual deployment-> clear build caches and deploy
c) If you click the displayed url then you will see this backend server is beployed

To deploy the fronend in the web

1. Copy the url generated by the backend server
2. Change http://localhost:8080 with the url(only change the mentioned part of the url)
in CreatePost.jsx(client-> src->pages),Home.jsx
3. Go to hostinger(paid service)
4. Create a domain with name -> connet with setup-> manage->file manager->
public_html-> delete default.php-> to get to our build->go to the terminal of our code
	cd client
npm run build
  1. Go to the dist folder->open in the file explorer ->
  2. Open up the dist folder->drag and drop everything from there to public_html file
  3. Go back to the dashboard->click the chosen domain name
    The website will be running.