farzi-vichar-api

About

Welcome! I really appreciate that you checked out the contributing guide. This means you are thinking of contributing to this project. Well, you are at the right place.

Project Structure

Before you start contributing to any project it is important to understand the folder structure for that project. For this project, the details are as follows:

1) data - This folder contains the data related to all the languages. This is where the actual shayari and quotes reside.

   - for [adding a new language data](#adding-data) make a new folder inside the `data` folder as `data/${Your_Language_Name}`. 
   - add the data file inside the folder as `data/${Your_Language_Name}/data.js`. 
   - NOTE: name the data file as 'data.js' only.
   - then [update the database](#updating-the-database) `quotes.db`, an sqlite3 database. 

2) data_endpoints - This folder contains the retriever or the filetered quotes function. It return the filtered data for the language specified. It’s usecase can be viewed in the routes/route.js file. - there is a single file, filter.js , DO NOT CHANGE ANYTHING IN THIS FILE

3) routes - This folder contains all the routes the API provides. It has a single file route.js (DO NOT CHANGE ANYTHING IN THIS FILE) which has all the routes, which are mainly:

 - */:language_name* -> returns all of the data for the language if no range is provided.

 - */:language_name?min=value&max=value* -> returns the data in the specified range of min and max. 

 - */:language_name/random* -> returns a single random data from the language specified. 

4) languages.js - contains an array of all the languages for which the data exists.

5) index.js - the entry point to this project, DO NOT CHANGE ANYTHING IN THIS FILE.

6) db.js - the file is used to update the database, anytime a new language is added to the API.

Installation and Making Changes

For installation and local setup, follow these steps:

Adding Data


Updating the database


Important