A sophisticated full-stack web application built with Next.js 14, featuring user authentication, real-time posts, and modern development practices.
- Authentication System: Secure user registration and login with JWT tokens
- Real-time Posts: Create and view posts instantly
- Modern UI: Responsive design with Tailwind CSS and gradient backgrounds
- Database Integration: SQLite database with Prisma ORM
- Security: Password hashing with bcrypt, secure token validation
- TypeScript: Full type safety throughout the application
- CI/CD Pipeline: Automated testing, security scanning, and deployment
- Docker Support: Containerized application with multi-platform builds
- Next.js 14 - React framework with App Router
- React 18 - User interface library
- TypeScript - Type-safe JavaScript
- Tailwind CSS - Utility-first CSS framework
- Next.js API Routes - Serverless API endpoints
- Prisma - Modern database toolkit and ORM
- SQLite - Embedded database (development)
- JWT - JSON Web Tokens for authentication
- bcrypt - Password hashing
- GitHub Actions - CI/CD pipeline
- Docker - Containerization
- Vercel - Deployment platform
- CodeQL - Security analysis
- Dependabot - Automated dependency updates
- Node.js 18.x or 20.x
- npm or yarn
- Git
-
Clone the repository
git clone https://github.com/lenzarchive/neurostream.git cd neurostream -
Install dependencies
npm install
-
Environment setup
cp .env.example .env
Edit
.envwith your configuration:DATABASE_URL="file:./dev.db" NEXTAUTH_SECRET="your-super-secret-jwt-key-here" NEXTAUTH_URL="http://localhost:3000"
-
Database setup
npx prisma generate npx prisma db push
-
Initialize Tailwind CSS
npx tailwindcss init -p
-
Start development server
npm run dev
-
Open your browser Navigate to http://localhost:3000
├── .github/
│ ├── workflows/ # GitHub Actions CI/CD
│ ├── ISSUE_TEMPLATE/ # Issue templates
│ └── pull_request_template.md
├── lib/
│ ├── auth.ts # Authentication utilities
│ └── db.ts # Database connection
├── pages/
│ ├── api/
│ │ ├── auth/ # Authentication endpoints
│ │ └── posts/ # Posts API endpoints
│ └── index.tsx # Main application page
├── prisma/
│ └── production.prisma # Database schema production
│ └── development.prisma # Database schema development
├── styles/
│ └── globals.css # Global styles
├── Dockerfile # Docker configuration
├── docker-compose.yml # Local development with Docker
└── README.md
POST /api/auth/register- User registrationPOST /api/auth/login- User login
GET /api/posts- Retrieve all published postsPOST /api/posts- Create new post (authenticated)
npm run dev- Start development servernpm run build- Build for productionnpm run start- Start production servernpm run lint- Run ESLint
# Generate Prisma client
npx prisma generate
# Push schema changes
npx prisma db push
# View database in browser
npx prisma studio
# Reset database
npx prisma db push --force-reset# Build Docker image
docker build -t neurostream .
# Run with Docker Compose
docker-compose up -d
# View logs
docker-compose logs -f-
Connect to Vercel
npm i -g vercel vercel
-
Set environment variables
NEXTAUTH_SECRETNEXTAUTH_URLDATABASE_URL(for production database)
-
Deploy
vercel --prod
# Build production image
docker build -t neurostream:latest .
# Run production container
docker run -p 3000:3000 \
-e NEXTAUTH_SECRET="your-secret" \
-e NEXTAUTH_URL="https://yourdomain.com" \
-e DATABASE_URL="your-production-db-url" \
neurostream:latest- Passwords are hashed using bcrypt with salt rounds of 12
- JWT tokens expire after 1 day
- SQL injection prevention through Prisma ORM
- Input validation on all API endpoints
- HTTPS enforcement in production
- Security headers configured
- Automated vulnerability scanning with CodeQL
- Fork the repository
- Clone to your local machine (
git clone https://github.com/yourname/neurostream.git) or from my repo (git clone https://github.com/lenzarchive/neurostream.git) - Make your changes directly
- Commit your changes (
git commit -m 'Add amazing feature') - Push to main branch (
git push origin main) - Create a Pull Request from your fork
- Use TypeScript for all new code
- Follow ESLint configuration
- Write meaningful commit messages
- Add tests for new features
- Update documentation as needed
- GitHub Actions for CI/CD monitoring
- Vercel Analytics for performance metrics
- Error tracking with built-in Next.js error boundaries
- Security monitoring with Dependabot and CodeQL
This project is licensed under the MIT License - see the LICENSE file for details.
- Next.js team for the amazing framework
- Prisma team for the excellent ORM
- Tailwind CSS for the utility-first approach
- Vercel for seamless deployment experience
If you have any questions or need help:
- Check the Issues page
- Create a new issue using the provided templates
- Join our community discussions
Built with ❤️ by AlwizBA using modern web technologies