Skip to content

servant-server + persistent implementation of an accidental twitter+messenger clone.

Notifications You must be signed in to change notification settings

ldgrp/snails-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🐌 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

About

servant-server + persistent implementation of an accidental twitter+messenger clone.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published