Skip to content

devansh-ar/OpenShelf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OpenShelf

A community platform where people share free learning resources (books, courses, tools, notes). Browse, upvote, comment, and discover the best resources.

Tech Stack

  • Frontend: Next.js (JavaScript, App Router) + Tailwind CSS
  • Backend: Go (Chi router)
  • Database: PostgreSQL (Docker)
  • Auth: JWT (email + password)

Getting Started

Prerequisites

  • Node.js 18+
  • Go 1.21+
  • Docker & Docker Compose

1. Start PostgreSQL

docker-compose up -d

2. Start Backend

cd backend
go mod download
go run cmd/server/main.go

Backend runs on http://localhost:8080

3. Start Frontend

cd frontend
npm install
npm run dev

Frontend runs on http://localhost:3000

API Endpoints

Auth

  • POST /api/auth/signup - Register
  • POST /api/auth/login - Login
  • GET /api/auth/me - Current user

Resources

  • GET /api/resources - List (search, filter, paginate)
  • GET /api/resources/:id - Detail
  • POST /api/resources - Submit (auth)
  • PUT /api/resources/:id - Edit (auth)
  • DELETE /api/resources/:id - Delete (auth)

Upvotes & Comments & Bookmarks

  • POST /api/resources/:id/upvote - Toggle upvote
  • GET /api/resources/:id/comments - List comments
  • POST /api/resources/:id/comments - Add comment
  • GET /api/bookmarks - My bookmarks
  • POST /api/resources/:id/bookmark - Toggle bookmark

Environment Variables

Backend (.env)

PORT=8080
DATABASE_URL=postgres://postgres:postgres@localhost:5432/openshelf?sslmode=disable
JWT_SECRET=your-secret-key-change-in-production

Frontend (.env.local)

NEXT_PUBLIC_API_URL=http://localhost:8080/api

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors