No description
- JavaScript 58.5%
- CSS 23.5%
- HTML 16.1%
- Rust 1.9%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| .idea | ||
| db | ||
| node_modules | ||
| src | ||
| .gitignore | ||
| package-lock.json | ||
| package-lock.json.prev | ||
| package.json | ||
| package.json.prev | ||
| README.md | ||
Plateforme Fablab – Garage ISEP
A web platform for submitting and managing 3D-printing orders at the Garage ISEP fablab. Students upload a model file and order details; fablab staff track and update each order's status (pending, sliced, printing, finished, etc.) from an admin dashboard, with a chat thread per order for back-and-forth questions.
Features
- Account system – local registration and login (no external SSO dependency), with hashed passwords.
- Order submission – students upload a 3D model file along with material, color, quantity, and notes.
- Order tracking – students can follow their order's status and message the fablab team about it.
- Admin dashboard – staff view all orders, update their state, and reply to student messages.
- Real-time updates – the client and server communicate over a single WebSocket connection.
Tech stack
- Backend: Node.js,
wsfor WebSocket communication,pgfor PostgreSQL,bcryptjsfor password hashing. - Frontend: plain HTML/CSS/JavaScript (ES modules), no build step required.
- Database: PostgreSQL.
Project structure
.
├── src/
│ ├── back/ # Node.js server
│ │ ├── server.js # HTTP + WebSocket server, static file serving, message routing
│ │ ├── db_handler.js # PostgreSQL queries
│ │ └── login_handler.js # Registration / authentication logic
│ └── front/ # Static client
│ ├── HTML/
│ ├── CSS/
│ ├── JS/
│ └── Assets/
├── db/
│ └── init.sql # Database schema, auto-applied by the Postgres container
├── Dockerfile
├── docker-compose.yml
├── .env.example
└── package.json
Getting started with Docker (recommended)
This spins up the app and a PostgreSQL database together; the schema in db/init.sql is applied automatically on first run.
- Copy the environment template and set a real database password:
cp .env.example .env - Build and start the stack:
docker compose up --build - The app is available at http://localhost:8080 (or whatever
PORTyou set in.env).
Uploaded order files and database data persist in Docker volumes (uploads, db_data) across restarts. To reset everything, including the database, run docker compose down -v.
Running locally without Docker
Requirements: Node.js 20+, a running PostgreSQL instance.
- Install dependencies:
npm install - Create the database and apply the schema:
psql -U <user> -d <database> -f db/init.sql - Set the environment variables listed below (e.g. via a
.envfile loaded by your shell, or exported directly). - Start the server:
npm start - The app is available at http://localhost:8080 by default.
Environment variables
| Variable | Description | Default |
|---|---|---|
PORT |
Port the server listens on | 8080 |
DB_HOST |
PostgreSQL host | localhost |
DB_PORT |
PostgreSQL port | 5432 |
DB_USER |
PostgreSQL user | postgres |
DB_PASSWORD |
PostgreSQL password | (required, no default) |
DB_NAME |
PostgreSQL database name | plateforme_fablab |
UPLOADS_DIR |
Directory where uploaded order files are stored | ./uploads |
See .env.example for a ready-to-copy template.
Database schema
db/init.sql defines three tables:
user– accounts (student code, hashed password, privilege level, name, chat).cookie– active session tokens linked to a user.order– submitted orders (details, state, uploaded files, chat thread).
Security notes
- Passwords are hashed with bcrypt before being stored; plaintext passwords are never persisted.
- Session tokens are generated with
crypto.randomBytesand stored server-side in thecookietable. - There is currently no admin-approval step for new accounts and no password-reset flow — anyone who can reach the server can self-register. Add an invitation/approval step if that's a concern for your deployment.