r/GhanaSoftwareEngineer • u/kaishibou • 2d ago
Looking for engineers interested in collaborating on an upcoming SaaS project (Web, Mobile, Backend, DevOps, AI/ML)
r/GhanaSoftwareEngineer • u/kaishibou • 2d ago
r/GhanaSoftwareEngineer • u/kaishibou • 11d ago
Use Nodejs runtime, Typescript, ExpressJs, Typeorm, PostgreSQL, Beekeeper and Bruno to create an api from scratch. Create a Task and Todo Manager.
Initialize nodejs project environment
npm init -y
Install and configure Typescript
npm install -D typescript @types/node tsx
Initialize typescript configuration
npx tsc --init
types: string, boolean, number, any
variables
const username = "doeman";
let isActive = false;
let age = 25;
const numberOfPoints = [2, 3, 4, 5];
const profile = {
name: "John Doe",
isEngineer: true,
};
let profileColor: "red" | "green" | "blue" = "blue";conditions
let color: "red" | "green" | "blue" = "blue";
if (color === "red") {
console.log("This is red");
} else if (color === "green") {
console.log("This is green");
} else {
// this means the default (color
console.log("This is green");
}
switch (color) {
case "red": {
console.log("This is red");
break;
}
case "green": {
console.log("This is green");
break;
}
case "blue": {
console.log("This is blue");
break;
}
default: {
// this means that color is not found
console.log("It seems we don't know what this color is");
break;
}
}operations: +,-, /, *, <, >, <=, >=, === ==, !=
interfaces and type aliasing We use interface to define payloads, type request and response bodies. We call these DTO - Data Transfer Object
interface UserInput {
firstName: string;
lastName: string;
age: number;
address?: {
addressLineOne: string;
addressLineTwo?: string;
countryCode?: string;
};
}
type Colors = "red" | "green" | "blue";loops and condition
for (const i in [1, 2, 3]) {
console.log(`do something with element at index i, ${arr[i]}`);
}
for (const i of [1, 2, 3]) {
console.log(`${i} is an item in arr`);
}
// square and filter out the even numbers
[1, 2, 3].map((i) => i * i).filter((i) => i % 2 === 0);functions and promises (async and await)
function name(params) {}
// call function
name(1, 2);
function addTwoNumbers(a: number, b: number) {
return a + b;
}
console.log(`The sum of 1 and 2 is ${addTwoNumbers(1, 2)}`);
async function addThreeNumbers(a: number, b: number, c: number) {
// usually we will put await
return a + b + c;
}classes
class MyClass {
properties;
methods;
private name: string;
constructor(name: string) {
this.name = string;
}
constructor(public readonly name: string) {}
doubleName(): string {
const fullname = this.name + " " + this.name;
console.log(fullname);
return fullname;
}
}all properties and methods are by default public
public: accessible anywhere
private: not accessible outside of the class
protected: it is private but accessible to sub-classes
readonly: prevents the fields from reassignment after initialized
Install express for the http server.
npm install express
npm install -D @types/expressIn src/index.ts, we bootstrap an express application and add a health-check endpoint
import express, { Request, Response, NextFunction } from "express";
const app = express();
app.use(express.json());
app.get("/health", (req: Request, res: Response, next: NextFunction) => {
try {
res.status(200).json({ status: "ok", timestamp: new Date() });
} catch (error) {
return next(error);
}
});Import express and types needed: import express, { Request, Response, NextFunction } from "express";
Create an express app, const app = express();
Add a builtin middleware to parse json-payload to JSON: app.use(express.json());
Create a GET request, app.get(...)
With an endpoint. app.get("/health",...)
After this we have a request handler that return a JSON object with properties, status and timestamp
req is how data (input) is passed into the controller (request handler)
res is how data is passed back (returned) to the client
next passes control to the next request handler.
When next() is empty, it means everything is fine, move to the middleware (request-handler)
When next(error) is not empty, it means there was an error and as such control needs to be passed to the error handling middleware
{
"compilerOptions": {
"lib": ["ES2016"],
"module": "commonjs",
"target": "es2016",
"rootDir": "./src",
"outDir": "./dist",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"sourceMap": true,
"strictPropertyInitialization": false,
"typeRoots": ["./node_modules/@types"],
"types": ["node"]
}
}{
...,
"scripts": {
"build": "npx tsc",
"clean": "rm -rf dist",
"start": "npm run build && node ./dist/index.js"
},
}We can now run the command npm run start
Lets add a static port and run this app on port 3000.
app.listen(3000, () => {
console.log("app is running on port 3000");
});Say we have req: Request, we can get the user input passed via
body as req.body. If there is a specific field we are interested in, we can access it directly as req.body.field
headers as req.headers
query strings as req.query
params as req.params
When returning a response, we can update the status code and return a JSON object by res.status(STATUS_CODE).json({ ...})
A controller is a request handler. Requests and responses are handled in the controller. From above, this is a controller.
(req: Request, res: Response, next: NextFunction) => {
try {
res.status(200).json({ status: "ok", timestamp: new Date() });
} catch (error) {
return next(error);
}
};A controller is a function (usually async). In this case we have to create a function for this controller.
Directly we can do:
const healthController = (req: Request, res: Response, next: NextFunction) => {
try {
res.status(200).json({ status: "ok", timestamp: new Date() });
} catch (error) {
return next(error);
}
};I prefer creating or using the function keyword stylistically.
function healthController(req: Request, res: Response, next: NextFunction) {
try {
res.status(200).json({ status: "ok", timestamp: new Date() });
} catch (error) {
return next(error);
}
}The difference between the two functions looks like
const funcName = (params) => {
// actions
};and
function funcName(params) {
// actions
}Now the health route will look like
function healthController(req: Request, res: Response, next: NextFunction) {
try {
res.status(200).json({ status: "ok", timestamp: new Date() });
} catch (error) {
return next(error);
}
}
app.get("/health", healthController);NB: usually controllers are
async
Another way to create a route is to use the Router function from express. This way we can have a router for each feature of our app and then mount it in the main app (index.ts).
// feature-name/index.ts
// or feature-name/router.ts
import { Router } from "express";
const router = Router();
// here you can add middlewares and routes and mount controllers
export default router;I usually prefer the /index.ts approach.
We can now import this grouped router in the main app.
// other imports
import tasksRouter from "./tasks";then we mount the new router under the app.get("/health", healthController);
app.use("/tasks", tasksRouter);The rest of the module can be found at https://dev.to/otumianempire/the-complete-beginners-guide-to-backend-development-with-nodejs-typescript-postgresql-5a37
r/GhanaSoftwareEngineer • u/Nebula1424 • Oct 16 '26
Hi All,
I’m a fellow Ghanaian, just joined the sub, wanted to see what tech stack everyone’s working with.
I’m a Python/C/C++ guy, what about you, what tech do you use?
r/GhanaSoftwareEngineer • u/stunna_is_active • Oct 14 '26
Hey everyone! Yomou is a free, open-source Android/iOS (sideloadable) manga reader built with native source integration rather than manual extension setups. We've dropped two releases recently (v1.1.5 & v1.1.6)—here is what’s new:
Full Kotatsu Backup Compatibility (v1.1.5)
Two-way .bk.zip sync: Full import/export support for Kotatsu backups. Your favorites, reading history, and bookmarks transfer across cleanly.
Background Notifications: Backup and import tasks run in the background with live progress scanning for missing titles and a system notification when complete.
Source Engine & Detail Screen Overhaul (v1.1.6)
Persistent Source Sorting: Organize sources by 5 modes (Name, Popular, Manual, Last Used, Popular & Reliable) with drag-to-reorder support that persists across restarts.
True Server-Side Search: Source search now queries the source directly with debounced requests and real pagination instead of just filtering loaded titles on screen.
Kotatsu-Redo UI Redesign: Rebuilt manga detail view with draggable trays, unified quick-apply settings pickers, tap-outside sheet dismissal, and polished Material 3 accent themes.
Source Fixes & Cleanup: Fixed search pagination for Arenascan, MangaKatana, Asura Scans, and Flame Scans. Removed broken/unreliable sources (ComicK, Komga, Toonily).
Download & Source Code:
r/GhanaSoftwareEngineer • u/stunna_is_active • Sep 26 '26
r/GhanaSoftwareEngineer • u/kaishibou • Jul 31 '26
This is a material from Eric that I think you'd find useful in learning clojure
Check out this platform at https://ericnormand.me/
r/GhanaSoftwareEngineer • u/kaishibou • Jul 28 '26
Racket uses prefix notation enclosed in execution parentheses (operator arg1 arg2). The open parenthesis ( acts as an execution trigger. Evaluation runs from the innermost to the outermost parentheses.
;; Basic Arithmetic
(+ 10 5 2) ;; Returns 17
(* 10 5 2) ;; Returns 100
;; Nested Expressions (No PEMDAS needed)
(_ (+ 4 6) (- 12 7)) ;; Evaluates 10 _ 5 -> Returns 50Only use a parenthesis when invoking a command, operator, or function.
(+ 5 (10)) CRASHES (tries to run the number 10 as a function).
((+ 5 5)) CRASHES (evaluates to 10, then tries to run the number 10).
Global bindings are created using define. Values are immutable and cannot be changed over time.
Numbers: Integers (45), decimals (3.14), or fractions (1/3).
Strings: Text wrapped in double quotes ("Hello").
Booleans: True (#t) and False (#f).
Symbols: Lightweight, immutable identifier tokens prefixed with a single quote ('success).
(define radius 5)
(define pi 3.14)
(define status 'success)Conditional operations are expressions that evaluate down to a single return value.
and / or / not: Standard logical short-circuiting prefix operators.
if: Takes exactly three arguments: (if condition true-branch false-branch). No else keyword.
cond: Evaluates multiple branches sequentially. Uses/can use [...] for human readability.
(and (> 15 10) (< 15 20)) ;; Returns #t
(if (> temperature 30) 'hot 'cold)
(cond
[(>= score 90) 'A]
[(>= score 80) 'B]
[else 'F])Functions automatically return the value of their body expression without an explicit return keyword.
Named Functions: Defined by grouping the name and parameters in parentheses: (define (name args) body).
Anonymous Functions (lambda): Throwaway functions built on the fly: (lambda (args) body).
let (Parallel): Creates local variables simultaneously. Variables cannot see each other during setup.
let\* (Sequential): Creates local variables one after the other. Later variables can reference earlier ones.
;; Named Function
(define (double n) (\* n 2))
;; Inline Lambda Execution
((lambda (n) (\* n 2)) 10) ;; Returns 20
;; Sequential Local Bindings
(let* ([x 10]
[y (* x 5)])
(+ x y)) ;; Returns 60Lists are ordered sequential collections. They are processed using either historical Lisp conventions or modern aliases.
list: Evaluates arguments into a sequential list.
'(): Represents the literal base empty list.
cons: Prepends a single element onto the front of an existing list.
First Item: Extracted via car (traditional) or first (modern).
Remaining List: Extracted via cdr (traditional) or rest (modern).
(define my-list (list 100 #t 'hello)) ;; Creates '(100 #t hello)
(cons 'apples '(bananas cherries)) ;; Returns '(apples bananas cherries)
(car (cdr '(apples bananas cherries))) ;; Returns 'bananas
(first (rest '(apples bananas cherries))) ;; Returns 'bananas
(if (empty? my-list) "Closed" (length my-list)) ;; Returns 3Instead of using loops that alter data in place, functional programming relies on Higher-Order Functions to process immutable collections.
map: Loops over a list, passes each item through a transformation function, and returns a new list.
filter: Loops over a list, keeps items that evaluate to #t against a predicate condition, and drops the rest.
foldl (Fold-Left): Reduces a list down to a single value by processing elements from left to right (front to back).
foldr (Fold-Right): Reduces a list down to a single value by processing elements from right to left (back to front). Preserves list structures when rebuilding with cons.
(map (lambda (x) (* x 2)) '(5 10 15 20)) ;; Returns '(10 20 30 40)
(filter (lambda (n) (= n 5)) '(2 5 7 5 9 1)) ;; Returns '(5 5)
(foldl
(lambda (n total) (_ n total))
1
'(2 3 4)) ;; 4 _ (3 _ (2 _ 1)) -> Returns 24
(foldr
-
0
'(5 3)) ;; 5 - (3 - 0) -> Returns 2Recursion replaces traditional loops. A proper recursive function requires a Base Case (the exit clause) and a Recursive Step (the self-call with a smaller argument).
Standard Recursion: Traps the recursive call inside another function (like + or append), forcing the call stack memory to expand linearly (O(N) space).
Tail Call Optimization (TCO): If the recursive call sits in the tail position (the absolute final expression evaluated), Racket reuses the same memory frame, running in constant (O(1)) space.
Accumulator Pattern: Passing a running total down as an argument is the primary strategy used to shift standard recursion into tail position optimization.
;; ❌ Standard Recursion (No TCO - Memory Expands)
(define (sum-list lst)
(if (empty? lst)
0
(+ (first lst) (sum-list (rest lst)))))
;; Tail Recursion (TCO Active - Memory Stays Flat)
(define (sum-list-tco lst)
(define (helper remaining accumulator)
(if (empty? remaining)
accumulator
(helper
(rest remaining)
(+ (first remaining) accumulator))))
(helper lst 0))#hash: Stores key-value pairings. Keywords passed to lookup tools like hash-ref must be quoted ('#:key) to prevent compiler namespace collisions. If using standard symbols inside #hash, omit inner quotes.
set: Collections guaranteeing element uniqueness. Tested via set-member? and extended via set-add.
(define user #hash((#:name . "Alice")))
(hash-ref user '#:name) ;; Returns "Alice"
(define book #hash((title . "Dune")))
(hash-ref book 'title) ;; Returns "Dune"
(set-member? (set 1 2 2 3) 2) ;; Returns #tbox: Creates a reference wrapper around mutable data. Read via unbox and mutated via set-box!. Functions with an exclamation mark ! signal structural mutation.
begin: Chains sequential side-effect operations from top to bottom, returning only the evaluation of the final expression.
(define health (box 100))
(define (take-damage!)
(begin
(set-box! health (- (unbox health) 10))
(unbox health)))Predicates (?): Validate runtime types (e.g., string?, number?, symbol?).
Casting (->): Converts data formats. string->number safely returns #f if given invalid textual input.
(if (string? "50")
(* (string->number "50")
2) 'error) ;; Returns 100provide: Declares which parts of a filesystem file are exported publicly.
require: Ingests public features from an external sandbox by loading its relative string filepath.
;; Inside file-a.rkt
(provide double)
(define (double x) (* x 2))
;; Inside main.rkt
(require "file-a.rkt")
(double 10) ;; Returns 20Macros process raw, unevaluated source code at compile-time to inject new keywords.
Racket macros are hygienic, meaning the compiler automatically isolates macro identifiers so they never accidentally overwrite or conflict with user variables.
(define-syntax-rule (swap! box1 box2)
(let ([temp (unbox box1)])
(begin
(set-box! box1 (unbox box2))
(set-box! box2 temp))))r/GhanaSoftwareEngineer • u/kaishibou • May 06 '26
r/GhanaSoftwareEngineer • u/kaishibou • Apr 20 '26
r/GhanaSoftwareEngineer • u/kaishibou • Apr 18 '26
r/GhanaSoftwareEngineer • u/kaishibou • Apr 15 '26
r/GhanaSoftwareEngineer • u/kaishibou • Apr 15 '26
r/GhanaSoftwareEngineer • u/kaishibou • Apr 15 '26
r/GhanaSoftwareEngineer • u/kaishibou • Apr 14 '26
r/GhanaSoftwareEngineer • u/kaishibou • Apr 11 '26
r/GhanaSoftwareEngineer • u/kaishibou • Apr 11 '26
r/GhanaSoftwareEngineer • u/kaishibou • Apr 11 '26
r/GhanaSoftwareEngineer • u/kaishibou • Apr 09 '26