https://github.com/uthrapathy-m/osm-auth-app
Full-stack login and landing page app using Node.js, MongoDB, Tailwind CSS, and Docker Compose.
https://github.com/uthrapathy-m/osm-auth-app
docker docker-compose docker-image docker-images dockerfile
Last synced: about 2 months ago
JSON representation
Full-stack login and landing page app using Node.js, MongoDB, Tailwind CSS, and Docker Compose.
- Host: GitHub
- URL: https://github.com/uthrapathy-m/osm-auth-app
- Owner: uthrapathy-m
- Created: 2025-05-29T07:03:42.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-05-29T07:30:47.000Z (about 1 year ago)
- Last Synced: 2025-10-20T01:57:16.610Z (8 months ago)
- Topics: docker, docker-compose, docker-image, docker-images, dockerfile
- Language: JavaScript
- Homepage:
- Size: 33.2 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Hereβs your complete and polished `README.md` for the GitHub repo of your full-stack login + landing page Docker Compose app:
---
### β
`README.md`
```markdown
# π§ OSM Auth App
A full-stack login + landing page app using:
- βοΈ Node.js + Express backend (JWT-based authentication)
- π¨ Static HTML + Tailwind CSS frontend
- π MongoDB for user storage
- π³ Docker Compose to run everything easily β no local installs required
---
## π¦ Features
- β
User registration and login
- β
Password hashing with bcrypt
- β
JWT token generation and localStorage-based login
- β
Elegant UI styled using TailwindCSS
- β
Landing page appears after login
- β
Entire app runs with a single Docker Compose command
---
```
## π Folder Structure
```
osm-auth-app/
βββ backend/ # Node.js Express API (port 5000)
βββ frontend/ # Static HTML UI served via npx serve (port 3000)
βββ docker-compose.yml # Docker Compose setup
βββ .gitignore # Docker Compose setup
````
---
## π οΈ Tech Stack
| Layer | Technology |
|------------|--------------------|
| Frontend | HTML, TailwindCSS |
| Backend | Node.js, Express |
| Database | MongoDB |
| Auth | JWT, bcrypt |
| DevOps | Docker Compose |
---
## π Getting Started
### 1. Clone the Repository
```bash
git clone https://github.com/uthrapathy-m/osm-auth-app.git
cd osm-auth-app
````
---
### 2. Build & Run the App
#### β
Recommended: Full Rebuild
```bash
docker-compose up --build -d
```
---
* Reuses volumes and image cache
* Faster for incremental testing
#### βοΈ Optional: Clean Build and Start
```bash
docker-compose down -v && docker-compose build --no-cache && docker-compose up -d
```
* Removes all containers, volumes, and cache
* Rebuilds everything fresh
* Starts services in background (detached mode)
---
### 3. Access the Application
| Service | URL |
| -------- | -------------------------------------------------------- |
| Frontend | [http://localhost:3000](http://localhost:3000) |
| Backend | [http://localhost:5000/auth](http://localhost:5000/auth) |
| Database | localhost:27017 (internal via `mongo`) |
---
## π Auth Flow
1. Users submit a username and password via the login page
2. If itβs a first-time user β auto-register and hash the password
3. If user exists β verify password using bcrypt
4. Issue a JWT token on success
5. Save token in `localStorage` and redirect to `landing.html`
---
## π§ͺ Dev Commands
```bash
# View backend logs
docker-compose logs -f backend
# View all service logs
docker-compose logs -f
# Stop all services
docker-compose down
# Stop and wipe everything
docker-compose down -v
```
---
## β Troubleshooting
### Invalid ELF Header on bcrypt?
If you see:
```
Error: invalid ELF header in bcrypt_lib.node
```
You copied `node_modules` from your host into the container. Fix it:
* Add this to `backend/.dockerignore`:
```
node_modules
```
Then rebuild with:
```bash
docker-compose down -v && docker-compose build --no-cache && docker-compose up -d
```