Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/abhijithganesh/quizapp-hono-backend
This is the backend service for the QuizApp, designed to manage quizzes, questions, and user responses. It provides a RESTful API for creating, updating, and fetching quiz data.
https://github.com/abhijithganesh/quizapp-hono-backend
bun honojs prisma sqlite typescript
Last synced: 2 months ago
JSON representation
This is the backend service for the QuizApp, designed to manage quizzes, questions, and user responses. It provides a RESTful API for creating, updating, and fetching quiz data.
- Host: GitHub
- URL: https://github.com/abhijithganesh/quizapp-hono-backend
- Owner: AbhijithGanesh
- License: bsd-3-clause
- Created: 2024-06-22T12:15:18.000Z (7 months ago)
- Default Branch: master
- Last Pushed: 2024-06-24T20:56:52.000Z (7 months ago)
- Last Synced: 2024-11-02T14:33:51.035Z (3 months ago)
- Topics: bun, honojs, prisma, sqlite, typescript
- Language: TypeScript
- Homepage:
- Size: 32.2 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# QuizApp Backend
This is the backend service for the QuizApp, designed to manage quizzes, questions, and user responses. It provides a RESTful API for creating, updating, and fetching quiz data.
## Installation
Before running the service, ensure you have Bun installed on your system. Then, install the project dependencies with:
```sh
bun install
```Running the Service
To start the backend service, use the following command:```sh
bun run dev
```After starting the service, it will be available at .
## API Endpoints
- `GET /`: Home endpoint, returns a greeting message.
- `GET /get-all-questions`: Fetches all questions with options.
- `POST /upload-questions`: Allows uploading a list of questions.
- `POST /post-options`: Endpoint to post options for questions.
- `POST /post-answers`: Submit answers for questions.
- `POST /return-scores`: Returns the score based on submitted answers.
- `PATCH /update-option`: Updates the text of a specific question identified by the question ID.
- `DELETE /delete-question`: Updates the text of a specific question identified by the question ID.
- `PATCH /update-option`: Updates the text of a specific option identified by the option ID.## Docker Support
To simplify deployment and ensure consistency across different environments, this project includes Docker support. Below are the steps to build and run the QuizApp backend using Docker.
### Building the Docker Image
1. Navigate to the root directory of the project.
2. Build the Docker image using the following command:```sh
docker build -t quizapp-backend .
```This command builds a Docker image named quizapp-backend based on the instructions in the Dockerfile.
Running the Service in a Docker Container
After building the image, you can run the QuizApp backend inside a Docker container using:```sh
docker run -d -p 3000:3000 quizapp-backend
```## Tech Stack
The QuizApp backend is built using a modern technology stack to ensure high performance, scalability, and ease of development. Below is an overview of the key technologies used:
- **Bun**: Used as the runtime environment, Bun offers exceptional performance and a wide range of built-in functionalities, making it an ideal choice for building fast and efficient web services.
- **TypeScript**: The backend is written in TypeScript, providing strong typing and modern JavaScript features, which enhances code quality and developer productivity.
- **Docker**: Docker containers are used to encapsulate the service's environment, ensuring consistency across development, testing, and production deployments.
- **Hono**: Hono is a Fast, lightweight, built on Web Standards. Support for any JavaScript runtime.
- **SQLite**: SQLite is a file based database
This combination of technologies provides a solid foundation for building and scaling the QuizApp backend, ensuring that it can handle large volumes of traffic and data efficiently.
## Contributing
Contributions to the QuizApp backend are welcome. Please ensure to follow the project's code standards and submit your pull requests for review.
## License
This project is licensed under the BSD-III License - see the LICENSE file for details.