Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/emmanuelaaron/02_trivia
https://github.com/emmanuelaaron/02_trivia
Last synced: 22 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/emmanuelaaron/02_trivia
- Owner: Emmanuelaaron
- Created: 2019-11-15T12:04:20.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2023-02-02T06:41:13.000Z (almost 2 years ago)
- Last Synced: 2024-11-20T18:37:41.720Z (about 2 months ago)
- Language: JavaScript
- Size: 181 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Trivia
## Getting Started
### Prerequisites and local storage
Developers contributing to this product should have the following installed on their local machines
- python3
- pip
- node
- virtualenv#### Backend
- cd into the backend directory
`$ cd backend`
- create a virtual environment and activate it using the command below
`$ virtualenv venv `
`$ source venv/Scripts/activate`
- Install all the dependencies within the requirements file using the command below
`$ pip install -r requirements.txt`
- To Run the application use the following commands
`$ export FLASK_APP=flaskr`
`$ export FLASK_ENV=development`
`$ flask run`
By default the applucation is run on http://127.0.0.1:5000/
* copy the Url it into postman and put to run any endpoint of your preference in the table belowHTTP Method | Endpoint | Functionality | Parameters
------------|----------|---------------|------------
GET | / | Getting all available categories | None
GET | /questions | Getting all questions | None
DELETE | /questions/question_id |Deletes a question using an id | question_id
POST | /questions| Creates a question| None
POST | /questions/search | Getting questions basing on a search term | None
GET | /categories/category_id/questions | Getting questions based on category | category_idTo post a question, the data should be in this format
```
{
"question": "question",
"answer": "answer",
"category": category,
"difficulty": category
}
```
To search for a question, the data should be in this format.
`
{
"question": search_word
}
`### Frontend
- cd into the frontend directory
`$ cd frontend`
- Install all the dependencies using the command below
`$ npm install`
- Then run the server using the command below
`$ npm start`### Authors
Emmanuel Isabirye