Code Monkey home page Code Monkey logo

warp-api-starter-template's Introduction

warp-api-starter-template

This is a starting point for a starter template, this is far from usable from a starter template perspective. The work is in progress and not recommended for production use at the moment.

Features

  • REST APIs (Warp + http-api-problem + hyper + tokio)
  • GraphQL Server with Playground (Juniper)
  • Minimal Authentication framework (Argonautica + Biscuit)
  • Redis for cache
  • PostgreSQL for database and SQLx for query
  • systemfd + listenfd to for debug mode auto-reload

Inspired by Meh's blog post.

It all started here → meh/meh.github.io#5

To get started

Run docker-compose up to get the PostgreSQL, Redis and Adminer running Along with our Web API Service. This starts the application in debug mode with auto reload on changes in the source.

docker-compose up

Migrations are handled using movine, This is run inside the debug start script. Adminer instance could be accessed from http://localhost:8080. Refer docker-compose.yml file for configurations and access credentials. If you are not using docker-compose to start the application, install movine using cargo install movine.

The GraphQL playground could be accessed from http://localhost:3535/graphql/playground

To run the application without docker-compose

cp .env.sample .env # make relevant changes to the environment configurations
movine fix # assuming movine is installed, to install movine `cargo install movine`
# run the application in debug mode
RUST_LOG=info cargo run

Release docker build example

export DATABASE_URL=postgres://mydb:[email protected]:5432/mydb # this is required for the build to work, this needed for sqlx macros to verify schema
docker build -t warp-api-release:latest -f release.Dockerfile --build-arg DATABASE_URL .

Run the docker example

docker run --rm -it -p 3535:3535 --env-file .env -e HOST="0.0.0.0:3535" warp-api-release:latest

Refer .env.sample file for the env variables required.

Contributions

With your help we can make this a real good starter template for starting a web service. Contributions are welcome!

License

All contributions will be licensed as MIT

warp-api-starter-template's People

Contributors

aslamplr avatar dependabot[bot] avatar maxcountryman avatar trifel avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.