Skip to content

Hassan950/OudBackEnd

Repository files navigation

Oud image

🎼 Oud

GitHub contributors GitHub issues GitHub forks GitHub stars GitHub license

Table of Contents

About The Project

Music Player API with Node.js Express

Built With

Getting Started

This is an example of how you may give instructions on setting up your project locally. To get a local copy up and running follow these simple example steps.

Installation

  1. Clone the repo
git clone https://github.com/Hassan950/OudBackEnd.git
  1. Install dependencies
npm install

Database Seeds

  1. Clear database
npm run delete
  1. Import Seeds
npm run import

Environmental Variables

For developers, you can directly use our development.json located in config\development.json or modify it if you like.

For production, you need to make your own config\production.json with the following structure.

{
 "JWT_KEY": "fooPassword",
 "JWT_EXPIRES_IN": "30d",
 "FBClientID": "1",
 "FBClientSecret": "2",
 "GoogleClientID": "3",
 "GoogleClientSecret": "4Bar",
 "GithubClientID": "FooBar",
 "GithubClientSecret": "Baz123",
 "SENDGRID_API_KEY": "6Baz",
 "Firebase_Service_Acc": {
   "type": "XXXXXX",
   "project_id": "XXXXXX",
   "private_key_id": "XXXXXX",
   "private_key": "XXXXXX",
   "client_email": "XXXXXX",
   "client_id": "XXXXXX",
   "auth_uri": "XXXXXX",
   "token_uri": "XXXXXX",
   "auth_provider_x509_cert_url": "XXXXXX",
   "client_x509_cert_url": "XXXXXX"
 },
 "db": "mongodb://localhost:27017/YourCollection",
 "PORT": "3000",
 "NODE_ENV": "production"
}
  • JWT_KEY: Your json web token secret key.
  • JWT_EXPIRES_IN: The period token can last before expiring expressed in seconds or a string describing a time span

    Eg: 60, "2 days", "10h", "7d". A numeric value is interpreted as a seconds count. If you use a string be sure you provide the time units (days, hours, etc), otherwise milliseconds unit is used by default ("120" is equal to "120ms").

  • FBClientID and FBClientSecret: Are used for signing up with facebook.
  • GoogleClientID and GoogleClientSecret: Are used for signing up with google.
  • GithubClientID and GithubClientSecret: Are used for signing up with GitHub.
  • SENDGRID_API_KEY: The api key for sending emails through sendgrid
  • Firebase_Service_Acc: This object has credentials of firebase that is used for pushing notifications. More Details Here Add Firebase to your JavaScript project
  • db: Your database path

    Eg: "mongodb://localhost:27017/YourCollection" If you're hosting on your localhost server.

  • PORT: Your api hosting port
  • NODE_ENV: It must be "production" in order to run the api on production otherwise use config\development.json

Running

  1. Running on development
npm start
  1. Running on production

Upon creating config\production.json like in Environmental Variables section. run this script:

npm run start-prod

Testing

The tests can be found in tests, and each controller has its own test file in tests\unit\controller. Mongoose models tests are also found in tests\unit\models as well as middleware which is located at tests\unit\middlewares.

Running Unit Tests

run the following script:

npm test

Generating Coverage Report

By default, upon running npm test this prints the coverage report in console as well as generating an html version located at coverage\index.html. alternatively, you can run:

npx jest --coverage

API Documentation

  1. install redoc-cli globally:
npm i redoc-cli -g
  1. run the following redoc-cli command:
redoc-cli bundle docs/openapi.yaml -o docs/apidoc.html

it will generate an html file apidoc.html located at docs/apidoc.html.

Functional Documentation

install the latest version on npm globally (might require sudo if you are on linux):

npm install -g jsdoc

in order to generate the documentation, run the jsdoc command:

jsdoc -r ./src

By default, the generated documentation is saved in a directory named out. You can use the --destination (-d) option to specify another directory.

Roadmap

See the open issues for a list of proposed features (and known issues).

Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b AmazingFeature-Feat)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin AmazingFeature-Feat)
  5. Open a Pull Request

License

Distributed under the MIT License. See LICENSE for more information.

Contact

Abdelrahman Tarek - [email protected]
Ahmed Magdy - [email protected]
Hassan Mohamed - [email protected]
Mohamed Abo Bakr - [email protected]

Project Link: https://github.com/Hassan950/OudBackEnd

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published