Giter VIP home page Giter VIP logo

realword-tide-sqlite-backend's Introduction

RealWorld Example App

[YOUR_FRAMEWORK] codebase containing real world examples (CRUD, auth, advanced patterns, etc) that adheres to the RealWorld spec and API.

This codebase was created to demonstrate a fully fledged fullstack application built with Tide including CRUD operations, authentication, routing, pagination, and more.

We've gone to great lengths to adhere to the Tide community styleguides & best practices.

For more information on how to this works with other frontends/backends, head over to the RealWorld repo.

How it works

This backend leverages rusts' tide framework for implementing the web app, and sqlite database managed as a single file. Simple configuration is available through .env file.

Getting started

Install rust

# download rustup and install Rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

Download and install sqlite

# for Ubuntu:
apt-get install sqlite3

Configure backend by editing .env file

Build and run backend

cargo run

Configuration

You can run app with fresh database by setting DROP_DATABASE=1 in .env file. Database location and host and port are configurable as well.

Testing

Note: registering and logging in take some seconds because password hashing is CPU consuming.

Postman testing

Configure HOST=127.0.0.1 or delete HOST from .env and set HTTP_PORT=3000 and execute

cargo run

Integration Test

These tests do not cover http requests parsing, instead they introduce business logic testing steps by artificially forming middle layer server requests thus simulating local loop without involving tide framework. Execute

cargo test -- --nocapture

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.