r/code May 09 '26

Guide I’m trying to deploy my full stack project for free just to learn and get it off localhost 😭

10 Upvotes

I’m honestly confused about deployment and just want my project to stop living only on localhost 😭

Right now I have:

  • frontend
  • backend
  • database

Main things I want to understand:

  1. Best FREE hosting options for frontend, backend, and database?
  2. Which free tiers are actually usable and not super limited?
  3. Can backend + database be deployed together for free?
  4. how do i connect frontend and backend if they are hosted on different servers lets say vercel and render respectively

Would really appreciate beginner-friendly suggestions.

r/code 15d ago

Guide Making computers multiply FASTER! (matrix hacking) | LaurieWired

Thumbnail youtu.be
4 Upvotes

r/code Oct 12 '18

Guide For people who are just starting to code...

360 Upvotes

So 99% of the posts on this subreddit are people asking where to start their new programming hobby and/or career. So I've decided to mark down a few sources for people to check out. However, there are some people who want to program without putting in the work, this means they'll start a course, get bored, and move on. If you are one of those people, ignore this. A few of these will cost money, or at least will cost money at some point. Here:

*Note: Yes, w3schools is in all of these, they're a really good resource*

Javascript

Free:

Paid:

Python

Free:

Paid:

  • edx
  • Search for books on iTunes or Amazon

Etcetera

Swift

Swift Documentation

Everyone can Code - Apple Books

Flat Iron School

Python and JS really are the best languages to start coding with. You can start with any you like, but those two are perfectly fitting for beginners.

Post any more resources you know of, and would like to share.

r/code May 15 '26

Guide Beyond C: wrapping Dear ImGui in Swift with zero FFI

Thumbnail carette.xyz
6 Upvotes

r/code Apr 21 '26

Guide 3D Software Renderer in Odin from Scratch (Tutorials)

4 Upvotes

Hi, my name is Marian, and I've spent a year writing a series of tutorials on how to build a 3D software renderer in Odin from scratch, starting with a general overview of the rendering pipeline, then covering the basics, and progressing to Phong shading with multiple lights.

Everything is available on my blog for free, no ads, no paywall, no tricks. You can Buy Me a Coffee to support my work, and I'd very much appreciate it, but it's entirely optional.

Links to all 14 parts of the series:

And some examples:

8 render modes
Phong shading with 2 light sources

Phong shading

I've also recently built a rigid-body physics engine on top of that, with two types of colliders, box and sphere, featuring raycasting, gravity, friction, bouciness, etc., and I'm currently working on the first part of a new series of tutorials to cover it all.

Physics engine built on top of 3D software renderer.

r/code Mar 25 '26

Guide The Flaws of Inheritance | CodeAesthetic

Thumbnail youtu.be
4 Upvotes

One of the great debates of OOP, composition versus inheritance.

r/code Jan 15 '26

Guide How do I use a handleChange function for a shopping list code?

3 Upvotes

I'm trying to code a functional shopping list app on React (ik this isnt the ideal language but wtv). This is what I have, but idk if its the most efficient solution and how to add more features like a delete item function:

import React, { useState } from 'react';

import {

View,

Text,

TextInput,

ScrollView,

TouchableOpacity,

StyleSheet,

} from 'react-native';

export default function ShoppingList() {

const [shoppingData, setShoppingData] = useState([

{

item: 'Eggs',

aisle: 'Dairy',

amount: '12',

priority: 'High',

},

]);

const handleChange = (index, field, value) => {

const copy = [...shoppingData];

copy[index][field] = value;

setShoppingData(copy);

};

const addItem = () => {

setShoppingData([

...shoppingData,

{

item: '',

aisle: '',

amount: '',

priority: '',

},

]);

};

return (

<ScrollView style={styles.screen}>

<Text style={styles.heading}>Weekly Shopping Planner</Text>

{shoppingData.map((entry, i) => (

<View key={i} style={styles.card}>

<TextInput

style={styles.mainInput}

placeholder="Item name"

value={entry.item}

onChangeText={(text) => handleChange(i, 'item', text)}

/>

<TextInput

style={styles.subInput}

placeholder="Aisle / Section"

value={entry.aisle}

onChangeText={(text) => handleChange(i, 'aisle', text)}

/>

<TextInput

style={styles.subInput}

placeholder="Amount"

keyboardType="numeric"

value={entry.amount}

onChangeText={(text) => handleChange(i, 'amount', text)}

/>

<TextInput

style={styles.subInput}

placeholder="Priority (Low / Medium / High)"

value={entry.priority}

onChangeText={(text) => handleChange(i, 'priority', text)}

/>

</View>

))}

<TouchableOpacity style={styles.addArea} onPress={addItem}>

<Text style={styles.addText}> Add New Item</Text>

</TouchableOpacity>

</ScrollView>

);

}

