project-root/
β
βββ src/app/v1 # Source code directory
β βββ controllers/ # Controllers logic
β βββ modls/ # Data models
β βββ routes/ # API routes
β βββ utils/ # Utility functions
β
βββ config.js # Configuration settings
βββ logger.js # Winston logger configuration
β
βββ .env.development # set the env for development
βββ .env.production # set the env for production
βββ .env.staging # set the env for staging
β
βββ tests/ # Test files
βββ .log # API logs and console logs
βββ .gitignore # Git ignore file
βββ package.json # Node.js dependencies and scripts
βββ README.md # Project documentation
βββ app.js # Entry point for the server
Run Locally
Clone the project
git clone https://link-to-project
Go to the project directory
cd my-project
Install dependencies
npm install
Start the server
npm start
To run the server with specific environment
defaults to development. use development/production/staging
npm start [environment]
React Template
This template is built on top of React + Vite by Miracle Innovation Labsβ‘ at Miracle Software Systems
This Template Comes With
Tailwind CSS: Tailwind CSS is a utility-first CSS framework for rapidly building modern websites without ever leaving your HTML
ShadCn: Beautifully designed components that you can copy and paste into your apps. Accessible. Customizable. Open Source
We recommend using shadcn-ui instead of traditional component libraries
Folder Structure and Naming Conventions
Folder Structure
.
βββ public # This directory contains static assets that are served as-is by your web server
βββ src # This directory contains your application's source code.
β βββ assets # This directory contains static assets that are imported into your JavaScript/JSX files
β βββ components # Contains reusable React components.
β βββ layout # Layout of our application.
β βββ lib # This directory may contain utility functions, helper classes, or any other JavaScript modules
β βββ screens # These screens represent the different user interfaces that users interact with as they navigate
β βββ services # Contains modules responsible for handling interactions with external services, such as APIs.
β βββ App.jsx # Development starts here.
β βββ global.css # Contains Tailwind and shadCn css configuration.
β βββ index.css # Default CSS.
β βββ main.jsx # This is the entry point JavaScript/JSX file where your React application starts.
βββ .env.example # Contains only keys referring to actual environment variables
βββ .eslint.cjs # eslint config
βββ .gitignore # gitignore config
βββ components.json # Shadcn configurations
βββ index.html # Base HTML file
βββ jsconfig.json # jsconfig for alias imports
βββ package.json # Package.json file
βββ postcss.config.js # PostCSS configuration
βββ README.md # This file typically contains information about your project
βββ tailwind.config.js # Tailwind CSS
βββ vite.config.js # Vite config file
- In public folder we have Innovation labs(β€οΈ) logos
- Feel free to edit favicon and title from index.html
Naming Conventions
Colors and Font
colors
In this template, we have configured Miracle standard colors. You can use them like regular Tailwind classes. For example: text-miracle-lightBlue, bg-miracle-black.
miracle: {
lightBlue: '#00aae7',
mediumBlue: '#2368a0',
darkBlue: '#0d416b',
red: '#ef4048',
black: '#232527',
white: '#ffffff',
darkGrey: '#8c8c8c',
lightGrey: '#b7b2b3'
}
Font
Comes with Montserrat as default font can be changed in index.css
Environment Variables
Going forward you need to update .env.example file with your env file for reference purpose in .env.example only keep keys
ENV :
SERVER_URL :
CLIENT_KEY :
Usage
Create a template using the following command and select react
npm create @miraclesoft/project
?select template
> react
Enter your project name >> my-awesome-project
After creating project follow instruction on console
Acknowledgements
Authors