A full-stack Node.js web application for managing users and books with a SQLite database, built using Express.js for the backend and vanilla JavaScript for the frontend.
Developed as part of the EPITA Bachelor in Computer Science β S3, Advanced Web Development course.
- Browse all books with automatic 3βsecond refresh
- Full CRUD operations (Create, Read, Update, Delete)
- Responsive card-based grid layout with hover effects
- Manage users with full CRUD operations
- API key authentication for
/usersendpoints - Email uniqueness validation
- SQLite persistent storage
- Automatic schema creation on startup
- Development seed data
- RESTful endpoints for books and users
- CORS enabled for cross-origin requests
- Comprehensive error handling
- Responsive design (desktop, tablet, mobile)
- Real-time auto-refresh
- Clean, minimal UI
| Requirement | Version | Notes |
|---|---|---|
| Node.js | v22.14.0+ | Required |
| npm | Latest | Comes with Node.js |
| SQLite | 3.x | Usually pre-installed |
| OS | Windows/Mac/Linux | Compatible |
git clone https://github.com/TATCHIwillyjunior/Node_JS_App.git
cd "Node Js App"npm installInstalls:
- express (web framework)
- cors (cross-origin support)
- better-sqlite3 (database)
- nodemon (development auto-reload)
cp .env.example .envEdit .env:
PORT=3000
NODE_ENV=development
DATABASE_URL=./database.sqlite
API_KEY=Your_Choicen_Key
JWT_SECRET=Your_Choicen_secret_key
JWT_EXPIRES_IN=24h
npm run devExpected output:
β
Server listening on http://localhost:3000
π Database path: ./database.sqlite
π Seeding books...
β
Database initialization complete
# Option A: Simple HTTP server
npx http-server public -c-1 -p 8080
# Option B: Live reload
npx live-server public --port=8080
Visit:
http://localhost:8080
β Books will auto-load after 3 seconds!
Node Js App/
βββ src/ # Backend
β βββ config/ # Env & DB setup
β βββ models/ # Book & User schemas
β βββ controllers/ # Request handlers
β βββ routes/ # API routes
β βββ middleware/ # Auth middleware
β βββ index.js # Express entry point
β
βββ public/ # Frontend
β βββ index.html
β βββ src/
β β βββ main.js # Frontend logic
β β βββ api.js # API client
β βββ styles/
β βββ globals.css # Styling
β
βββ .env # Local environment
βββ .env.example # Template
βββ package.json
βββ database.sqlite # SQLite DB
βββ README.md
This project now includes a CI workflow (.github/workflows/ci.yml) that automatically runs on:
- Pushes to main
- All Pull Requests
The pipeline performs:
- Install dependencies
- Build (if a build script exists)
This ensures every changes including Renovate updates is validated before merging
Renovate is configured using the renovate.json file at the root of the project.
- Timezone: Europe/Paris
- Schedule:
- Every Sunday at 03:00
- Every Sunday at 18:00
- No automerge (CI must pass first)
- Uses config:base for standard Renovate rules
A dedicated workflow (.github/workflows/renovate.yml) runs Renovate on a schedule and can also be triggered manually.
Renovate automatically creates Pull Requests to update:
- npm dependencies
- devDependencies
- minor/patch updates
- major updates (separate PRs)
- Development:
http://localhost:3000
| Method | Endpoint | Description |
|---|---|---|
| GET | /books |
Get all books |
| GET | /books/:id |
Get book by ID |
| POST | /books |
Create book |
| PUT | /books/:id |
Update book |
| DELETE | /books/:id |
Delete book |
X-API-Key header)
| Method | Endpoint | Description |
|---|---|---|
| GET | /users |
Get all users |
| GET | /users/:id |
Get user by ID |
| POST | /users |
Create user |
| PUT | /users/:id |
Update user |
| DELETE | /users/:id |
Delete user |
- Auto-load books after 3 seconds
- Manual refresh button
- Responsive card grid (desktop, tablet, mobile)
- Book cards show title, author, year, genre
- Hover effects for better UX
- API Key protection for
/users - Email uniqueness validation
- Input validation for required fields
npm run dev # Development with nodemon
npm start # Production- Connect GitHub repo to Render
- Configure service:
- Build Command:
npm install - Start Command:
node src/index.js
- Build Command:
- Add environment variables in Render dashboard
- Deploy π
- No books showing? Ensure backend and frontend servers are running, DB exists, and API returns data.
- 401 Unauthorized on /users? Check API key in
.envand request headers. - Port in use? Kill process using port 3000 before restarting.
- Fork the repo
- Create a feature branch
- Commit changes
- Push branch
- Open a Pull Request