A very random collection of services, packed into a RESTful Rust api. https://fej.roosens.me
 
 
 
 
 
 
Go to file
Jef Roosens 0ba31bd8ba
[#26] Started fejctl
2021-04-15 23:59:31 +02:00
.hooks [closes #6] added documentation everywhere 2021-04-12 21:33:56 +02:00
benches [#13] Further overhaul of the project structure for better testing 2021-04-08 22:39:04 +02:00
docker [#26] Moved main binary to separate location 2021-04-15 19:26:37 +02:00
migrations [#24] Added first ivago migration 2021-04-15 18:05:02 +02:00
src [#26] Moved main binary to separate location 2021-04-15 19:26:37 +02:00
tests [#13] added some more unit tests, hated life for a bit 2021-04-08 22:53:29 +02:00
.dockerignore Added Docker build files 2021-03-05 20:40:49 +01:00
.env [#24] Initialized diesel project 2021-04-15 17:53:35 +02:00
.env.container [#24] Initialized diesel project 2021-04-15 17:53:35 +02:00
.gitignore Added cargo init 2021-03-05 18:39:49 +01:00
Cargo.lock [#24] Initialized diesel project 2021-04-15 17:53:35 +02:00
Cargo.toml [#26] Moved main binary to separate location 2021-04-15 19:26:37 +02:00
LICENSE [closes #20] Switched to AGPLv3 2021-04-13 22:03:27 +02:00
Makefile [#26] Added image cleaning recipe 2021-04-15 19:36:42 +02:00
README.md Added docker images link to README 2021-04-13 23:55:22 +02:00
build [#24] Initialized diesel project 2021-04-15 17:53:35 +02:00
diesel.toml [#24] Initialized diesel project 2021-04-15 17:53:35 +02:00
fejctl [#26] Started fejctl 2021-04-15 23:59:31 +02:00
roadmap.md Added kissanime to roadmap 2021-04-14 00:00:29 +02:00

README.md

Fej

Fej is an API written in Rust. I started this project to learn the language, and really just have some fun.

Project Structure

The folder structure follows the structure of the URLs, e.g. the route for /hello/world is found in the module src/hello.

Each module contains the following base files:

  • mod.rs: defines the modules' content, and contains the route definitions. The route functions themselves only contain the functionality needed to represent the data, not acquire it.
  • controller.rs: this file contains the actual logic of each route. If the logic becomes too complicated to be contained inside a single file, controller.rs becomes its own module folder named controller.
  • tests.rs: this contains tests for the specific module. This can also be a module directory if need be.

Every module has a routes function that returns its route macros.

Roadmap

See roadmap.md.

Development

The entire toolchain runs on Alpine inside Docker. This makes building easier, and (hopefully) eliminates any system-specific bugs.

A Makefile wrapper is provided for ease of use. Do check it out, as all the commands are documented for your understanding ;)

There's also the build script. This script does all the "heavy" lifting. It chooses which Dockerfile to build according to the given arguments, and generates tags for the images (useful when pushing releases). The Makefile is really just a wrapper around this build script, allowing you to write make test instead of ./build -m dev -a run test.

tl;dr run make run to run your build, and make test to run the tests.

Docker images

The images are available here.