https://github.com/olsyy/emergency-api
Ktor and Kotlin-based server for storing and managing emergency situation data
https://github.com/olsyy/emergency-api
api h2 kotlin ktor server sql-exposed
Last synced: 11 months ago
JSON representation
Ktor and Kotlin-based server for storing and managing emergency situation data
- Host: GitHub
- URL: https://github.com/olsyy/emergency-api
- Owner: olsyy
- License: apache-2.0
- Created: 2025-01-21T10:05:42.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-02-25T10:55:31.000Z (over 1 year ago)
- Last Synced: 2025-03-19T03:16:34.359Z (over 1 year ago)
- Topics: api, h2, kotlin, ktor, server, sql-exposed
- Language: Kotlin
- Homepage:
- Size: 27.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 📢 Emergency Api


## 📓 Description
Emergency API is a Ktor-based server application designed for managing zones and incidents related to emergency services. The server provides endpoints for client applications to interact with zone and incident data. It also includes functionality to calculate the appropriate zone for each new incident based on its geographical coordinates.
## 💡 Usage
num | type | endpoint | description
----| ------------ | ------------ | -------------------
1 | GET | /zones | Returns a list of all zones.
2 | GET | /zones/{zoneId} | Returns a specific zone by its ID.
3 | GET | /incidents | Returns a list of all incidents.
4 | GET | /incidents/{zoneId} | Returns incidents associated with a specific zone.
5 | POST | /incidents/create | Creates a new incident with the provided data.
6 | POST | /incidents/update | Updates an existing incident.
## 🏁 Start
1. Clone the repository:
```bash
git clone https://github.com/yourusername/emergency-service-server.git
```
2. Open the project in IntelliJ IDEA or another Kotlin-compatible IDE.
3. Sync the project with Gradle files.
4. Build and run the server application.
5. Access the server endpoints via http://localhost:8080. You can use Postman or any other API testing tool to interact with the API.
## 🏠 Architecture
- Kotlin: The primary programming language used for the project.
- Ktor Framework: The server is built using the Ktor framework for handling HTTP requests and routing.
- SQL Exposed: For interacting with the H2 database and mapping data to entities.
- H2 Database: The database stores the zones and incidents, and H2 is used for local storage during development.
- Clean Architecture: The project follows Clean Architecture principles for maintainability, scalability, and testability, ensuring a clear separation of concerns between the server's layers.
## License
This project is licensed under the Apache License 2.0.