Server with Rust, Rocket, Diesel, Docker to create your own to-do-list

Overview

Installation

Install Docker & Docker-Compose

Then download the repository go to the root where the Dockerfile is and do: sudo docker-compose up sudo is needed to access to the port

In the terminal where you launch the docker-compose you should see something like that if all work : Rocket has launched from http://0.0.0.0:8000 Just go in the direction given on the terminal or go Here If it's not working then try :

  • localhost:8000
  • {docker ip}:8000
  • http://0.0.0.0:8000

Closing

When the server is running to close properly, you just need to ctrl c and run sudo docker-compose down

Tests

To see if the server passes all the tests you need to:

go to the root of the project and do:

  • sudo docker-compose up -d to launch the container in daemon mode
  • sudo docker container ls You should see something like this
CONTAINER ID   IMAGE                   COMMAND                  CREATED          STATUS         PORTS                                       NAMES
1bea5cd8857b   to_do_reminder_server   "bash -c 'cargo run …"   19 minutes ago   Up 6 minutes   0.0.0.0:8000->8000/tcp, :::8000->8000/tcp   to_do_reminder_server_1
  • copy the id under CONTAINER ID
  • sudo docker container exec CONTAINERID cargo test replace CONTAINERID by the id of your container
    • launch the test and hopefully everything will be ok
  • Dont forget to do sudo docker-compose down once you're done

Implemented

Status code

You can try every status code by going to {server}/status/<code>

  • 403 not login but action needs to
  • 404 not found
  • 405 try to do something only accessible for visitors
  • 417 code should not happen, it's when the user of the token doesn't exist
  • 418 expired token
  • 500 error internal (my bad)

Home

  • GET : / Home of the website
  • GET : /status/code With <code> a response status code allows to simulate a code to see the template to it

Account

First the server will always have an admin account with a default password password (you can change it)

Path

  • GET : /account/home Send to login if not login else display user personal page
  • GET : /account/users Allows to see every member of the website (if you're connected as admin get state of the database)
  • GET : /account/register Show a form to fill to create a new account
  • POST : /account/register Handle the form and try to create the account
  • GET : /account/users Show a form to fill to login
  • POST : /account/login Handle the form and try to login
  • PUT : /account/logout Disconnect the user
  • DELETE : /account/delete Try to delete the user
  • GET : /account/edit Show form to change password or profile picture
  • POST : /account/edit Handle the change password
  • POST : /account/set/picture Handle the new picture

To do

  • ask user confirmation javascript?
  • home account + template
  • users
You might also like...
simple static file server written in Rust based on axum framework

static-server simple static file server written in Rust based on axum framework I'm learning Rust and axum. My thought is simple. axum has a static-fi

Completely OBSOLETE Rust HTTP library (server and client)

OBSOLETION NOTICE This library is DEAD. It was a useful experiment and is now being replaced under the scope of the Teepee (experimentation grounds at

Web Server made with Rust - for learning purposes

Web Server made with Rust - for learning purposes

Archibald is my attempt at learning Rust and writing a HTTP 1.1 web server.
Archibald is my attempt at learning Rust and writing a HTTP 1.1 web server.

Archibald To be a butler, is to be able to maintain an even-temper, at all times. One must have exceptional personal hygiene and look sharp and profes

Salvo is a powerful and simplest web server framework in Rust world
Salvo is a powerful and simplest web server framework in Rust world

Salvo is an extremely simple and powerful Rust web backend framework. Only basic Rust knowledge is required to develop backend services.

VRS is a simple, minimal, free and open source static web server written in Rust
VRS is a simple, minimal, free and open source static web server written in Rust

VRS is a simple, minimal, free and open source static web server written in Rust which uses absolutely no dependencies and revolves around Rust's std::net built-in utility.

A blazingly fast static web server with routing, templating, and security in a single binary you can set up with zero code. :zap::crab:
A blazingly fast static web server with routing, templating, and security in a single binary you can set up with zero code. :zap::crab:

binserve ⚡ 🦀 A blazingly fast static web server with routing, templating, and security in a single binary you can set up with zero code. 🔥 UPDATE: N

Host These Things Please - a basic http server for hosting a folder fast and simply

http Host These Things Please - a basic HTTP server for hosting a folder fast and simply Selected features See the manpage for full list. Symlinks fol

Simple and fast web server

see Overview Simple and fast web server as a single executable with no extra dependencies required. Features Built with Tokio and Hyper TLS encryption

Owner
Lucas Aries
Lucas Aries
A demo blog post engine in Rust, using Rocket and MongoDB

A demo blog post engine written in Rust, using Rocket and MongoDB Quick Start Setup a new MongoDB cluster https://cloud.mongodb.com/ create a new data

Nabil Hachicha 5 Oct 19, 2022
Dynamic routing system for Rocket

rocket_router Dynamic routing system for Rocket Caveats Each file should export only one route, named the same as the file itself. After adding a new

David Arsene 1 Oct 27, 2021
Create, share, fetch and model Atomic Data! This project consists of a graph database + server, a CLI and a rust library.

Create, share, fetch and model Atomic Data! This repo consists of three components: A library, a server and a CLI. atomic-server Status: Beta. Breakin

Joep Meindertsma 195 Dec 28, 2022
Live Server - Launch a local network server with live reload feature for static pages

Live Server - Launch a local network server with live reload feature for static pages

Lomirus 18 Nov 30, 2022
Static Web Server - a very small and fast production-ready web server suitable to serve static web files or assets

Static Web Server (or SWS abbreviated) is a very small and fast production-ready web server suitable to serve static web files or assets.

Jose Quintana 496 Jan 2, 2023
A framework that allows anyone to create an Urbit Chatbot with only a few lines of code.

Urbit Chatbot Framework A framework that allows anyone to create an Urbit Chatbot with only a few lines of code. The Urbit Chatbot Framework takes car

Robert Kornacki 24 Oct 15, 2022
Simple http server in Rust (Windows/Mac/Linux)

How it looks like? Screenshot Command Line Arguments Simple HTTP(s) Server 0.6.1 USAGE: simple-http-server [FLAGS] [OPTIONS] [--] [root] FLAGS:

LinFeng Qian 788 Dec 28, 2022
GraphQL server library for Rust

GraphQL server library for Rust GraphQL is a data query language developed by Facebook intended to serve mobile and web application frontends. Juniper

GraphQL Rust 4.9k Jan 5, 2023
Low level HTTP server library in Rust

tiny-http Documentation Tiny but strong HTTP server in Rust. Its main objectives are to be 100% compliant with the HTTP standard and to provide an eas

null 785 Dec 29, 2022
Akasio is a simple HTTP server that redirects traffic based on a JSON redirect table. This is its Rust implementation.

This page is inaccurate and is pending updates. Akasio (Rust) Description Akasio is a simple HTTP server that redirects traffic based on a JSON redire

K4YT3X 5 May 2, 2022