Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
82473ba
updated with tx for better multiquery funcs
DerekCorniello Jan 25, 2025
f5f7a2c
Merge pull request #65 from devbits-go/derek-dev
DerekCorniello Jan 25, 2025
7303962
Bump undici from 6.21.0 to 6.21.1 in /frontend
dependabot[bot] Jan 25, 2025
edb342a
Merge pull request #66 from devbits-go/dependabot/npm_and_yarn/fronte…
DerekCorniello Jan 25, 2025
37196db
Change colors remove posts and add button for comments
elifouts Jan 25, 2025
5b1fb5a
Update README with project status note
DerekCorniello Jan 9, 2026
d021060
Update README to remove archived project note
DerekCorniello Feb 9, 2026
b71f9d9
Integrating backend and frontend for full stack testing. Yea. I ddid …
elifouts Feb 9, 2026
12f30a7
Merge branch 'main' of https://github.com/elifouts/DevBits
elifouts Feb 9, 2026
d6955f5
feat: implement saved streams functionality and improve user profile …
elifouts Feb 10, 2026
e302a92
feat: implement BootScreen component for boot animation
elifouts Feb 10, 2026
6658532
Merge pull request #67 from elifouts/main
elifouts Feb 10, 2026
be7d65d
Deleted old data
elifouts Feb 11, 2026
ba1c357
Merge branch 'main' of https://github.com/elifouts/DevBits
elifouts Feb 11, 2026
fc92942
Added markdown support.
elifouts Feb 11, 2026
646248c
feat: enhance user profile screen with animated scroll and improved f…
elifouts Feb 11, 2026
98b8e2e
fix: adjust action button spacing in SectionHeader component
elifouts Feb 11, 2026
d37af42
feat: update progress view offset in multiple screens and change head…
elifouts Feb 11, 2026
cc0456b
Merge pull request #68 from elifouts
elifouts Feb 11, 2026
d681b7d
feat: update SafeAreaView edges and progress view settings across mul…
elifouts Feb 11, 2026
e309808
feat: enhance MarkdownText component with inline code styling and imp…
elifouts Feb 11, 2026
17f1367
Merge branch 'devbits-go:main' into main
elifouts Feb 11, 2026
4f11073
Merge pull request #69 from elifouts/main
elifouts Feb 11, 2026
1d76864
added description to devbits.md stream.
elifouts Feb 11, 2026
a32bf7d
database update
elifouts Feb 13, 2026
dabc67b
database updates
elifouts Feb 14, 2026
8395b7e
Merge branch 'main' of https://github.com/elifouts/DevBits
elifouts Feb 14, 2026
5083484
feat: add terminal screen for chat functionality
elifouts Feb 14, 2026
f85d22e
Merge pull request #71 from elifouts/main
elifouts Feb 14, 2026
56164c6
Post Demo
elifouts Feb 14, 2026
08724f2
chore: update SQLite database files
elifouts Feb 14, 2026
d71002e
Database Update
elifouts Feb 14, 2026
6792baf
feat: add linux start up commands
grillinr Feb 14, 2026
7fbb6ae
Update run-all.sh
grillinr Feb 14, 2026
6518311
feat: add linux start up commands
grillinr Feb 14, 2026
5ffca14
feat: add FloatingScrollTopButton component for scroll-to-top functio…
elifouts Feb 17, 2026
be97820
Merge branch 'main' of https://github.com/devbits-go/DevBits
elifouts Feb 17, 2026
22ff7e1
feat: enhance user interface and interactions
elifouts Feb 17, 2026
dcdf849
Add tester application HTML, ADB installation script, and logging guide
elifouts Feb 22, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .easignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
backend/nginx/certs/**
32 changes: 32 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@

# Expo
.expo/

# Local env files
.env
.env.*
*.env

# Secrets folder (recommended place for service keys)
secrets/

# Service account and credential files
*service-account*.json
devbits-*.json
devbits-487803-*.json

# Private keys and certs
*.key
*.pem
*.p12
*.jks
*.p8
*.keystore

# OS / editor files
.DS_Store
.vscode/

# Build artifacts
dist/
build/
3 changes: 3 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions .idea/DevBits.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1,454 changes: 1,454 additions & 0 deletions .idea/caches/deviceStreaming.xml

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions .idea/markdown.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"typescript.tsserver.exclude": ["**/node_modules/**"],
"javascript.tsserver.exclude": ["**/node_modules/**"]
}
116 changes: 116 additions & 0 deletions INSTRUCTIONS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
# DevBits Application Instructions

This document provides the essential commands for managing the backend services with Docker and for building and deploying the frontend application.

## Backend Management (Docker)

Use separate command sets for each environment.

### Local DB + Backend (your dev machine)

Run from project root (`c:\Users\eligf\DevBits`):

```bash
docker compose -f backend/docker-compose.yml up -d
```

Rebuild local backend image:

```bash
docker compose -f backend/docker-compose.yml up -d --build
```

Stop local stack:

```bash
docker compose -f backend/docker-compose.yml down
```

Restart local stack:

```bash
docker compose -f backend/docker-compose.yml restart
```

View local logs:

```bash
docker compose -f backend/docker-compose.yml logs -f backend
docker compose -f backend/docker-compose.yml logs -f db
docker compose -f backend/docker-compose.yml logs -f nginx
```

### Live/Deployed DB + Backend (your server)

Run these only on your deployed host where DevBits is installed.

Create backend environment file once (required):

```bash
cd /path/to/DevBits/backend
cp .env.example .env
# edit .env and set a strong POSTGRES_PASSWORD before first deploy
```

```bash
cd /path/to/DevBits/backend
docker compose up -d
docker compose logs -f db
```

Rebuild and restart deployment containers:

```bash
cd /path/to/DevBits/backend
docker compose up -d --build
```

Stop deployment stack:

```bash
cd /path/to/DevBits/backend
docker compose down
```

Important safety note:

- Deployment reset/restore scripts in `backend/scripts` are destructive and should only be run in the environment you intend to modify.
- Never run reset commands against live DB unless you explicitly want a full wipe.

### Deployment DB scripts

All deployment database script usage is documented in:

- `backend/scripts/README.md`

## Frontend Management (EAS)

All frontend commands should be run from the `frontend` directory (`c:\Users\eligf\DevBits\frontend`).

### Install Dependencies

If you haven't already, or if you've pulled new changes, install the necessary Node.js packages:

```bash
npm install
```

### Build the Android App

To create a production build of the Android application for the Google Play Store:

```bash
npx eas build -p android --profile production
```

This will generate an `.aab` file and upload it to your Expo account.

### Submit to Google Play Store

After a successful build, you can submit the latest build to the Google Play Store for internal testing:

```bash
npx eas submit -p android --latest --profile production
```

This command will automatically find the latest build, download it, and upload it to the Google Play Console.
18 changes: 16 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# DevBits
# DevBits

## Goal: Create an X and LinkedIn crossover for posting real content about your projects, semi-formally

Expand Down Expand Up @@ -93,7 +93,7 @@ cd /path/to/DevBits/frontend
#### 2. Check required packages are installed

```bash
npm install
npm install
```

#### 3. Start the app
Expand Down Expand Up @@ -124,3 +124,17 @@ cd /path/to/DevBits/frontend
```bash
npm run all
```

#### Windows quick start (root script)

From the project root, you can launch backend + frontend together:

```powershell
./run-all.ps1
```

## Deployment DB scripts

All deployment database script commands and usage are documented in:

- [backend/scripts/README.md](backend/scripts/README.md)
18 changes: 17 additions & 1 deletion StartupWeekend.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,25 @@
# Goals

- Platform for develpors and people in tech
- Available on phone/ios for now but eventually on most platforms
- Available on phone/ios for now but eventually on most platforms

- [ ] basic front-end development
- [ ] how to build react native app
- [ ] options for deploying database/back-end
- [ ] Integrating front-end and back-end
- [ ] learn how to test the front-end

## App TODOs (Current)

- [ ] Show markdown preview for stream body
- [ ] Show markdown preview for byte body
- [ ] Render profile bio markdown consistently
- [ ] Render comment markdown consistently
- [ ] Use same markdown preview approach as stream subject
- [ ] Fix markdown loading jitter/glitching on heavy stream detail content
- [ ] Fix home screen theme color issues (titles and related UI)
- [ ] Ensure subject in manage streams renders same as other markdown-rendered subject fields
- [ ] In manage streams, always show stream cards normally and open editing in a separate clean popout page
- [ ] From stream detail page, tapping edit should open the same clean popout editor (not inline manage view)
- [ ] Remove all users and completely reset database before deployment
- [ ] Ensure no dummy data or test accounts are created for deployment (blank slate)
3 changes: 3 additions & 0 deletions backend/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
nginx/
.git/
.vscode/
15 changes: 15 additions & 0 deletions backend/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,18 @@
*.dylib
*.test
*.out

# Secrets and certificates
*.key
*.pem
*.p12
*.jks
*.keystore
*.crt

# Service account files
*service-account*.json
devbits-*.json

# nginx certs (if you keep private certs locally, move to secrets/ and ignore)
nginx/certs/
44 changes: 44 additions & 0 deletions backend/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Use the official Golang image to create a build artifact.
# This is known as a multi-stage build.
FROM golang:1.24-alpine as builder

# Set the Current Working Directory inside the container
WORKDIR /app

# Copy go mod and sum files
COPY go.mod go.sum ./

# Download all dependencies. Dependencies will be cached if the go.mod and go.sum files are not changed
RUN go mod download

# Copy the source code from the current directory to the Working Directory inside the container
COPY . .

# Build the Go app
# -o /app/main: output the executable to /app/main
# CGO_ENABLED=0: disable CGO for a statically linked binary
# GOOS=linux: build for Linux
RUN CGO_ENABLED=0 GOOS=linux go build -o /app/main ./api

# Start a new stage from scratch for a smaller image
FROM alpine:latest

WORKDIR /root/

# Copy the Pre-built binary file from the previous stage
COPY --from=builder /app/main .

# Copy the database file
COPY --from=builder /app/api/internal/database/dev.sqlite3 ./api/internal/database/
COPY --from=builder /app/api/internal/database/create_tables.sql ./api/internal/database/

# Copy the uploads directory
# Note: This assumes your application needs access to this directory.
# If it's for temporary uploads, you might want to use a Docker volume instead.
COPY --from=builder /app/uploads ./uploads

# Expose port 8080 to the outside world
EXPOSE 8080

# Command to run the executable
CMD ["./main"]
60 changes: 60 additions & 0 deletions backend/api/internal/auth/jwt.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
package auth

import (
"errors"
"os"
"time"

"github.com/golang-jwt/jwt/v5"
)

const defaultSecret = "devbits-dev-secret"
const tokenTTL = 7 * 24 * time.Hour

type Claims struct {
UserID int64 `json:"user_id"`
Username string `json:"username"`
jwt.RegisteredClaims
}

func getSecret() []byte {
secret := os.Getenv("DEVBITS_JWT_SECRET")
if secret == "" {
secret = defaultSecret
}
return []byte(secret)
}

func GenerateToken(userID int64, username string) (string, error) {
now := time.Now().UTC()
claims := Claims{
UserID: userID,
Username: username,
RegisteredClaims: jwt.RegisteredClaims{
IssuedAt: jwt.NewNumericDate(now),
ExpiresAt: jwt.NewNumericDate(now.Add(tokenTTL)),
},
}

token := jwt.NewWithClaims(jwt.SigningMethodHS256, claims)
return token.SignedString(getSecret())
}

func ParseToken(rawToken string) (*Claims, error) {
token, err := jwt.ParseWithClaims(rawToken, &Claims{}, func(token *jwt.Token) (interface{}, error) {
if _, ok := token.Method.(*jwt.SigningMethodHMAC); !ok {
return nil, errors.New("unexpected signing method")
}
return getSecret(), nil
})
if err != nil {
return nil, err
}

claims, ok := token.Claims.(*Claims)
if !ok || !token.Valid {
return nil, errors.New("invalid token")
}

return claims, nil
}
Loading