-
Notifications
You must be signed in to change notification settings - Fork 0
Developer Setup
The short path to a running copy. The README has every option and every environment variable.
-
Node.js 24 (or 22.13+).
nvm usereads the version from.nvmrc. - MongoDB: a local instance or a free Atlas cluster. Docker can provide one.
- For sign-up codes and password resets: a Gmail account, with an App Password for SMTP.
git clone https://github.com/UtshaBasak/BookStoreBD.git
cd BookStoreBD
npm install
npm run install:all
cp server/.env.example server/.env
cp client/.env.example client/.envFill in server/.env. At minimum you need MONGO and JWT_SECRET (32+
characters; openssl rand -hex 48 makes one), plus SMTP_USER and SMTP_PASS
for e-mail. The server checks these at start-up and explains anything
missing. For demo data, also set SEED_PASSWORD to a password of your choice.
npm run seed # demo accounts and books, using your SEED_PASSWORD (optional)
npm run dev # API and client together| Shop | http://localhost:5173 |
| API | http://localhost:4000 |
| Health | http://localhost:4000/health |
To make yourself an administrator, put your e-mail in ADMIN_EMAILS in
server/.env and sign in again.
No Node or MongoDB to install. Compose reads its settings from .env:
cp .env.example .env # set JWT_SECRET and SEED_PASSWORD
docker compose up --build
docker compose run --rm seedThe source is mounted into the containers, so edits reload as usual. The seed
creates admin@, seller@ and buyer@bookstorebd.local, all using your
SEED_PASSWORD.
The whole shop in one container, as the live site runs it:
docker run -p 4000:4000 \
-e MONGO="mongodb+srv://<your-cluster>/bookstorebd" \
-e JWT_SECRET="$(openssl rand -hex 48)" \
ghcr.io/utshabasak/bookstorebdIt contains no configuration of its own; supply any other setting from
server/.env.example the same way.
Run from the repository root:
| Command | Does |
|---|---|
npm run dev |
API and client with hot reload |
npm test |
Both test suites |
npm run typecheck |
Type-checks both packages, tests included |
npm run lint |
Lints both packages |
npm run build |
Production build of both |
npm run seed -- --reset |
Empties the database and seeds it again |
Vite and tsx only strip types; they do not check them. npm run typecheck is
what catches a type error.
CI runs type-checking, lint, both test suites and the build on every push and pull request. Run them locally first:
npm run typecheck && npm run lint && npm test && npm run buildBranch names, commit style and conventions are in CONTRIBUTING.md.
BookStoreBD · MIT License · Questions: support.utsha@gmail.com
Using the shop
Working on it
Links