The project is designed around the following principles:
- Keep the folder structure simple and predictable.
- Avoid unnecessary UI frameworks and abstraction layers.
- Use plain CSS for easier visual customization.
- Separate page styles from component styles.
- Keep API responsibilities separated into routes, controllers, services, and models.
- Make responsive behavior easy to locate and understand.
- Store reusable visual assets in a dedicated assets directory.
- Use
-jrcomments for code sections that are especially useful for junior developers to study.
foraminifera-fossil/
|
|-- api/
| |-- src/
| | |-- config/
| | |-- controllers/
| | | `-- healthController.js
| | |-- middleware/
| | |-- models/
| | |-- routes/
| | | `-- healthRoutes.js
| | |-- services/
| | `-- app.js
| |
| |-- server.js
| |-- package.json
| `-- package-lock.json
|
|-- client/
| |-- public/
| | `-- index.html
| |
| |-- src/
| | |-- assets/
| | | `-- images/
| | | `-- logo.png
| | |
| | |-- components/
| | | |-- Footer.js
| | | `-- Navbar.js
| | |
| | |-- pages/
| | | `-- Home.js
| | |
| | |-- styles/
| | | |-- components/
| | | | |-- footer.css
| | | | `-- navbar.css
| | | |
| | | |-- pages/
| | | | `-- home.css
| | | |
| | | |-- global.css
| | | `-- variables.css
| | |
| | |-- App.js
| | `-- index.js
| |
| |-- babel.config.json
| |-- webpack.config.js
| |-- package.json
| `-- package-lock.json
|
`-- README.md
The frontend is built with:
- React
- React DOM
- JavaScript
- Webpack
- Babel
- Plain CSS
TypeScript is not used.
Vite is not used.
The frontend build process is configured manually with Webpack and Babel so the project structure remains visible and understandable.
public/index.html
|
v
src/index.js
|
v
src/App.js
|
+-- Navbar
|
+-- Home
|
`-- Footer
public/index.html contains the root HTML document and the React root element.
<div id="root"></div>src/index.js connects React to the browser DOM and renders the main App component.
index.js
|
+-- React DOM
+-- App
`-- Global Styles
Styles are separated by responsibility.
styles/
|-- global.css
|-- variables.css
|-- components/
| |-- navbar.css
| `-- footer.css
`-- pages/
`-- home.css
Contains application-wide browser and layout rules.
Examples:
box-sizing- body reset
- default font
- root layout
- shared image behavior
Contains reusable CSS variables.
Example:
:root {
--color-background: #f4f4f4;
--color-surface: #ffffff;
--color-text: #222222;
--color-text-muted: #666666;
--color-border: #cccccc;
--color-primary: #355f5b;
--page-max-width: 1200px;
--spacing-small: 8px;
--spacing-medium: 16px;
--spacing-large: 24px;
}This allows global visual changes without searching through every stylesheet.
Reusable components have their own CSS files.
Navbar.js
navbar.css
Footer.js
footer.css
Each page can have its own stylesheet.
Home.js
home.css
This keeps page-specific styles out of the global stylesheet.
Reusable visual files are stored in:
src/assets/
Images are currently stored in:
src/assets/images/
Example:
src/assets/images/logo.png
The navbar logo is imported directly into the React component.
import logo from "../assets/images/logo.png";The imported asset is then used in JSX.
<img
className="navbar-logo"
src={logo}
alt="GeoKnow"
/>Webpack is configured to process common image formats with Asset Modules.
{
test: /\.(png|jpg|jpeg|gif|svg)$/i,
type: "asset/resource",
}This keeps image files inside the frontend source structure and allows Webpack to include them in the build output.
The initial template is responsive.
The navigation bar uses a desktop menu on larger screens and a toggle menu on smaller screens.
Desktop:
[Logo] Home About Geology Fossils
Mobile:
[Logo] Menu Button
The mobile menu is controlled by React state.
User clicks menu button
|
v
toggleMenu()
|
v
isMenuOpen changes
|
v
navbar-menu-open class is added or removed
|
v
CSS changes menu visibility
Page layouts use CSS media queries.
Example:
@media (max-width: 768px) {
.home-information {
grid-template-columns: 1fr;
}
}The home information area uses three columns on desktop and one column on mobile.
Responsive layout behavior is handled with CSS when the change is purely visual.
React state is used when user interaction is required.
Code sections that are particularly useful for junior developers are marked with the -jr tag.
JavaScript example:
// -jr Mobile navigation open/close stateCSS example:
/* -jr Three desktop columns become one mobile column */The purpose of these comments is to make important state, layout, and responsive behavior easier to locate and study.
The current home page contains a short introduction to foraminifera and their geological importance.
Current sections:
- Foraminifera and Geology
- What are Foraminifera?
- Geological Importance
- Fossil Data
The page currently explains that foraminifera are microscopic marine organisms whose shells can be preserved in sediment and the fossil record.
It also introduces their use in geological age interpretation, paleoenvironmental studies, water-depth analysis, and climate research.
The current navbar contains:
- Logo
- Home
- About
- Geology
- Fossils
The navigation is responsive and includes a mobile toggle menu.
The logo is loaded from:
src/assets/images/logo.png
The footer contains:
- Project title
- Short project description
- Navigation links
- Automatic current year
- Copyright information
The year is generated dynamically.
const currentYear = new Date().getFullYear();The application layout also keeps the footer at the bottom of the viewport when page content is short.
The backend is built with:
- Node.js
- Express.js
- Nodemon for development
The API is structured to separate HTTP routing from controller logic.
Current backend flow:
HTTP Request
|
v
Route
|
v
Controller
|
v
Service
|
v
Model / Database
The services and models directories are currently prepared for future domain and database logic.
server.js
|
v
src/app.js
|
v
routes
|
v
controllers
Responsible only for starting the HTTP server.
Load application
|
v
Open port
|
v
Start server
Responsible for Express application configuration.
Current responsibilities:
- Create the Express application
- Enable JSON request parsing
- Mount API routes
Routes define:
- HTTP method
- URL
- Controller
Example:
router.get("/", getHealth);Business logic should not be placed directly inside route files.
Controllers handle the HTTP request and response layer.
The current health controller returns a JSON response with HTTP status 200.
GET /api/healthDevelopment URL:
http://localhost:5000/api/health
Example response:
{
"status": "ok",
"message": "Foraminifera Fossil API is running."
}Request flow:
GET /api/health
|
v
src/app.js
|
v
healthRoutes.js
|
v
healthController.js
|
v
200 JSON Response
Clone the repository:
git clone https://github.com/datkanber/foraminifera-fossil.gitOpen the project directory:
cd foraminifera-fossilOpen the client directory:
cd clientInstall dependencies:
npm installStart the development server:
npm startThe frontend runs at:
http://localhost:3000
Create a production build:
npm run buildOpen a second terminal and enter the API directory:
cd apiInstall dependencies:
npm installStart the development server:
npm run devThe API runs at:
http://localhost:5000
Start the API without Nodemon:
npm startnpm startStarts the Webpack development server.
npm run buildCreates a production build.
npm run devStarts the Express API with Nodemon.
npm startStarts the Express API with Node.js.
Completed:
- Repository structure
- React setup without Vite
- JavaScript-only frontend
- Manual Webpack configuration
- Babel configuration
- Global CSS structure
- CSS variables
- Dedicated assets structure
- Webpack image asset configuration
- Navbar logo integration
- Responsive navbar
- Mobile navigation toggle
- Home page
- Responsive home information grid
- Footer
- Sticky footer layout
- Express.js API setup
- Modular API routing
- Health controller
- Health check endpoint
The next development steps are expected to include:
- Central API
404handling. - Central Express error middleware.
- CORS configuration.
- Frontend and API connection.
- Fossil and taxon API structure.
- Service-layer implementation.
- Database configuration.
- Neo4j integration.
- Foraminifera sample and taxonomy data modeling.
- Additional pages and data views.
This repository intentionally avoids unnecessary complexity.
The project does not currently use:
- TypeScript
- Vite
- Tailwind CSS
- Bootstrap
- Material UI
- CSS-in-JS
- CSS Modules
The current approach is based on:
React
+
Plain JavaScript
+
Webpack
+
Babel
+
Plain CSS
+
Express.js
The main priority is maintainability, explicit structure, and easy modification by developers with different experience levels.
This project currently uses the ISC license configuration defined in the generated package.json files.
To run this project, make sure you have the following packages installed:
- TensorFlow
- OpenCV
- NumPy
- Matplotlib