CodeSnippets is a high-performance, full-stack web application designed for developers and students to share, store, and collaborate on code logic. Built with Next.js 14, Prisma, and Redis, it features a premium "blank canvas" UI and AI-powered enhancements.
- 🎨 Premium UI: Redesigned home page with a clean, centered aesthetic, featuring animated ambient background glows and a minimal grid pattern.
- 🧪 Cypress E2E Testing: Comprehensive test suite covering user authentication (Sign Up/Sign In) and all core API endpoints.
- 🔄 CI/CD Pipeline: Integrated GitHub Actions workflow that automatically lints, type-checks, and runs E2E tests on every push.
- 🤖 AI Generation: Powered by Google Gemini AI to generate optimized code blocks instantly.
- 🔐 Secure Auth: NextAuth integration with custom session handling for robust testing and user security.
- Framework: Next.js 14 (App Router)
- Database: PostgreSQL (Prisma ORM)
- Caching: Redis
- Testing: Cypress (End-to-End)
- CI/CD: GitHub Actions
- AI Engine: Google Gemini API
- Styling: Tailwind CSS & Framer Motion
We use Cypress for end-to-end testing to ensure a stable user experience.
Ensure your development server is running (npm run dev), then:
# Open interactive Cypress runner
npm run cypress:open
# Run tests in headless mode
npm run cypress:runThe included GitHub Action (.github/workflows/pipeline.yml) automatically:
- Spinst up ephemeral Postgres & Redis containers.
- Performs linting and TypeScript type checks.
- Builds the production bundle.
- Executes the full Cypress test suite.
Create a .env file based on the project requirements:
DATABASE_URL="postgresql://..."
REDIS_URL="redis://..."
NEXTAUTH_SECRET="your_secret"
GOOGLE_GEMINI_API_KEY="your_key"
NEXTAUTH_URL="http://localhost:3000"
GITHUB_ID=""
GITHUB_SECRET=""
GOOGLE_CLIENT_ID=""
GOOGLE_CLIENT_SECRET=""# Install dependencies
npm install
# Run dev server
npm run devdocker-compose up --buildContributions are welcome! Please ensure all tests pass (npm run cypress:run) before submitting a Pull Request.
Happy Coding! 💻🔥