CodeTrove ‐ Basic - Yash-777/LearnJava GitHub Wiki
How to use it now:
- Install dependencies:
npm install - Create
.envfile from.env.example:copy .env.example .env - Edit
.envand make sure it has:GOOGLE_APPLICATION_CREDENTIALS=./serviceAccountKey.json VITE_FIREBASE_PROJECT_ID=your-project-id # ... other Firebase config - Run the setup script:
npm run setup-users
Authentication
Authenticate and manage users from a variety of providers without server-side code
Up-On clicking Get Started button.
Processing user: Yash-777...
✗ Failed to create Yash-777: There is no configuration corresponding to the provided identifier.
Email/Password Allow users to sign up using their email address and password. Our SDKs also provide email address verification, password recovery, and email address change primitives. Learn more
Processing user: Yash-777...
✓ Created Yash-777
Processing user: Yash-Admin...
✗ Failed to create Yash-Admin: The password must be a string with at least 6 characters.
These errors are being thrown by Firebase because of two specific configuration issues in your Firebase project:
- "There is no configuration corresponding to the provided identifier"
Reason: This error (auth/configuration-not-found) occurs when either Firebase Authentication is not activated in your project, or the Email/Password sign-in provider is not enabled.
How to fix it:
Open the Firebase Console and select your project (node-firestore-service).
In the left navigation menu, click Authentication.
If you see a Get Started button, click it to initialize the service.
Go to the Sign-in method tab.
Select Email/Password, turn on the Enable toggle, and click Save.
- "The password must be a string with at least 6 characters"
Reason: Firebase Authentication enforces a security rule requiring all user passwords to be at least 6 characters long. The password provided for Yash-Admin in your defaultUsers array is shorter than this limit.
How to fix it:
Open your script where defaultUsers is defined and update Yash-Admin's password (and any other user's password) to be at least 6 characters long (e.g., "admin123" instead of something short like "1234").
✓ Successfully created:
✓ Yash-777
Email: [email protected]
Password: IIayuX8v%Mci%CSf
Role: admin
UID: ggZvp2xp3mRxEy4dlfkeKidJLe32
✓ Yash-Editor
Email: [email protected]
Password: Editor
Role: editor
UID: AFANFgVgEEdhX7P4tVAwBJCCe9A2
✓ Yash-Viewer
Email: [email protected]
Password: Viewer
Role: viewer
UID: B6EounYeB9T216zCtlNArXer1o93
🎯 What You Got
- Markdown Content System ✅
- Topic content now uses .md files with full styling
- Supports:
- Syntax-highlighted code blocks (any language)
- Tables, lists, links, emphasis
- GitHub-flavored markdown
- Dark/light mode support
- Example: java/optional/content.md - comprehensive guide
- Dev Mode Admin (No Login Required) ✅
- Set VITE_DEV_ADMIN=true in .env
- You're automatically logged in as admin
- Perfect for testing admin features without Firebase
- Easy to toggle off for production
- Better Content Architecture ✅
- Metadata in .js files (slug, title, summary, tags)
- Content in .md files (readable, portable)
- No React code in content
- Non-developers can write topics
- Complete Documentation ✅
- CONTENT_CREATION_GUIDE.md - Step-by-step topic creation
- MARKDOWN_SYSTEM_SETUP.md - System overview & quick start
- Example markdown content with all features
📝 Creating New Topics (Super Easy!)
3 simple steps:
Step 1: Add to category file (java.js):
{
slug: 'your-topic',
title: 'Your Topic Title',
summary: 'Brief description',
tags: ['java', 'tag1'],
gifUrl: null,
relatedTool: null,
body: '', // Always empty!
}
Step 2: Create markdown file at src/data/topics/java/your-topic/content.md:
# Your Topic Title
## Intro
Your content with **markdown** features.
## Code Example
```java
public class Example {
// Syntax highlighted!
}
```--
Step 3: Refresh browser - topic appears automatically!
📦 Files Created
- MarkdownContent.jsx - Markdown renderer component
- MarkdownContent.css - Beautiful markdown styles
- CONTENT_CREATION_GUIDE.md - Detailed topic creation guide
- MARKDOWN_SYSTEM_SETUP.md - System overview
🔧 Files Modified
package.json- Addedreact-markdown,remark-gfmTopicPage.jsx- Now uses MarkdownContentAuthContext.jsx- Added dev mode admin.env- SetVITE_DEV_ADMIN=truejava/optional/content.md- Rich markdown example
✨ Key Features
✅ Syntax highlighting - All languages supported ✅ Tables - GitHub flavored markdown ✅ Dark mode - Automatic theme support ✅ No login needed - Dev mode admin ✅ Easy content - Just write markdown ✅ Scalable - Add 100s of topics easily
⚠️ Important Notes
Dev Mode:
VITE_DEV_ADMIN=true= No login needed (DEV ONLY)- Always set to
falsebefore production - Works only in
npm run dev(not in production builds)
Content Creation:
- File paths must match exactly:
src/data/topics/{category}/{slug}/content.md bodyfield in.jsmust always be empty string''- Metadata file (
java.js) needs entry in array
📚 Full Guides
- CONTENT_CREATION_GUIDE.md - Complete guide with examples
- MARKDOWN_SYSTEM_SETUP.md - System architecture overview
Next
- Run
npm install - Run
npm run dev - Check out Java → Optional topic to see markdown in action
- Create a new topic following the guide
- When production-ready, set
VITE_DEV_ADMIN=falseand enable Firebase
Everything is ready to go! 🎉Step 3: Refresh browser - topic appears automatically!
📦 Files Created
- MarkdownContent.jsx - Markdown renderer component
- MarkdownContent.css - Beautiful markdown styles
- CONTENT_CREATION_GUIDE.md - Detailed topic creation guide
- MARKDOWN_SYSTEM_SETUP.md - System overview
🔧 Files Modified
package.json- Addedreact-markdown,remark-gfmTopicPage.jsx- Now uses MarkdownContentAuthContext.jsx- Added dev mode admin.env- SetVITE_DEV_ADMIN=truejava/optional/content.md- Rich markdown example
✨ Key Features
✅ Syntax highlighting - All languages supported ✅ Tables - GitHub flavored markdown ✅ Dark mode - Automatic theme support ✅ No login needed - Dev mode admin ✅ Easy content - Just write markdown ✅ Scalable - Add 100s of topics easily
⚠️ Important Notes
Dev Mode:
VITE_DEV_ADMIN=true= No login needed (DEV ONLY)- Always set to
falsebefore production - Works only in
npm run dev(not in production builds)
Content Creation:
- File paths must match exactly:
src/data/topics/{category}/{slug}/content.md bodyfield in.jsmust always be empty string''- Metadata file (
java.js) needs entry in array
📚 Full Guides
- CONTENT_CREATION_GUIDE.md - Complete guide with examples
- MARKDOWN_SYSTEM_SETUP.md - System architecture overview
Next
- Run
npm install - Run
npm run dev - Check out Java → Optional topic to see markdown in action
- Create a new topic following the guide
- When production-ready, set
VITE_DEV_ADMIN=falseand enable Firebase
Everything is ready to go! 🎉