Preamble Parser
Live Demo: https://granuels.github.io/Code-Test/
A simple web app that counts how many words in the U.S. Constitution’s Preamble:
- start with t
- end with e
- both start with t and end with e
Built with Dart (compiled to JavaScript), plain HTML and CSS.
Features
- Static Preamble displayed on load
- Parse button to count words per criterion
- Reset button to clear counts and allow custom input
- Responsive, frosted-glass UI over a sunset background
Prerequisites
- Dart SDK ≥ 3.0
- Git
- (Optional) Node.js or Python if you want a simple HTTP server
Getting Started (How to Run the App)
-
Clone the repo
git clone https://github.com/<your-username>/Code-Test.git cd Code-Test
-
Serve the
docs/folder:-
VS Code Live Server (no extra SDKs):
- Install the “Live Server” extension.
- Open the
docs/folder in VS Code. - Right-click
index.html→ Open with Live Server.
-
Node.js (if installed):
npm install -g http-server cd docs http-server -c-1 -
Python (if you have Python but not Node):
cd docs python -m http.server 8080 # or on Windows: py -3 -m http.server 8080
-
-
Open your browser at http://localhost:8080
Contributing/Development
If you want to edit the Dart code:
-
Fetch Dart packages
-
Compile Dart to JavaScript
cd docs dart compile js -O2 -o main.dart.js main.dart -
Serve & Test (See "How to run the app" above)
Running Tests
This project includes two basic unit tests for the parsing logic.
-
Make sure you are in the project root (where
pubspec.yamlfile lives) -
Fetch dev dependencies:
-
Run the Tests:
See DOCUMENTATION.md for in‐depth implementation notes and challenges.