A secure Node.js authentication starter built with Express.js, JWT, and a lightweight local database store so the project can run even without a local Postgres installation.
The app now uses a local JSON file database at Backend/database/auth-store.json by default. This keeps the project portable for demos and open-source sharing.
If you want to use PostgreSQL instead, set a DATABASE_URL in Backend/.env and the app will connect to it automatically.
If you later connect to PostgreSQL, create the users table with:
CREATE TABLE users (
id BIGSERIAL PRIMARY KEY,
full_name VARCHAR(150) NOT NULL,
email VARCHAR(255) NOT NULL UNIQUE,
password_hash TEXT NOT NULL,
is_active BOOLEAN DEFAULT TRUE,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);- Install dependencies in the backend and frontend folders.
- Start the backend:
cd Backend npm run dev - Start the frontend:
cd Frontend npm run dev
- The local database file is created automatically on first run.
- The UI has been refreshed with a dark theme for a modern look.
- When a user is already authenticated, the app keeps them on the success screen instead of allowing them to return to login until they log out.