Compare commits

..

15 Commits

Author SHA1 Message Date
Paul Kuruvilla
76d1a261bd Merge pull request #1639 from byo-books/byo-202512
Add Code a database in 45 steps
2025-12-27 01:10:39 +05:30
root
f4cf332e3f Update the subtitle of Build Your Own Database from Scratch. 2025-12-25 16:32:21 +08:00
root
9e8b06f62f Add Code a database in 45 steps. 2025-12-25 16:29:16 +08:00
Paul Kuruvilla
1a851d83f7 Merge pull request #1435 from korrectional/master
Removed "Java: Java Voxel Engine Tutorial [video]" as it is not available anymore
2025-10-10 11:45:01 -07:00
Paul Kuruvilla
51198a9f9c Update README.md
Fixes https://github.com/codecrafters-io/build-your-own-x/issues/1552
2025-09-03 13:36:37 -07:00
Paul Kuruvilla
6b32f34ec2 Merge pull request #1548 from CodeCrateDev/master
Removed missing video link
2025-08-28 17:08:20 -07:00
CodeCrate
427e67f58f Reverted link removal
Reverted the removal of the Java 3D Game Development with LWJGL 3 link.
2025-08-28 12:14:55 -04:00
CodeCrate
0bbb011cf0 Removed links that no longer function
Removed links:
- Java Voxel Engine Tutorial
- 3D Game Development with LWJGL 3
2025-08-28 11:52:36 -04:00
Paul Kuruvilla
9d625daa96 Merge pull request #1520 from codecrafters-io/rohitpaulk-patch-1
Update README.md
2025-07-29 14:02:37 -07:00
Paul Kuruvilla
f4275438a7 Update README.md
Fixes https://github.com/codecrafters-io/build-your-own-x/issues/1519
2025-07-29 14:02:22 -07:00
Vencyr Laurence Imbo Amores
a8bc6fbcf1 update to byox banner 2025-07-07 22:14:17 +08:00
Vencyr Laurence Imbo Amores
c56186ac2d update byox banner 2025-07-07 17:05:02 +08:00
korrectional
4073730ccf Removed Java: Java Voxel Engine Tutorial [video] as it is not available anymore 2025-05-17 15:19:23 -04:00
Paul Kuruvilla
cf5d750133 Merge pull request #1414 from maysara-elshewehy/master 2025-04-11 12:13:28 -07:00
Maysara
d6ce7605f0 Add a new tutorial link for zig. 2025-04-11 20:00:24 +02:00
3 changed files with 5 additions and 205 deletions

View File

@@ -37,4 +37,3 @@ Thanks for your contribution! If you're submitting a tutorial, please ensure it
* [ ] Web Search Engine * [ ] Web Search Engine
* [ ] Web Server * [ ] Web Server
* [ ] Uncategorized * [ ] Uncategorized
* [ ] Fitness App

View File

