CodeLabz is a platform where the users can engage with online tutorials and the organizations can create tutorials for the users. The platform will be developed using ReactJS front end library and the back end will be developed using the Google Cloud Firestore and Google Firebase Real-Time database.
Clone the repository.
Run npm install
in CodeLabz
folder.
cd CodeLabz/
npm install
First you need to create a .env
file in CodeLabz
folder following the template provided in the file env.example
- Sign in to https://console.firebase.google.com/.
- Click Add Project and necessary information about the project.
- Agree to the terms and click Create Project.
- After creating the project, click Add Firebase to your web app.
- Add app nick name and click register app.
- Copy the firebase configuration.
- Paste the configuration
.env
file.
You should fill in these values in their relevent fields in the .env
file.
To run the project:
$ npm start
If you failed to run the project do the following steps :
- delete node modules
- delete package-lock.json
- re run
npm install
If error still exists addSKIP_PREFLIGHT_CHECK=true
in your .env file
NOTE: Before starting the server create a file named
.env
same as.env.example
and add your Firebase Configurations in the file.
Visit localhost:3000 to browse.
NOTE:To Deploy firebase cloud functions you have to satisfy following requirements
- Your Firebase project should have Blaze plan or higher version
- You should have installed Firebase CLI tool in your machine
Run npm install
in CodeLabz/functions
folder.
cd CodeLabz/functions
npm install
Then you have to generate a private key file for your service account.To get the key file go to this link and follow the instructions https://firebase.google.com/docs/admin/setup#initialize-sdk.
Once you have obtaions the key create folder name as 'private' in this folder 'CodeLabz/functions'.Then copy and paste the key file in private folder. Rename the key file as 'cl-dev-pk.json'
After that change the database url to your project database url in 'CodeLabz/functions/auth.js'
Move to the root directory and open a command prompt and type following commands
npm run-script build
firebase login
firebase projects:list
Find the project ID form the project list that you want to deploy the cloud functions
firebase use <project_id>
firebase deploy
To run storybook :
npm run storybook
It will redirect to 6006 port.Find detailed information here
To run cypress tests:
npx cypress run
It will open a promt displaying all the tests.You can find detailed information here