Follow The Steps below to get started with running Algo Basic on your local machine to start developing and contributing.
- Node.js installed
- Install the packages using npm:
npm i
- Create a .env file and specify the variables as given in the .env.example file:
- On UNIX
touch .env
- On Windows
notepad .env
Run a specific node script by typing:
npm run script-name
where 'script-name' is the name of the script. e.g.
npm run sass-dev
- build
- Runs webpack to compile the scss and javascript into the output folder specified in the webpack.config.js file. Needed only for building the production files.
- start
- Runs 'node server.js' and runs the server normally.
- devstart
- Runs the server using nodemon. Constantly watches for updates/changes in code and restarts the server when needed.
- sass-dev
- Runs the Sass compiler in watch mode. Can be used in combination with devstart to make style changes live.
- dev
- The main script you will be using in your development process. Runs both devstart and sass-dev concurrently, making server restarts automatically while also compiling sass on the fly.
- To add new Sass files, add a new file as partial in the public/dev/scss/partials folder where the filename starts with an underscore '_'
- Go to the public/dev/scss/styles.scss file and import your partial in it so it directly gets compiled to the output styles.css file.
- Run the server using:
npm run dev
- Open your browser and go to the link output in the console to open the website. e.g. if the PORT given was 3000, go to http://localhost:3000/
- To view css or js changes after any changes made to the scss files, reload the page.