Skip to content

About

TypeScript and Express backend prototype for sharing learning resources, with posts, comments, likes, JWT authentication, and SQLite.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

10 Commits

Folders and files

Repository files navigation

Codersquare

A backend for a Hacker News-style community where developers share and discuss learning resources.

Stack: TypeScript · Node.js · Express 5 · SQLite · JWT
Status: Backend prototype. React screens are planned; the repository contains UI designs, not an implemented React application.

Implemented areas

  • User registration and sign-in.
  • Creating, listing, reading, and deleting posts.
  • Creating and listing comments.
  • Adding and removing likes.
  • SQLite persistence through a datastore interface and SQL migrations.

These are source-level capabilities. Automated test coverage and deployment validation are still needed.

Architecture

Express routes (index.ts)
          |
       Handlers
          |
   Datastore interface
          |
      SQLite + migrations

The current implementation is one Express application. Product ideas in the PRD describe future work.

Run locally

Use a current Node.js LTS release and npm.

git clone https://github.com/MONOCODE-V/codersquare.git
cd codersquare
npm install

Create a .env file in the repository root:

PORT=3000
JWT_SECRET=replace-with-a-long-random-local-secret
npm start

The default URL is http://localhost:3000. Startup initializes SQLite and applies migrations under server/dataStore/sql/migration/. Use a disposable local database when exploring the existing migration history.

Routes

Method Path Authentication
POST /v1/users Public registration
POST /v1/users/auth Public sign-in
POST, GET /v1/posts JWT middleware
GET, DELETE /v1/posts/:id JWT middleware
POST, GET /v1/comments JWT middleware
POST, DELETE /v1/likes JWT middleware
GET /v1/signinStatus JWT middleware

See index.ts for route wiring and Handlers/api.ts for request/response types.

Project map

Validation and remaining work

  • npm run build invokes TypeScript compilation.
  • npm test is currently a placeholder that exits with an error.
  • Registration token creation, password hashing, request-body logging, authorization, and migration behavior need review before deployment.
  • Implement the frontend, add end-to-end API tests, and publish a reproducible demo before treating this as a finished product.

License

The repository includes an MIT license; package metadata currently declares ISC and needs reconciliation.

About

TypeScript and Express backend prototype for sharing learning resources, with posts, comments, likes, JWT authentication, and SQLite.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages