https://github.com/daquirm/rslang-service
A backend prototype for RS Lang
https://github.com/daquirm/rslang-service
Last synced: 8 months ago
JSON representation
A backend prototype for RS Lang
- Host: GitHub
- URL: https://github.com/daquirm/rslang-service
- Owner: DaQuirm
- License: bsd-3-clause
- Created: 2019-03-21T22:49:33.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2020-10-08T20:56:35.000Z (over 5 years ago)
- Last Synced: 2025-03-13T17:19:19.356Z (over 1 year ago)
- Language: Haskell
- Size: 91.8 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: ChangeLog.md
- License: LICENSE
Awesome Lists containing this project
README
# rslang-service
## Running locally
The web service application is published as a [Docker image](https://hub.docker.com/r/daquirm/rslang-service).
In order to store and retrieve data it needs a running [postgres](https://www.postgresql.org/) container.
1. Install [Docker](https://www.docker.com/) and make sure it's running.
2. Create a Docker network to be used by the containers: `docker network create rslang`.
3. Pull and run postgres: `docker run -e POSTGRES_USER=rslang-service -e POSTGRES_PASSWORD=rslang -e POSTGRES_DB=lang -v postgres-data:/var/lib/postgresql/data --network=rslang --network-alias=pg -p 5432:5432 -d postgres`
It's a good idea to install a visual database administration tool such as [pgAdmin](https://www.pgadmin.org/) to browse and manipulate the service database.
4. Pull and run the service app: `docker run -p 3000:3000 --network=rslang daquirm/rslang-service`
5. Verify that the service app is responding by sending a request to an endpoint (for example `GET /users`)
To send HTTP requests use `curl` or install a REST API client, such as [Advanced REST Client](https://install.advancedrestclient.com/install).
6. The service app can initialise the database by creating all the schemas/tables. Send `POST /schema/init`.
7. Your personal rslang backend is ready to use! Now you can use [Swagger Editor](editor.swagger.io) to view the API documentation. Get the JSON data (`GET /swagger.json`) and copy-and-paste it into the editor.