Change 1
A real-time messaging application built with Go (backend) and Next.js (frontend).
⚠️ Development & Testing Project
This is an experimental project created for development testing and deployment experimentation purposes. It is not intended for production use and may contain security vulnerabilities, incomplete features, or unstable code. Use at your own risk.
front-back-stack/
├── backend/ # Go API server
│ ├── handlers/ # HTTP request handlers
│ ├── models/ # Data models
│ ├── utils/ # Utility functions (JWT)
│ ├── main.go # Main server file
│ └── go.mod # Go dependencies
└── frontend/ # Next.js React app
├── components/ # React components
├── pages/ # Next.js pages
├── utils/ # API and auth utilities
├── styles/ # CSS styles
└── package.json # Node dependencies
- User registration and authentication
- JWT-based session management
- Real-time message display
- Profile picture support
- In-memory message storage
- Responsive UI design
-
Navigate to the backend directory:
cd backend -
Install dependencies:
go mod tidy
-
Run the server:
go run main.go
The backend will start on http://localhost:8080
-
Navigate to the frontend directory:
cd frontend -
Install dependencies:
npm install
-
Run the development server:
npm run dev
The frontend will start on http://localhost:3000
POST /api/register- Register a new userPOST /api/login- Login user
GET /api/messages- Get all messagesPOST /api/messages- Send a new message
- Start both backend and frontend servers
- Open
http://localhost:3000in your browser - Register a new account or login
- Start messaging!
Backend:
- Go 1.21
- Gorilla Mux (routing)
- JWT authentication
- bcrypt (password hashing)
- CORS support
Frontend:
- Next.js 14
- React 18
- TypeScript
- Axios (HTTP client)
- Local storage for auth persistence