@@ -1,4 +1,4 @@
[![Banner](https://codecrafters.io/images/byox-banner.gif)](https://codecrafters.io/github-banner) [![Banner](https://codecrafters.io/images/updated-byox-banner.gif)](https://codecrafters.io/github-banner)
## Build your own <insert-technology-here> ## Build your own <insert-technology-here>
@@ -35,7 +35,6 @@ It's a great way to learn.
* [Web Browser](#build-your-own-web-browser) * [Web Browser](#build-your-own-web-browser)
* [Web Server](#build-your-own-web-server) * [Web Server](#build-your-own-web-server)
* [Uncategorized](#uncategorized) * [Uncategorized](#uncategorized)
* [Fitness App](#build-your-own-fitness-app)
## Tutorials ## Tutorials
@@ -124,6 +123,7 @@ It's a great way to learn.
* [**Node.js**: _Create a CLI tool in Javascript_](https://citw.dev/tutorial/create-your-own-cli-tool) * [**Node.js**: _Create a CLI tool in Javascript_](https://citw.dev/tutorial/create-your-own-cli-tool)
* [**Rust**: _Command line apps in Rust_](https://rust-cli.github.io/book/index.html) * [**Rust**: _Command line apps in Rust_](https://rust-cli.github.io/book/index.html)
* [**Rust**: _Writing a Command Line Tool in Rust_](https://mattgathu.dev/2017/08/29/writing-cli-app-rust.html) * [**Rust**: _Writing a Command Line Tool in Rust_](https://mattgathu.dev/2017/08/29/writing-cli-app-rust.html)
* [**Zig**: _Build Your Own CLI App in Zig from Scratch_](https://rebuild-x.github.io/docs/#/./zig/terminal/cli)
#### Build your own `Database` #### Build your own `Database`
@@ -133,7 +133,8 @@ It's a great way to learn.
* [**C#**: _Build Your Own Database_](https://www.codeproject.com/Articles/1029838/Build-Your-Own-Database) * [**C#**: _Build Your Own Database_](https://www.codeproject.com/Articles/1029838/Build-Your-Own-Database)
* [**Clojure**: _An Archaeology-Inspired Database_](http://aosabook.org/en/500L/an-archaeology-inspired-database.html) * [**Clojure**: _An Archaeology-Inspired Database_](http://aosabook.org/en/500L/an-archaeology-inspired-database.html)
* [**Crystal**: _Why you should build your own NoSQL Database_](https://medium.com/@marceloboeira/why-you-should-build-your-own-nosql-database-9bbba42039f5) * [**Crystal**: _Why you should build your own NoSQL Database_](https://medium.com/@marceloboeira/why-you-should-build-your-own-nosql-database-9bbba42039f5)
* [**Go**: _Build Your Own Database from Scratch: Persistence, Indexing, Concurrency_](https://build-your-own.org/database/) * [**Go**: _Build Your Own Database from Scratch: From B+Tree To SQL in 3000 Lines_](https://build-your-own.org/database/)
* [**Go**: _Code a database in 45 steps: a series of test-driven small coding puzzles_](https://trialofcode.org/database/)
* [**Go**: _Build Your Own Redis from Scratch_](https://www.build-redis-from-scratch.dev/) * [**Go**: _Build Your Own Redis from Scratch_](https://www.build-redis-from-scratch.dev/)
* [**JavaScript**: _Dagoba: an in-memory graph database_](http://aosabook.org/en/500L/dagoba-an-in-memory-graph-database.html) * [**JavaScript**: _Dagoba: an in-memory graph database_](http://aosabook.org/en/500L/dagoba-an-in-memory-graph-database.html)
* [**Python**: _DBDB: Dog Bed Database_](http://aosabook.org/en/500L/dbdb-dog-bed-database.html) * [**Python**: _DBDB: Dog Bed Database_](http://aosabook.org/en/500L/dbdb-dog-bed-database.html)
@@ -327,7 +328,6 @@ It's a great way to learn.
* [**Racket**: _Beautiful Racket: How to make your own programming languages with Racket_](https://beautifulracket.com/) * [**Racket**: _Beautiful Racket: How to make your own programming languages with Racket_](https://beautifulracket.com/)
* [**Ruby**: _A Compiler From Scratch_](https://www.destroyallsoftware.com/screencasts/catalog/a-compiler-from-scratch) * [**Ruby**: _A Compiler From Scratch_](https://www.destroyallsoftware.com/screencasts/catalog/a-compiler-from-scratch)
* [**Ruby**: _Markdown compiler from scratch in Ruby_](https://blog.beezwax.net/2017/07/07/writing-a-markdown-compiler/) * [**Ruby**: _Markdown compiler from scratch in Ruby_](https://blog.beezwax.net/2017/07/07/writing-a-markdown-compiler/)
* [**Rust**: _So You Want to Build a Language VM_](https://blog.subnetzero.io/post/building-language-vm-part-00/)
* [**Rust**: _Learning Parser Combinators With Rust_](https://bodil.lol/parser-combinators/) * [**Rust**: _Learning Parser Combinators With Rust_](https://bodil.lol/parser-combinators/)
* [**Swift**: _Building a LISP from scratch with Swift_](https://www.uraimo.com/2017/02/05/building-a-lisp-from-scratch-with-swift/) * [**Swift**: _Building a LISP from scratch with Swift_](https://www.uraimo.com/2017/02/05/building-a-lisp-from-scratch-with-swift/)
* [**TypeScript**: _Build your own WebAssembly Compiler_](https://blog.scottlogic.com/2019/05/17/webassembly-compiler.html) * [**TypeScript**: _Build your own WebAssembly Compiler_](https://blog.scottlogic.com/2019/05/17/webassembly-compiler.html)
@@ -388,7 +388,6 @@ It's a great way to learn.
#### Build your own `Voxel Engine` #### Build your own `Voxel Engine`
* [**C++**: _Let's Make a Voxel Engine_](https://sites.google.com/site/letsmakeavoxelengine/home) * [**C++**: _Let's Make a Voxel Engine_](https://sites.google.com/site/letsmakeavoxelengine/home)
* [**Java**: _Java Voxel Engine Tutorial_](https://www.youtube.com/watch?v=QZ4Vk2PkPZk&list=PL80Zqpd23vJfyWQi-8FKDbeO_ZQamLKJL) [video]
#### Build your own `Web Browser` #### Build your own `Web Browser`
@@ -409,13 +408,10 @@ It's a great way to learn.
* [**Python**: _Implementing a RESTful Web API with Python & Flask_](http://blog.luisrei.com/articles/flaskrest.html) * [**Python**: _Implementing a RESTful Web API with Python & Flask_](http://blog.luisrei.com/articles/flaskrest.html)
* [**Ruby**: _Building a simple websockets server from scratch in Ruby_](http://blog.honeybadger.io/building-a-simple-websockets-server-from-scratch-in-ruby/) * [**Ruby**: _Building a simple websockets server from scratch in Ruby_](http://blog.honeybadger.io/building-a-simple-websockets-server-from-scratch-in-ruby/)
#### Build your own `Fitness App`
* [**JavaScript**: _Build a simple fitness app similar to Fitbud_](tutorials/fitness-app.md)
#### Uncategorized #### Uncategorized
* [**(any)**: _From NAND to Tetris: Building a Modern Computer From First Principles_](http://nand2tetris.org/) * [**(any)**: _From NAND to Tetris: Building a Modern Computer From First Principles_](http://nand2tetris.org/)
* [**(any)**: build-your-own-x-vibe-coding: BYOX-style tutorials adapted for vibe coding](https://github.com/inFaaa/build-your-own-x-vibe-coding)
* [**Alloy**: _The Same-Origin Policy_](http://aosabook.org/en/500L/the-same-origin-policy.html) * [**Alloy**: _The Same-Origin Policy_](http://aosabook.org/en/500L/the-same-origin-policy.html)
* [**C**: _How to Write a Video Player in Less Than 1000 Lines_](http://dranger.com/ffmpeg/ffmpeg.html) * [**C**: _How to Write a Video Player in Less Than 1000 Lines_](http://dranger.com/ffmpeg/ffmpeg.html)
* [**C**: _Learn how to write a hash table in C_](https://github.com/jamesroutley/write-a-hash-table) * [**C**: _Learn how to write a hash table in C_](https://github.com/jamesroutley/write-a-hash-table)

View File

@@ -1,195 +0,0 @@
# Build a Simple Fitness App
In this tutorial, we will build a simple fitness app similar to Fitbud. The app will allow users to track their workouts, set goals, and monitor their progress. We will use JavaScript and a few other technologies to create this app.
## Step 1: Setting Up the Project
First, let's set up our project. Create a new directory for your project and initialize a new Node.js project:
```bash
mkdir fitness-app
cd fitness-app
npm init -y
```
Next, install the necessary dependencies:
```bash
npm install express body-parser mongoose
```
## Step 2: Creating the Server
We will use Express to create our server. Create a new file called `server.js` and add the following code:
```javascript
const express = require('express');
const bodyParser = require('body-parser');
const mongoose = require('mongoose');
const app = express();
const port = 3000;
app.use(bodyParser.json());
mongoose.connect('mongodb://localhost/fitness-app', { useNewUrlParser: true, useUnifiedTopology: true });
app.listen(port, () => {
console.log(`Server is running on port ${port}`);
});
```
## Step 3: Creating the User Model
We will use Mongoose to create our user model. Create a new file called `models/User.js` and add the following code:
```javascript
const mongoose = require('mongoose');
const userSchema = new mongoose.Schema({
username: { type: String, required: true, unique: true },
password: { type: String, required: true },
workouts: [{ type: mongoose.Schema.Types.ObjectId, ref: 'Workout' }]
});
const User = mongoose.model('User', userSchema);
module.exports = User;
```
## Step 4: Creating the Workout Model
Next, create a new file called `models/Workout.js` and add the following code:
```javascript
const mongoose = require('mongoose');
const workoutSchema = new mongoose.Schema({
user: { type: mongoose.Schema.Types.ObjectId, ref: 'User', required: true },
date: { type: Date, required: true },
exercises: [{
name: { type: String, required: true },
sets: { type: Number, required: true },
reps: { type: Number, required: true },
weight: { type: Number, required: true }
}]
});
const Workout = mongoose.model('Workout', workoutSchema);
module.exports = Workout;
```
## Step 5: Creating the User Routes
Create a new file called `routes/user.js` and add the following code:
```javascript
const express = require('express');
const router = express.Router();
const User = require('../models/User');
router.post('/register', async (req, res) => {
try {
const user = new User(req.body);
await user.save();
res.status(201).send(user);
} catch (error) {
res.status(400).send(error);
}
});
router.post('/login', async (req, res) => {
try {
const user = await User.findOne({ username: req.body.username, password: req.body.password });
if (!user) {
return res.status(401).send({ error: 'Invalid credentials' });
}
res.send(user);
} catch (error) {
res.status(400).send(error);
}
});
module.exports = router;
```
## Step 6: Creating the Workout Routes
Create a new file called `routes/workout.js` and add the following code:
```javascript
const express = require('express');
const router = express.Router();
const Workout = require('../models/Workout');
router.post('/', async (req, res) => {
try {
const workout = new Workout(req.body);
await workout.save();
res.status(201).send(workout);
} catch (error) {
res.status(400).send(error);
}
});
router.get('/:userId', async (req, res) => {
try {
const workouts = await Workout.find({ user: req.params.userId });
res.send(workouts);
} catch (error) {
res.status(400).send(error);
}
});
module.exports = router;
```
## Step 7: Integrating the Routes
Update the `server.js` file to include the user and workout routes:
```javascript
const express = require('express');
const bodyParser = require('body-parser');
const mongoose = require('mongoose');
const userRoutes = require('./routes/user');
const workoutRoutes = require('./routes/workout');
const app = express();
const port = 3000;
app.use(bodyParser.json());
mongoose.connect('mongodb://localhost/fitness-app', { useNewUrlParser: true, useUnifiedTopology: true });
app.use('/users', userRoutes);
app.use('/workouts', workoutRoutes);
app.listen(port, () => {
console.log(`Server is running on port ${port}`);
});
```
## Step 8: Testing the API
You can use a tool like Postman to test the API. Here are some example requests:
- Register a new user:
- POST http://localhost:3000/users/register
- Body: `{ "username": "testuser", "password": "password123" }`
- Login a user:
- POST http://localhost:3000/users/login
- Body: `{ "username": "testuser", "password": "password123" }`
- Create a new workout:
- POST http://localhost:3000/workouts
- Body: `{ "user": "userId", "date": "2021-01-01", "exercises": [{ "name": "Squat", "sets": 3, "reps": 10, "weight": 100 }] }`
- Get workouts for a user:
- GET http://localhost:3000/workouts/userId
## Conclusion
Congratulations! You have built a simple fitness app similar to Fitbud. You can now extend this app by adding more features such as goal tracking, progress monitoring, and more. Happy coding!