cleanup, added some boilerplate readmes for backend projects
This commit is contained in:
parent
d126fed2bd
commit
075c73bb3a
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,3 +1,4 @@
|
||||
debug.log
|
||||
.vscode/
|
||||
.idea/
|
||||
dump.rdb
|
||||
|
@ -1,3 +1,10 @@
|
||||
# Backend
|
||||
|
||||
TODO
|
||||
## What is this?
|
||||
|
||||
This is just an orginizational way of keeping the backend services together (so I don't lose my mind).
|
||||
|
||||
## Projects
|
||||
|
||||
- [`public`](./public/README.md) - a RESTful API service
|
||||
- [`task`](./task/README.md) - a task scheduler service
|
||||
|
20
backend/public/README.md
Normal file
20
backend/public/README.md
Normal file
@ -0,0 +1,20 @@
|
||||
# Backend API
|
||||
|
||||
also known as `public`
|
||||
|
||||
## What is this?
|
||||
|
||||
This is a RESTful API service. Most of the data retrival, requesting, and processing happens here.
|
||||
|
||||
## Things you should know
|
||||
|
||||
### Environment variables
|
||||
|
||||
`public` uses a `.env` file at the root of the project. The file takes standard environment variables (like enviroment variables you would put into a `.bashrc` or ad-hoc into your shell).
|
||||
|
||||
For `public` to work properly, please make sure to first create the `.env` file, then fill out the following environment variables:
|
||||
|
||||
- `RUST_ENV` - needed for letting the service that we are working in either `development` or `production`
|
||||
- `DATABASE_URL` - needed for connecting to Postgres
|
||||
- `REDIS_URL` - needed for connecting to the cache (Redis or Valkey)
|
||||
- `BASE_URI_WEB` - needed for connecting to the frontend user interface of the system to this service
|
@ -1,4 +1,5 @@
|
||||
use std::collections::HashMap;
|
||||
use std::fmt;
|
||||
|
||||
use crate::utils::rss;
|
||||
use crate::{datasources::posts::PostsDatasource, state::AppState};
|
||||
@ -13,7 +14,6 @@ use axum::{
|
||||
use chrono::Utc;
|
||||
use fred::types::Expiration;
|
||||
use serde::{Deserialize, Deserializer, Serialize, Serializer};
|
||||
use std::fmt;
|
||||
|
||||
#[derive(sqlx::FromRow, Deserialize, Serialize, Debug, Clone)]
|
||||
pub struct Post {
|
||||
|
@ -1,6 +1,5 @@
|
||||
use fred::interfaces::KeysInterface;
|
||||
use fred::{clients::Pool, prelude::*};
|
||||
use serde_json::Value;
|
||||
use sqlx::PgPool;
|
||||
|
||||
pub type AppState = std::sync::Arc<tokio::sync::Mutex<AppInternalState>>;
|
||||
|
7
backend/task/README.md
Normal file
7
backend/task/README.md
Normal file
@ -0,0 +1,7 @@
|
||||
# Task scheduler
|
||||
|
||||
also known as `task`
|
||||
|
||||
## What is this?
|
||||
|
||||
I don't know yet - hopefully this will be filled out soon.
|
@ -1,6 +1,11 @@
|
||||
# Database
|
||||
|
||||
You can set environment variables either through the command line, the Nix flake (if you are running nix/NixOS), _or_ the `.env` file
|
||||
You can set environment variables either through the command line, the Nix flake (if you are running nix/NixOS), _or_ the `.env` file.
|
||||
|
||||
Uses the following data storing services:
|
||||
|
||||
- PostgreSQL 16
|
||||
- Valkey 8.0.2 (or Redis, haven't tested)
|
||||
|
||||
## Create migration database
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user