Skip to content

Latest commit

 

History

History
65 lines (47 loc) · 1.65 KB

README.md

File metadata and controls

65 lines (47 loc) · 1.65 KB

🐌 Snails (Test) Server & API

Generates a Swagger spec from a Servant API.

This program will

  • Start a warp server on port 8081
  • Initialize a SQLite database file at ./db.sqlite
  • Populate the SQLite database (see Main.hs)
  • Serve the Snails REST API
  • Generate Swagger docs

⚡ Viewing the spec

Use Swagger Editor to view swagger.json.

🚀 Usage

This project was built with Servant + Persistent.

If you do not have cabal, I highly recommend ghcup or reading this manual.

# Clone this repo
git clone https://github.com/ldgrp/snails-api

# Navigate to project directory
cd snails-api

# Start the server
cabal run

💻 Development

  1. Clone this repo git clone https://github.com/ldgrp/snails-api
  2. Edit the files in src/.
  3. Run the main executable with cabal run in the main directory. This will generate a swagger.json.

🗒️ Todo

  • Authentication
  • Handle JWT tokens. For protected endpoints, the server will currently accept the user id as a "token".
  • User API
  • Entry API
  • Messaging API
  • (Mock) Map API
  • (Mock) News API
  • (Mock) Transport API
  • (Mock) Weather API
  • Use esqueleto. Persistent does not support SQL joins 😞
  • Postgres support
  • Tests