This project was created watching and following this video
You can see the project working here: Airbnb Clone Base
- Copy
.env.exampleand rename to.env - Create an atlas account (check instructions here)
- Create a cloudinary account
- Create an
unsignedupload presetin cloudinary - Add the
NEXT_PUBLIC_CLOUDINARY_CLOUD_NAMEto the.envfile (inside the double quotes) - Add the
MONGODB_URIto the.envfile (inside the double quotes) - Add the
NEXTAUTH_SECRETto the.envfile (inside the double quotes) - Add the
GITHUB_IDto the.envfile (for github login) - Add the
GITHUB_SECRETto the.envfile (for github login) - Add the
GOOGLE_CLIENT_IDto the.envfile (for google login) - Add the
GOOGLE_CLIENT_SECRETto the.envfile (for google login) - Run
npm i - Run
npm run dev
- Login to your Github Account
- Go to
https://github.com/settings/applications/new - Fill the form, in Homepage URL and Authorization callback URL you can put (http://localhost:3000/) if you are in your local (when pushing to prod this will be your domain)
- Click on
Register application - Copy the
Client IDis theGITHUB_ID - Click in
Generate a new client secret - Copy the
Client secretsis theGITHUB_SECRET
- Login to your gmail Account
- Go to
https://console.cloud.google.com/ - Create a new Project
- Wait for the project to be created
- Select the project in the top bar or using the button in the Notifications dialog
- Go to
https://console.cloud.google.com/apis/dashboard - In the left side select
OAuth consent screen - In the OAuth consent screen, select
External - Click on
Create - Fill
App namewith the name you want - Select you email in
User support email - Fill the Developer contact information with your email
- Click
Save and continue - In Scopes Click
Save and continue - In Test users Click
Save and continue(last step) - In the left side select
Credentials - In the Credentials screen, select
+ CREATE CREDENTIALS->Create Oauth client ID - In Application type select
Web application - Fill name with whatever you want
- In
Authorized redirect URIs, click on+ ADD URI - Fill with
http://localhost:3000/api/auth/callback/google, if its for prod change the domain part - Click on
CREATEa modal will show - Copy the
Client IDis theGOOGLE_CLIENT_ID - Copy the
Client secretis theGOOGLE_CLIENT_SECRET