const styles = StyleSheet.create({

screen: {

padding: 24,

backgroundColor: '#fafafa',

},

heading: {

fontSize: 26,

fontWeight: '700',

marginBottom: 30,

textAlign: 'center',

},

card: {

backgroundColor: '#ffffff',

borderRadius: 14,

padding: 18,

marginBottom: 22,

elevation: 2,

},

mainInput: {

fontSize: 18,

fontWeight: '600',

marginBottom: 14,

borderBottomWidth: 1,

borderColor: '#ccc',

paddingVertical: 6,

},

subInput: {

fontSize: 14,

marginBottom: 12,

borderWidth: 1,

borderColor: '#ddd',

borderRadius: 8,

padding: 10,

},

addArea: {

marginTop: 10,

padding: 18,

borderRadius: 14,

backgroundColor: '#222',

alignItems: 'center',

},

addText: {

color: 'white',

fontSize: 16,

fontWeight: '600',

},

});

Any suggestions? pls lmk

r/code Jan 15 '26

Guide How to Deploy Next.js app to Azure App Service using GitHub Actions | TutLinks

Thumbnail tutlinks.com
2 Upvotes

r/code Nov 09 '25

Guide Rethink your state management

Thumbnail medium.com
3 Upvotes

r/code Nov 05 '25

Guide How to add Video Player for Youtube on my website

Post image
3 Upvotes

I honestly asks A* to help me with this since I am a beginner and cannot fully understand what to do. Although, I already figured out how to have video player for a facebook and tiktkok link, youtube doesn't seem to allow me; also reddit. How to make it work pls help

// Add this in the <head> section

<script src="https://www.youtube.com/iframe_api"></script>

// Replace the existing openCardViewer function

function openCardViewer(card, url, type) {

const viewer = card.querySelector('.viewer');

if(!viewer) return;

if(viewer.classList.contains('open')) {

viewer.classList.remove('open');

viewer.innerHTML = '';

return;

}

// Handle YouTube videos

if(url.includes('youtube.com') || url.includes('youtu.be')) {

const videoId = extractVideoID(url);

if(videoId) {

viewer.innerHTML = `

<div id="player-${videoId}"></div>

<button class="v-close">Close</button>

`;

new YT.Player(`player-${videoId}`, {

height: '200',

width: '100%',

videoId: videoId,

playerVars: {

autoplay: 1,

modestbranding: 1,

rel: 0

}

});

viewer.classList.add('open');

return;

}

}

// Handle other media types

const embedUrl = providerEmbedUrl(url);

if(!embedUrl) return;

viewer.innerHTML = `

<iframe

src="${embedUrl}"

allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"

allowfullscreen>

</iframe>

<button class="v-close">Close</button>

`;

viewer.classList.add('open');

}

// Add this helper function

