Here are the exact steps you need to follow to run booklee in your local system!
So, first of all you need to do is clone the Rajdip019/booklee GitHub repository or you can also download the files.
If you don't know how to clone or where to download the code the watch this video.
How to Clone a GitHub Repo Blog on the same topic, official GitHub Docs
Or you can run this code in your PC/Laptop terminal
git clone https://github.com/Rajdip019/booklee.git
Then you need to navigate to the directory and run the following code. This will install all the dependencies you need.
npm install
Before setting up any API keys you need to change the helper, so that it makes request to your localhost.
Go to ./helpers/template.js .
Remove everything and copy paste this code snippet.
export const template = {
templateString : "http://localhost:3000"
}
Note : You can have different localhost other than 3000, use that in that case.
This is the most important part. There are Authentication, Database, Filter & search and Map APIs that you need to setup. Let's go through all of them one by one.
Before jumping in just rename your .env.example file to .env.local
Here we have used next-auth for authentication.
We have three different authentication options.
- GitHub
Now for Google you first need to create OAuth credentials. Watch the video mentioned below.
How to create Google OAuth Credentials (Client ID and Secret).
After you get the keys you need to setup the google client ID and google client secret in the .env.local file.
For Twitter watch this video.
How to Get Twitter API Key 🔑 and Secret Key
After you get the keys you need to setup the twitter client ID and twitter client secret in the .env.local file.\
For GitHub watch this video.
How to create GitHub OAuth App (client ID and client secret)
After you get the keys you need to setup the GitHub client ID and GitHub client secret in the .env.local file.
With that's done you are done with the authentication part.
We are using Cosmos DB from Microsoft Azure Cloud. If you want to have a database and access that you can watch my this video of Azure Cosmos DB International Conf.
Make your Database and Integrate that.
You can watch this for Search and Filter API
Azure Cognitive Search Service
For hosting or in a production environment you must need a Next Auth secret let's see how we can get one.
Not providing any secret or NEXTAUTH_SECRET will throw an error in production.
Use this code in your terminal to generate a key for you.
$ openssl rand -base64 32
Copy that key and paste it beside SECRET keyword in the .env.local file. (You renamed).
You also need to out this in your .env.local.
Because, when deploying to production, set the NEXTAUTH_URL environment variable to the canonical URL of your site.
NEXTAUTH_URL=https://example.com
It maybe your localhost URL or maybe the URL where you want to deploy.
If you want to contribute here and dont't want to set all this up to get started. The you can shoot me a mail with your GitHub profile URL and where you want to contribute. After reviewing I will send you the credentials.
Never push ceredetials to GitHub
For pushing your updates make a new branch in thsi format.
(your_name)/(functionality_name)
And also describe a bit what changes made and try to attach screenshots.
If you face any problem you can mail me at [email protected]. Or DM me on LinkedIn.