Before contributing to EduWiz, ensure you have the following tools installed on your system:
-
Docker
Docker is required to run the backend services. If you do not have Docker installed, you can download it from Docker's official website. -
Firebase Emulators
The Firebase emulators are necessary for local development. If you do not have them installed, follow the instructions on the Firebase Emulator Suite documentation.
Please ensure these tools are properly installed and configured before proceeding with the setup steps below. Thank you for your interest in contributing to EduWiz! Follow the steps below to set up the project for local development.
To set up the project for local development, ensure you have the following credentials and configurations:
- Firebase Credentials
Obtain thefirebase_creds.json
file, which contains the necessary Firebase secrets. Place this file in the appropriate directory as specified in the project documentation.
Even when testing locally with Firebase emulators, certain secrets are still required due to namepsacing rules the emulator relies on and it is the expected behaviour of the firebase SDK.
To ensure the local development environment behaves as closely as possible to the production environment, configure the following secrets and environment variables in your .env.local
file located in the frontend directory:
Set the following environment variables for SeaweedFS:
NEXT_PUBLIC_S3_ACCESS_ID
: Set this toany
.NEXT_PUBLIC_S3_SECRET_KEY
: Set this toany
.NEXT_PUBLIC_S3_REGION
: Set this tous-east-1
.NEXT_PUBLIC_S3_ENDPOINT
: Set this to the hosted endpoint of your SeaweedFS instance (e.g.,http://localhost:8333
).
Populate the .env.local
file with the required Firebase environment variables:
NEXT_PUBLIC_FIREBASE_API_KEY
: Your Firebase API key.NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN
: The Firebase authentication domain.NEXT_PUBLIC_FIREBASE_PROJECT_ID
: The Firebase project ID.NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET
: The Firebase storage bucket.NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID
: The Firebase messaging sender ID.NEXT_PUBLIC_FIREBASE_APP_ID
: The Firebase app ID.
Set the base URL for the API:
NEXT_PUBLIC_API_URL
: The base URL for the API.
By consolidating these secrets and configurations into the .env.local
file, you ensure compatibility with Firebase emulators, SeaweedFS, and other services required for local development. Double-check that all values are correctly set before proceeding with the setup steps.
-
Start Firebase Emulators
Run the Firebase emulators locally using the following command:firebase emulators:start
Ensure that you override the
project_id
infirebase_creds.json
with the emulator-generated project ID. -
Configure Docker Compose
Open thedocker-compose.yml
file and set theSERVER_ENV
environment variable todevelopment
as shown below:environment: SERVER_ENV: development
-
Run the Backend Services
Start the backend services using Docker Compose with the following command:docker compose up
-
Start the Frontend Application
Navigate to the frontend directory and start the development server using:npm run dev
Once these steps are completed, the project should be fully set up and running locally.