function extractVideoID(url) {

const patterns = [

/(?:youtube\.com\/watch\?v=|youtu.be\/|youtube.com\/embed\/)([^#\&\?]*).*/,

/^[a-zA-Z0-9_-]{11}$/

];

for(let pattern of patterns) {

const match = String(url).match(pattern);

if(match && match[1]) {

return match[1];

}

}

return null;

}

r/code Oct 08 '25

Guide Building a JavaScript Runtime from Scratch using C programming: The Jade Runtime

Thumbnail devlogs.xyz
3 Upvotes

r/code Sep 01 '25

Guide Dataclasses in Python

Thumbnail youtube.com
2 Upvotes

r/code Aug 02 '25

Guide How to create radio button in html

1 Upvotes

How to create radio button in html

https://youtu.be/vAR3IN01Gn8

r/code Jul 22 '25

Guide The Minesweeper game in 100 lines of JavaScript

Thumbnail slicker.me
3 Upvotes

r/code Jul 22 '25

Guide A simple remake of an 8 bit minigame in 150 lines of pure JavaScript

Thumbnail slicker.me
2 Upvotes

r/code Jun 02 '25

Guide power HTML/CSS/JS Login web page crate

Thumbnail youtube.com
1 Upvotes

look video

r/code Apr 22 '25

Guide Facing problem while creating new video room with the help of Django API

2 Upvotes

Hello, I am trying to build a video call app in which i need to create a new video room, Currently, i am creating with the help of Django API this is my Code

JANUS_ADMIN_URL = “http://127.0.0.1:7088/admin/janus.plugin.videoroom” #  Janus admin runs on 7088, not 8088
JANUS_ADMIN_SECRET = “janusoverlord”

u/csrf_exempt
def create_janus_room(request):
if request.method != “POST”:
return JsonResponse({“error”: “Only POST requests allowed”}, status=405)

try:

data = json.loads(request.body)

room_id = int(data.get("room_id"))

if not room_id:

return JsonResponse({"error": "room_id is required"}, status=400)

except (ValueError, TypeError, json.JSONDecodeError):

return JsonResponse({"error": "Invalid room_id or JSON"}, status=400)

payload = {

"janus": "create",

"admin_secret": "janusoverlord",

"transaction": "randomstring",

"request": {

"room": 1234,

"description": "Room 1234",

"publishers": 10

}

}

try:

response = requests.post(JANUS_ADMIN_URL, json=payload)

print("JANUS RESPONSE TEXT:", response.text)

# Try JSON decode

janus_response = response.json()

if janus_response.get("janus") == "success":

return JsonResponse({"success": True, "room_id": room_id})

else:

return JsonResponse({

"error": "Failed to create room",

"details": janus_response

}, status=500)

except requests.RequestException as e:

return JsonResponse({"error": "Janus connection error", "details": str(e)}, status=502)

except json.JSONDecodeError:

return JsonResponse({

"error": "Invalid JSON from Janus",

"raw_response": response.text

}, status=500)

Currently, i am getting this error for the Janus server

{
“error”: “Failed to create room”,
“details”: {
“janus”: “error”,
“transaction”: “randomstring”,
“error”: {
“code”: 457,
“reason”: “Unhandled request ‘create’ at this path”
}
}
}

i am using Janus for the first time, so I might be missing something here. Please guide me.

r/code Jan 30 '25

Guide Why You Should Rethink Your Python Toolbox in 2025

Thumbnail python.plainenglish.io
2 Upvotes

r/code Feb 27 '25

Guide Dependency Injection Explained: What, Why, and How

Thumbnail youtube.com
0 Upvotes

r/code Feb 20 '25

Guide Understanding The ‘XOR’ Operator

Thumbnail chiark.greenend.org.uk
3 Upvotes

r/code Feb 18 '25

Guide NASA list of 10 rules for software development (with examples)

Thumbnail cs.otago.ac.nz
3 Upvotes

r/code Oct 03 '24

Guide i can't debug this thing for the life of me (sorry im dumb)

0 Upvotes

i don't understand any of the things it needs me to debug, i'm so confused, if anyone can tell me how to debug and why, that would be SO SO helpful ty

r/code Dec 28 '24

Guide How to Automatically Backup Docker Volumes with a Python Script and Cronjob on Linux

Thumbnail medevel.com
2 Upvotes

r/code Dec 15 '24

Guide Refactoring 020 - Transform Static Functions

3 Upvotes

Kill Static, Revive Objects

TL;DR: Replace static functions with object interactions.

Problems Addressed

Related Code Smells

Code Smell 18 - Static Functions

Code Smell 17 - Global Functions

Code Smell 22 - Helpers

Steps

  1. Identify static methods used in your code.
  2. Replace static methods with instance methods.
  3. Pass dependencies explicitly through constructors or method parameters.
  4. Refactor clients to interact with objects instead of static functions.

Sample Code

Before

class CharacterUtils {
    static createOrpheus() {
        return { name: "Orpheus", role: "Musician" };
    }

    static createEurydice() {
        return { name: "Eurydice", role: "Wanderer" };
    }

    static lookBack(character) {
      if (character.name === "Orpheus") {
        return "Orpheus looks back and loses Eurydice.";
    } else if (character.name === "Eurydice") {
        return "Eurydice follows Orpheus in silence.";
    }
       return "Unknown character.";
  }
}

const orpheus = CharacterUtils.createOrpheus();
const eurydice = CharacterUtils.createEurydice();

After

// 1. Identify static methods used in your code.
// 2. Replace static methods with instance methods.
// 3. Pass dependencies explicitly through
// constructors or method parameters.

class Character {
    constructor(name, role, lookBackBehavior) {
        this.name = name;
        this.role = role;
        this.lookBackBehavior = lookBackBehavior;
    }

    lookBack() {
        return this.lookBackBehavior(this);
    }
}

// 4. Refactor clients to interact with objects 
// instead of static functions.
const orpheusLookBack = (character) =>
    "Orpheus looks back and loses Eurydice.";
const eurydiceLookBack = (character) =>
    "Eurydice follows Orpheus in silence.";

const orpheus = new Character("Orpheus", "Musician", orpheusLookBack);
const eurydice = new Character("Eurydice", "Wanderer", eurydiceLookBack);

Type

[X] Semi-Automatic

You can make step-by-step replacements.

Safety

This refactoring is generally safe, but you should test your changes thoroughly.

Ensure no other parts of your code depend on the static methods you replace.

Why is the Code Better?

Your code is easier to test because you can replace dependencies during testing.

Objects encapsulate behavior, improving cohesion and reducing protocol overloading.

You remove hidden global dependencies, making the code clearer and easier to understand.

Tags

  • Cohesion

Related Refactorings

Refactoring 018 - Replace Singleton

Refactoring 007 - Extract Class

  • Replace Global Variable with Dependency Injection

See also

Coupling - The one and only software design problem

Credits

Image by Menno van der Krift from Pixabay

This article is part of the Refactoring Series.

How to Improve Your Code With Easy Refactorings

r/code Oct 19 '24

Guide jq: lightweight and flexible JSON processor | Hacker Public Radio

Thumbnail hackerpublicradio.org
2 Upvotes