Skip to content

Latest commit

 

History

History

backend

Kawtharuna Backend Server - Node Js (Status: 90% Done)

  • This project services the backend server and contains the functionality needed to connect to the backend server.

Current Features:

1- Provides Quranic Khatmat

  • Paged List of Khatmat.

2- Provides Recitation Audio Files Per Khatma

  • Lists all recitation audio files.
  • Plays recitation audio files.
  • Downloadable recitation audio files.

3- Provides Islamic Files Library

  • Lists files from the library.
  • Provides files categories.
  • Provides search options.
  • Downloads files.
  • File's thumbnails.

Technical Considerations

1- API Documentation

Our API documentation is generated by Swagger and can be accessed here.

Note: You can call any GET endpoint without any restriction or authorization.

2- Database Documentation

You can view our Database Diagram here.

3- Generating and Viewing Code Documentation

Our code documentation can be accessed here.

We use TypeDoc for generating documentation from our TypeScript codebase. To generate the documentation, you need to run the following command:

npm run docs

This command will generate documentation in the ./docs directory. To view the generated documentation, open the index.html file located in the ./docs folder in your web browser.

4- Running the Project

Development Environment Setup

To get the Kawtharuna Backend Server up and running in your development environment, follow these steps:

  1. Database Configuration:

    • Create a PostgreSQL database and user with the following credentials:
      • Username: kawtharuna_user
      • Password: DEV_PASSWORD_THANK_YOU
      • Database Name: kawtharuna
    • Initialize the database tables by executing the SQL statements found in src/db/sql/kawtharuna-dev.sql. Alternatively, you can set synchronize: true in src/db/data-source-dev.ts to let TypeORM create the tables automatically.
  2. Firebase Setup:

    • Create a .keys folder in the project root.
    • Place your Firebase Admin SDK file within this folder as .keys/firebase-adminsdk-dev.json.
    • Ensure the filename aligns with your NODE_ENV setting, following the pattern: ./.keys/firebase-adminsdk-${process.env.NODE_ENV}.json.
  3. Environment Variables:

    • Create a .env.dev file in the src/environment/ directory.
    • The file should be named .env.{process.env.NODE_ENV}.
    • Include the following variables:
      • GCLOUD_PROJECT (required) - The name of your Firebase project's storage.
      • PORT (optional, default: 8080) - The port number for the server.
      • NODE_ENV (optional)

    Note: The GCLOUD_PROJECT variable is essential for Firebase storage integration.

  4. Project Dependencies:

    • Run npm install at the root of the project to install all necessary packages.
  5. Starting the Server:

    • Execute npm run dev to start the server.
    • By default, the server runs on localhost:8080 or on a port specified by your .env.dev configuration.

Now, your Kawtharuna Backend Server should be operational in your development environment!