Repository navigation
CodeTrove ‐ Basic
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
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: yash.777@learntogether.dev
Password: IIayuX8v%Mci%CSf
Role: admin
UID: ggZvp2xp3mRxEy4dlfkeKidJLe32
✓ Yash-Editor
Email: yash.editor@learntogether.dev
Password: Editor
Role: editor
UID: AFANFgVgEEdhX7P4tVAwBJCCe9A2
✓ Yash-Viewer
Email: yash.viewer@learntogether.dev
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!
- MarkdownContent.jsx - Markdown renderer component
- MarkdownContent.css - Beautiful markdown styles
- CONTENT_CREATION_GUIDE.md - Detailed topic creation guide
- MARKDOWN_SYSTEM_SETUP.md - System overview
-
package.json- Addedreact-markdown,remark-gfm -
TopicPage.jsx- Now uses MarkdownContent -
AuthContext.jsx- Added dev mode admin -
.env- SetVITE_DEV_ADMIN=true -
java/optional/content.md- Rich markdown example
✅ 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
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
- CONTENT_CREATION_GUIDE.md - Complete guide with examples
- MARKDOWN_SYSTEM_SETUP.md - System architecture overview
- 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!
- MarkdownContent.jsx - Markdown renderer component
- MarkdownContent.css - Beautiful markdown styles
- CONTENT_CREATION_GUIDE.md - Detailed topic creation guide
- MARKDOWN_SYSTEM_SETUP.md - System overview
-
package.json- Addedreact-markdown,remark-gfm -
TopicPage.jsx- Now uses MarkdownContent -
AuthContext.jsx- Added dev mode admin -
.env- SetVITE_DEV_ADMIN=true -
java/optional/content.md- Rich markdown example
✅ 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
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
- CONTENT_CREATION_GUIDE.md - Complete guide with examples
- MARKDOWN_SYSTEM_SETUP.md - System architecture overview
- 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! 🎉
OpenJDK Downloads : In a class-based object-oriented language, in general, state is carried by instances, methods are carried by classes, and inheritance is only of structure and behavior. Basic, Refactoring Techniques
Method signature: It consists of method name and parameter list (number/type/order of the parameters). methodName(parametersList y). An instance method in a subclass with the same signature and return type as an instance method in the super-class overrides the super-class's method.
Java OOP concepts
Class - Collection of a common features of a group of object [static/instance Fields, blocks and Methods]
Object - Instance of a class (instance fields)
Abstraction - Process of hiding complex info and providing required info like API, Marker Interfaces ...
Encapsulation(Security) - Class Binding up with data members(fields) and member functions.
Inheritance (Reusability by placing common code in single class)
1. Multilevel - {A -> B -> C} 2. Multiple - Diamond problem {A <- (B) -> C} [Java not supports] 3. Cyclic {A <-> B} [Java not supports]
* Is-A Relation - Class A extends B
* Hash-A Relation - Class A { B obj = new B(); } - (Composition/Aggregation)
Polymorphism (Flexibility) 1. Compile-Time Overloading 2. Runtime Overriding [Greek - "many forms"]
int[] arr = {1,2,3}; int arrLength = arr.length; // Fixed length of sequential blocks to hold same data type
String str = "Yash"; int strLength = str.length(); // Immutable Object value can't be changed.
List<?> collections = new ArrayList<String>(); int collectionGroupSize = collections.size();
Map<?, ?> mapEntry = new HashMap<String, String>();
Set<?> keySet = mapEntry.keySet(); // Set of Key's
Set<?> entrySet = mapEntry.entrySet(); // Set of Entries [Key, Value]
// Immutable Objects once created they can't be modified. final class Integer/String/Employee
Integer val = Integer.valueOf("100"); String str2 = String.valueOf(100); // Immutable classes
final class Employee { // All Wrapper classes, java.util.UUID, java.io.File ...
private final String empName; // Field as Final(values can be assigned only once) Only getter functions.
public Employee(String name) { this.empName = name; }
} Native Java Code for Hashtable.h, Hashtable.cpp
SQL API.
You can check your current JDK and JRE versions on your command prompt respectively,
- JDK
javac -version [C:\Program Files\Java\jdk1.8.0_121\bin]o/p:javac 1.8.0_121 - JRE
java -version[C:\Program Files\Java\jdk1.8.0_121\bin]o/P:java version "1.8.0_102"
JAVA_HOME - Must be set to JDK otherwise maven projects leads to compilation error. [ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK? C:\Softwares\OpenJDK\, 7-zip
Fatal error compiling: invalid target release: JRE and JDK must be of same version
1.8.0.XXX
Disable TLS 1.0 and 1.1
security-libs/javax.net.ssl: TLS 1.0 and 1.1 are versions of the TLS protocol that are no longer considered secure and have been superseded by more secure and modern versions (TLS 1.2 and 1.3).
Core Java
-
Java Programming Language Basics
- Object, Class, Encapsulation, Interface, Inheritance, Polymorphism (Method Overloading, Overriding)
- JVM Architecture, Memory Areas
- JVM Class Loader SubSystem
- Core Java Interview Questions & Programs
- Interview Concepts
Stack Posts
- Comparable vs Comparator
- Collections and Arrays
-
String, StringBuffer, and StringBuilder
- String reverse
- Remove single char
- File data to String
- Unicode equality check Spacing entities
- split(String regex, int limit)
- Longest String of an array
-
Object Serialization
- Interface's Serializable vs Externalizable
- Transient Keyword
-
implements Runnablevsextends Thread - JSON
- Files,
Logging API- Append text to Existing file
- Counting number of words in a file
- Properties
- Properties with reference key